aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bsdinstall
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bsdinstall')
-rw-r--r--usr.sbin/bsdinstall/FreeBSD-base.conf.in4
-rw-r--r--usr.sbin/bsdinstall/Makefile16
-rw-r--r--usr.sbin/bsdinstall/partedit/gpart_ops.c14
-rwxr-xr-xusr.sbin/bsdinstall/scripts/pkgbase.in18
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot2
5 files changed, 30 insertions, 24 deletions
diff --git a/usr.sbin/bsdinstall/FreeBSD-base.conf.in b/usr.sbin/bsdinstall/FreeBSD-base.conf.in
index 792c290facdf..86ec8fabe253 100644
--- a/usr.sbin/bsdinstall/FreeBSD-base.conf.in
+++ b/usr.sbin/bsdinstall/FreeBSD-base.conf.in
@@ -1,7 +1,7 @@
FreeBSD-base: {
- url: "pkg+https://pkg.FreeBSD.org/${ABI}/%%SUBURL%%",
+ url: "pkg+https://%%PKGHOST%%.FreeBSD.org/${ABI}/%%SUBURL%%",
mirror_type: "srv",
signature_type: "fingerprints",
- fingerprints: "/usr/share/keys/pkg",
+ fingerprints: "/usr/share/keys/%%KEYSDIR%%",
enabled: yes
}
diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile
index 5d7be97ed7cf..9a6b25fc5c7a 100644
--- a/usr.sbin/bsdinstall/Makefile
+++ b/usr.sbin/bsdinstall/Makefile
@@ -21,16 +21,26 @@ _REVISION!= ${MAKE} -C ${SRCTOP}/release -V REVISION
REVISION?= ${_REVISION}
.if ${BRANCH} == CURRENT || ${BRANCH} == STABLE
+PKGHOST= pkg
+KEYSDIR= pkg
SUBURL= base_latest
-.elif ${BRANCH} == RELEASE || ${BRANCH:C/[0-9]+$//} == BETA || \
- ${BRANCH:C/[0-9]+$//} == RC
+.elif ${BRANCH} == RELEASE
+PKGHOST= pkgbase
+KEYSDIR= pkgbase-${REVISION:C/\.[0-9]+//}
SUBURL= base_release_${REVISION:C/[0-9]+\.//}
+.elif ${BRANCH:C/[0-9]+$//} == BETA || \
+ ${BRANCH:C/[0-9]+$//} == RC
+PKGHOST= pkgbase
+KEYSDIR= pkgbase-${REVISION:C/\.[0-9]+//}
+SUBURL= base_release_${REVISION:C/[0-9]+\.//}_${BRANCH:tl}
.else
.warning Invalid branch "${BRANCH}"
+PKGHOST= pkg
+KEYSDIR= pkg
SUBURL= base_latest
.endif
FreeBSD-base.conf: FreeBSD-base.conf.in
- sed "s|%%SUBURL%%|${SUBURL}|" < ${.ALLSRC} > ${.TARGET}
+ sed "s|%%PKGHOST%%|${PKGHOST}|;s|%%SUBURL%%|${SUBURL}|;s|%%KEYSDIR%%|${KEYSDIR}|" < ${.ALLSRC} > ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c
index 0bcd17950daf..8da85a805545 100644
--- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
+++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
@@ -139,16 +139,16 @@ newfs_command(const char *fstype, int use_default)
} else if (strcmp(fstype, "freebsd-zfs") == 0) {
int i;
struct bsddialog_menuitem items[] = {
- {"", 0, true, "fletcher4", "checksum algorithm: fletcher4",
+ {"", true, 0, "fletcher4", "checksum algorithm: fletcher4",
"Use fletcher4 for data integrity checking. "
"(default)"},
- {"", 0, false, "fletcher2", "checksum algorithm: fletcher2",
+ {"", false, 0, "fletcher2", "checksum algorithm: fletcher2",
"Use fletcher2 for data integrity checking. "
"(not recommended)"},
- {"", 0, false, "sha256", "checksum algorithm: sha256",
+ {"", false, 0, "sha256", "checksum algorithm: sha256",
"Use sha256 for data integrity checking. "
"(not recommended)"},
- {"", 0, false, "atime", "Update atimes for files",
+ {"", false, 0, "atime", "Update atimes for files",
"Disable atime update"},
};
@@ -188,11 +188,11 @@ newfs_command(const char *fstype, int use_default)
strcmp(fstype, "ms-basic-data") == 0) {
int i;
struct bsddialog_menuitem items[] = {
- {"", 0, true, "FAT32", "FAT Type 32",
+ {"", true, 0, "FAT32", "FAT Type 32",
"Create a FAT32 filesystem (default)"},
- {"", 0, false, "FAT16", "FAT Type 16",
+ {"", false, 0, "FAT16", "FAT Type 16",
"Create a FAT16 filesystem"},
- {"", 0, false, "FAT12", "FAT Type 12",
+ {"", false, 0, "FAT12", "FAT Type 12",
"Create a FAT12 filesystem"},
};
diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in
index 5299d34fcb71..89ddc244171e 100755
--- a/usr.sbin/bsdinstall/scripts/pkgbase.in
+++ b/usr.sbin/bsdinstall/scripts/pkgbase.in
@@ -309,7 +309,7 @@ local function parse_options()
end
-- Fetch and install pkgbase packages to BSDINSTALL_CHROOT.
--- Respect BSDINSTALL_PKG_REPOS_DIR if set, otherwise use pkg.freebsd.org.
+-- Respect BSDINSTALL_PKG_REPOS_DIR if set, otherwise use pkgbase.freebsd.org.
local function pkgbase()
local options = parse_options()
@@ -323,21 +323,13 @@ local function pkgbase()
local chroot = assert(os.getenv("BSDINSTALL_CHROOT"))
assert(os.execute("mkdir -p " .. chroot))
- -- Always install the default FreeBSD-base.conf file to the chroot, even
- -- if we don't actually fetch the packages from the repository specified
- -- there (e.g. because we are performing an offline installation).
- local chroot_repos_dir = chroot .. "/usr/local/etc/pkg/repos/"
- assert(os.execute("mkdir -p " .. chroot_repos_dir))
- assert(os.execute("cp /usr/share/bsdinstall/FreeBSD-base.conf " ..
- chroot_repos_dir))
-
local repos_dir = os.getenv("BSDINSTALL_PKG_REPOS_DIR")
if not repos_dir then
- repos_dir = chroot_repos_dir
+ repos_dir = "/usr/share/bsdinstall/"
-- Since pkg always interprets fingerprints paths as relative to
-- the --rootdir we must copy the key from the host.
assert(os.execute("mkdir -p " .. chroot .. "/usr/share/keys"))
- assert(os.execute("cp -R /usr/share/keys/pkg " .. chroot .. "/usr/share/keys/"))
+ assert(os.execute("cp -R /usr/share/keys/* " .. chroot .. "/usr/share/keys/"))
end
-- We must use --repo-conf-dir rather than -o REPOS_DIR here as the latter
@@ -363,6 +355,10 @@ local function pkgbase()
if not os.execute(pkg .. "install -U -y -r FreeBSD-base " .. packages) then
os.exit(1)
end
+
+ -- Enable the FreeBSD-base repository for this system.
+ assert(os.execute("mkdir -p " .. chroot .. "/usr/local/etc/pkg/repos"))
+ assert(os.execute("echo 'FreeBSD-base: { enabled: yes }' > " .. chroot .. "/usr/local/etc/pkg/repos/FreeBSD.conf"))
end
pkgbase()
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index 9ea6ec3a4ac9..a4c9220a709c 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -216,7 +216,7 @@ KLDLOAD='kldload %s'
LN_SF='ln -sf "%s" "%s"'
MKDIR_P='mkdir -p "%s"'
MOUNT_TYPE='mount -t %s "%s" "%s"'
-NEWFS_ESP='newfs_msdos "%s"'
+NEWFS_ESP='newfs_msdos -F 32 -c 1 "%s"'
PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\""
PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"'
SHELL_TRUNCATE=':> "%s"'