From a5c469c5f380b09705ad0bee15e2ca7a5f78213c 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 f0ea20ddc1..4ce739fda7 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -341,11 +341,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