]> git.proxmox.com Git - mirror_zfs.git/commitdiff
initramfs: Make mountpoint=none work
authorRyan Moeller <ryan@iXsystems.com>
Mon, 6 Feb 2023 19:16:01 +0000 (14:16 -0500)
committerGitHub <noreply@github.com>
Mon, 6 Feb 2023 19:16:01 +0000 (11:16 -0800)
In initramfs, mount.zfs fails to mount a dataset with mountpoint=none,
but mount.zfs -o zfsutil works.  Use -o zfsutil when mountpoint=none.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #14455

contrib/initramfs/scripts/zfs

index 41a4d96f87321356e127292e23584a95441a29d9..d1a99e4a87bab360217b6e3540d374ec85353a93 100644 (file)
@@ -359,9 +359,11 @@ mount_fs()
                                # isn't the root fs.
                                return 0
                        fi
-                       ZFS_CMD="mount.zfs"
                        # Last hail-mary: Hope 'rootmnt' is set!
                        mountpoint=""
+                       if [ "$mountpoint" = "legacy" ]; then
+                               ZFS_CMD="mount.zfs"
+                       fi
                else
                        mountpoint="$mountpoint1"
                fi