Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Apr 2019 00:08:15 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346654 - head/tools/boot
Message-ID:  <201904250008.x3P08FfB089803@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Thu Apr 25 00:08:15 2019
New Revision: 346654
URL: https://svnweb.freebsd.org/changeset/base/346654

Log:
  For the geli-gpt-zfs test images, both bios and uefi flavors, add a dummy
  ufs partition as p2, and put the zfs partition at p3, to test the ability
  of the zfs probe code to find a zfs pool on something other than the first
  partition.

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==============================================================================
--- head/tools/boot/rootgen.sh	Wed Apr 24 23:52:38 2019	(r346653)
+++ head/tools/boot/rootgen.sh	Thu Apr 25 00:08:15 2019	(r346654)
@@ -487,15 +487,20 @@ mk_geli_gpt_zfs_legacy() {
     bios=$7
     pool=geli-gpt-zfs-legacy
 
-    dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 ))
+    # Note that in this flavor we create an empty p2 ufs partition, and put
+    # the bootable zfs stuff on p3, just to test the ability of the zfs probe
+    # probe routines to find a pool on a partition other than the first one.
+
+    dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 ))
     md=$(mdconfig -f ${img})
     gpart create -s gpt ${md}
     gpart add -t freebsd-boot -s 400k -a 4k	${md}	# <= ~540k
+    gpart add -t freebsd-ufs -s 100m ${md}
     gpart add -t freebsd-zfs -l root $md
     # install-boot will make this bootable
-    echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2
-    echo ${passphrase} | geli attach -j - ${md}p2
-    zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli
+    echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3
+    echo ${passphrase} | geli attach -j - ${md}p3
+    zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli
     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
@@ -516,7 +521,7 @@ EOF
     zpool set bootfs=${pool}/ROOT/default ${pool}
     zpool set autoexpand=on ${pool}
     zpool export ${pool}
-    geli detach ${md}p2
+    geli detach ${md}p3
     ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md}
     mdconfig -d -u ${md}
 }
@@ -531,15 +536,20 @@ mk_geli_gpt_zfs_uefi() {
     bios=$7
     pool=geli-gpt-zfs-uefi
 
-    dd if=/dev/zero of=${img} count=1 seek=$(( 200 * 1024 * 1024 / 512 ))
+    # Note that in this flavor we create an empty p2 ufs partition, and put
+    # the bootable zfs stuff on p3, just to test the ability of the zfs probe
+    # probe routines to find a pool on a partition other than the first one.
+
+    dd if=/dev/zero of=${img} count=1 seek=$(( 300 * 1024 * 1024 / 512 ))
     md=$(mdconfig -f ${img})
     gpart create -s gpt ${md}
     gpart add -t efi -s ${espsize}k -a 4k ${md}
+    gpart add -t freebsd-ufs -s 100m ${md}
     gpart add -t freebsd-zfs -l root $md
     # install-boot will make this bootable
-    echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p2
-    echo ${passphrase} | geli attach -j - ${md}p2
-    zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p2.eli
+    echo ${passphrase} | geli init -bg -e AES-XTS -i ${iterations} -J - -l 256 -s 4096 ${md}p3
+    echo ${passphrase} | geli attach -j - ${md}p3
+    zpool create -O mountpoint=none -R ${mntpt} ${pool} ${md}p3.eli
     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
@@ -560,7 +570,7 @@ EOF
     zpool set bootfs=${pool}/ROOT/default ${pool}
     zpool set autoexpand=on ${pool}
     zpool export ${pool}
-    geli detach ${md}p2
+    geli detach ${md}p3
     ${SRCTOP}/tools/boot/install-boot.sh -g ${geli} -s ${scheme} -f ${fs} -b ${bios} -d ${src} ${md}
     mdconfig -d -u ${md}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904250008.x3P08FfB089803>