From 8b7342d2904dbcdbbf96279c06ae8cb10948fb8a Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Wed, 15 Mar 2023 00:40:55 +0100 Subject: [PATCH] Fix for mountpoint=legacy We need to clear mountpoint only after checking it. Reviewed-by: Brian Behlendorf Reviewed-by: Richard Yao Signed-off-by: ofthesun9 Closes #14599 Closes #14604 --- contrib/initramfs/scripts/zfs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index 97d471cc82..23aa95efc8 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -359,11 +359,12 @@ mount_fs() # isn't the root fs. return 0 fi - # Last hail-mary: Hope 'rootmnt' is set! - mountpoint="" + # Don't use mount.zfs -o zfsutils for legacy mountpoint if [ "$mountpoint" = "legacy" ]; then ZFS_CMD="mount.zfs" fi + # Last hail-mary: Hope 'rootmnt' is set! + mountpoint="" else mountpoint="$mountpoint1" fi