From 1e2ce45f2e9206097f181a72eb514f6fd99b1b87 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 f0ea20ddc17f..4ce739fda704 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