diff options
| author | Allan Jude <allanjude@FreeBSD.org> | 2016-05-23 17:04:13 +0000 |
|---|---|---|
| committer | Allan Jude <allanjude@FreeBSD.org> | 2016-05-23 17:04:13 +0000 |
| commit | b06bc65e715874b73af4ca3b7bf3df391ed9f5fd (patch) | |
| tree | 88d1ac6d9e357115b1cc3d3b5befe99f756dd99e /usr.sbin/bsdinstall/scripts/zfsboot | |
| parent | 10b4196bd0273db8b7367cdaa1e9188cc85a857a (diff) | |
Notes
Diffstat (limited to 'usr.sbin/bsdinstall/scripts/zfsboot')
| -rwxr-xr-x | usr.sbin/bsdinstall/scripts/zfsboot | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index bad1147701f7..1666176a046d 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -1310,10 +1310,6 @@ zfs_create_boot() "mountpoint=/$zroot_name" "$zroot_name" || return $FAILURE - f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." - f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ - "$zroot_name/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" - # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." local dir @@ -1338,17 +1334,17 @@ zfs_create_boot() "bootfs=\"$zroot_name/$zroot_bootfs\"" "$zroot_name" || return $FAILURE - # Export the pool(s) - f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || - return $FAILURE - if [ "$ZFSBOOT_BOOT_POOL" ]; then - f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ - "$bootpool_name" || return $FAILURE - fi - # MBR boot loader touch-up if [ "$ZFSBOOT_PARTITION_SCHEME" = "MBR" ]; then + # Export the pool(s) + f_dprintf "$funcname: Temporarily exporting ZFS pool(s)..." + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" "$zroot_name" || + return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname zpool "$ZPOOL_EXPORT" \ + "$bootpool_name" || return $FAILURE + fi + f_dprintf "$funcname: Updating MBR boot loader on disks..." # Stick the ZFS boot loader in the "convenient hole" after # the ZFS internal metadata @@ -1357,17 +1353,17 @@ zfs_create_boot() /boot/zfsboot /dev/$disk$bootpart \ "skip=1 seek=1024" || return $FAILURE done - fi - # Re-import the ZFS pool(s) - f_dprintf "$funcname: Re-importing ZFS pool(s)..." - f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || - return $FAILURE - if [ "$ZFSBOOT_BOOT_POOL" ]; then + # Re-import the ZFS pool(s) + f_dprintf "$funcname: Re-importing ZFS pool(s)..." f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ - "-o altroot=\"$BSDINSTALL_CHROOT\"" \ - "$bootpool_name" || return $FAILURE + "-o altroot=\"$BSDINSTALL_CHROOT\"" "$zroot_name" || + return $FAILURE + if [ "$ZFSBOOT_BOOT_POOL" ]; then + f_eval_catch $funcname zpool "$ZPOOL_IMPORT_WITH_OPTIONS" \ + "-o altroot=\"$BSDINSTALL_CHROOT\"" \ + "$bootpool_name" || return $FAILURE + fi fi # While this is apparently not needed, it seems to help MBR @@ -1378,6 +1374,14 @@ zfs_create_boot() "cachefile=\"$BSDINSTALL_CHROOT/boot/zfs/zpool.cache\"" \ "$zroot_name" || return $FAILURE + # + # Set canmount=noauto so that the default Boot Environment (BE) does not + # get mounted if a different BE is selected from the beastie menu + # + f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." + f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ + "$zroot_name/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" + # Last, but not least... required lines for rc.conf(5)/loader.conf(5) # NOTE: We later concatenate these into their destination f_dprintf "%s: Configuring rc.conf(5)/loader.conf(5) additions..." \ |
