Skip to content

Commit

Permalink
initramfs: Make mountpoint=none work
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #14455
(cherry picked from commit eb823cb)
  • Loading branch information
Ryan Moeller authored and behlendorf committed Feb 9, 2023
1 parent e45a981 commit 8473829
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contrib/initramfs/scripts/zfs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8473829

Please sign in to comment.