Merge pull request #205 from saveriomiroddi/generalize_fix_fs_mount_ordering

Generalize fix filesystem mount ordering
This commit is contained in:
Saverio Miroddi 2021-06-06 12:55:01 +02:00 committed by GitHub
commit 28f2138c87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1450,10 +1450,15 @@ function fix_filesystem_mount_ordering {
local success= local success=
if [[ ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$c_bpool_name || ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$v_rpool_name ]]; then if [[ ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$c_bpool_name || ! -s $c_zfs_mount_dir/etc/zfs/zfs-list.cache/$v_rpool_name ]]; then
local zfs_root_fs zfs_boot_fs
zfs_root_fs=$(chroot_execute 'zfs list / | awk "NR==2 {print \$1}"')
zfs_boot_fs=$(chroot_execute 'zfs list /boot | awk "NR==2 {print \$1}"')
# For the rpool only, it takes around half second on a test VM. # For the rpool only, it takes around half second on a test VM.
# #
chroot_execute "zfs set canmount=on $c_bpool_name" chroot_execute "zfs set canmount=on $zfs_boot_fs"
chroot_execute "zfs set canmount=on $v_rpool_name/ROOT" chroot_execute "zfs set canmount=on $zfs_root_fs"
SECONDS=0 SECONDS=0