From eb823cbc76d28a7cafdf6a7aafdefe7e74fe26bc 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 --- 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 41a4d96f8732..d1a99e4a87ba 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -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