From 8473829d1f1f2d30d2629364204cda071749af60 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Mon, 6 Feb 2023 14:16:01 -0500 Subject: [PATCH] initramfs: Make mountpoint=none work 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 Reviewed-by: Richard Yao Signed-off-by: Ryan Moeller Closes #14455 (cherry picked from commit eb823cbc76d28a7cafdf6a7aafdefe7e74fe26bc) --- contrib/initramfs/scripts/zfs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index e25ce689541e..19b5e4a57aca 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -341,9 +341,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