From ef8b872301c5fbeeea3b0410b369b8f36584cd65 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 17 Aug 2022 11:33:58 -0600 Subject: [PATCH] stand: Flesh out the zfs image creation Move the mbr non-geli zfs cases to no-priv creation with makefs / mkimg. Add comments about the weird thing we do for MBR + ZFS + Legacy. Add comments about other architectures. Still need to think through how to leverage a completed universe to do all the architectures... Sponsored by: Netflix --- tools/boot/rootgen.sh | 150 +++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 96 deletions(-) diff --git a/tools/boot/rootgen.sh b/tools/boot/rootgen.sh index f087afa5ad49..06e8a1ec8245 100755 --- a/tools/boot/rootgen.sh +++ b/tools/boot/rootgen.sh @@ -214,35 +214,21 @@ mk_nogeli_mbr_zfs_legacy() { bios=$7 pool=nogeli-mbr-zfs-legacy - dd if=/dev/zero of=${img} count=1 seek=$((200 * 1024 * 1024 / 512)) - md=$(mdconfig -f ${img}) - gpart create -s mbr ${md} - gpart add -t freebsd ${md} - gpart set -a active -i 1 ${md} - gpart create -s bsd ${md}s1 - gpart add -t freebsd-zfs ${md}s1 - # install-boot will make this bootable - zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}s1a - zpool set bootfs=${pool} ${pool} - zfs create -po mountpoint=/ ${pool}/ROOT/default - # NB: The online guides go nuts customizing /var and other mountpoints here, no need - cpsys ${src} ${mntpt} - # need to make a couple of tweaks - cat >> ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf <