diff options
author | Richard Laager <[email protected]> | 2017-11-23 21:54:48 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-11-28 09:38:00 -0800 |
commit | bd2958dea02f1126c4e907ab55c385ef24431f15 (patch) | |
tree | 11039a279b8c589c0d3f251009b9167e4c35d104 /contrib/initramfs | |
parent | 1c68856bcaad053bb21acdde4ca952b764edd664 (diff) |
initramfs: Honor mountpoint=none/legacy
For filesystems that are children of the rootfs, when mountpoint=none or
mountpoint=legacy, the initrafms script would assume a mountpoint based
on the dataset path. Given that the rootfs should have mountpoint=/ and
mountpoint inheritance is is the default behavior of ZFS, this behavior
seems unnecessary. In any event, it turns mountpoint=none into a no-op.
That removes this option from the administrator, and if someone uses it,
it does not work as expected. Worse yet, if the mountpoint directory
does not exist (which is the typical case for mountpoint=none), the
mounting and thus the boot process will fail. For the case of
mountpoint=legacy, the assumed mountpoint may not be the correct value
set in /etc/fstab.
This change makes the initramfs script not mount the filesystem in
either case. For mountpoint=none, this means we are correctly honoring
the setting. For mountpoint=legacy, there are two scenarios: If
canmount=on, the filesystem will be mounted by the normal mechanisms
later in the boot process. If canmount=noauto, the filesystem will not
be mounted at all, unless the administrator has done something special.
If they're not doing something special and they want it mounted by the
initramfs, they can simply not set mountpoint=legacy.
This is part of the fix for:
https://github.com/zfsonlinux/pkg-zfs/issues/221
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Richard Laager <[email protected]>
Closes #6897
Diffstat (limited to 'contrib/initramfs')
-rw-r--r-- | contrib/initramfs/scripts/zfs.in | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/initramfs/scripts/zfs.in b/contrib/initramfs/scripts/zfs.in index 3d3aa537d..52098cc14 100644 --- a/contrib/initramfs/scripts/zfs.in +++ b/contrib/initramfs/scripts/zfs.in @@ -329,11 +329,9 @@ mount_fs() "$mountpoint" = "-" ] then if [ "$fs" != "${ZFS_BOOTFS}" ]; then - # We don't have a proper mountpoint, this - # isn't the root fs. So extract the root fs - # value from the filesystem, and we should - # (hopefully!) have a mountpoint we can use. - mountpoint="${fs##$ZFS_BOOTFS}" + # We don't have a proper mountpoint and this + # isn't the root fs. + return 0 else # Last hail-mary: Hope 'rootmnt' is set! mountpoint="" |