]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix `zfs:AUTO` autodetection in initramfs scripts
authorDamian Szuberski <30863496+szubersk@users.noreply.github.com>
Sat, 13 Nov 2021 15:02:50 +0000 (16:02 +0100)
committerGitHub <noreply@github.com>
Sat, 13 Nov 2021 15:02:50 +0000 (08:02 -0700)
Don't exit early in find_rootfs() when zpool.bootfs
is set to `zfs:AUTO`.

Reviewed-by: Richard Laager <rlaager@wiktel.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #12658

contrib/initramfs/scripts/zfs

index ad20eeb4948e05a50a5dbaf5763b6577a5c19394..ccb42ce103b9421ad8375881bc464213e487fbfa 100644 (file)
@@ -79,7 +79,9 @@ find_rootfs()
 
        # If it's already specified, just keep it mounted and exit
        # User (kernel command line) must be correct.
-       [ -n "${ZFS_BOOTFS}" ] && return 0
+       if [ -n "${ZFS_BOOTFS}" ] && [ "${ZFS_BOOTFS}" != "zfs:AUTO" ]; then
+               return 0
+       fi
 
        # Not set, try to find it in the 'bootfs' property of the pool.
        # NOTE: zpool does not support 'get -H -ovalue bootfs'...
@@ -756,7 +758,7 @@ mountroot()
        #       rpool=rpool                     (default if none of the above is used)
        #       root=<pool>/<dataset>           (uses this for rpool - first part)
        #       root=ZFS=<pool>/<dataset>       (uses this for rpool - first part, without 'ZFS=')
-       #       root=zfs:AUTO                   (tries to detect both pool and rootfs
+       #       root=zfs:AUTO                   (tries to detect both pool and rootfs)
        #       root=zfs:<pool>/<dataset>       (uses this for rpool - first part, without 'zfs:')
        #
        # Option <dataset> could also be <snapshot>