-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dracut: support mountpoint=legacy for root dataset #15149
Conversation
@nabijaczleweli Hi, could you take a look please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, must've missed this use-case when converting. functionally looks sane, but see comment
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts. mountpoint=/ or mountpoint=/sysroot also works. Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for root datasets with mountpoint != legacy. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
If you use 3eaacdf which has a diff -w of diff --git a/contrib/dracut/90zfs/zfs-env-bootfs.service.in b/contrib/dracut/90zfs/zfs-env-bootfs.service.in
index 7ebab4c1a..fe362b930 100644
--- a/contrib/dracut/90zfs/zfs-env-bootfs.service.in
+++ b/contrib/dracut/90zfs/zfs-env-bootfs.service.in
@@ -12,6 +12,7 @@ ExecStart=/bin/sh -c '
decode_root_args || exit 0; \
[ "$root" = "zfs:AUTO" ] && root="$(@sbindir@/zpool list -H -o bootfs | grep -m1 -vFx -)"; \
rootflags="$(getarg rootflags=)"; \
+ [ "$(@sbindir@/zfs get -H -o value mountpoint "$root")" = legacy ] || \
case ",$rootflags," in \
*,zfsutil,*) ;; \
,,) rootflags=zfsutil ;; \ (untested, but no reason it shouldn't work) then this is g2g imo. |
Thanks for the quick response. I will test this and update the PR. |
bf8ae34
to
3eaacdf
Compare
@nabijaczleweli tested and updated to your commit, thank you. By the way, for future reference, how do I install just the dracut modules from the zfs tree? |
idk, i just apply the diffs. but if you |
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts. mountpoint=/ or mountpoint=/sysroot also works. Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for root datasets with mountpoint != legacy. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Rafael Kitover <rkitover@gmail.com> Closes openzfs#15149
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts. mountpoint=/ or mountpoint=/sysroot also works. Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for root datasets with mountpoint != legacy. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Rafael Kitover <rkitover@gmail.com> Closes #15149
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts. mountpoint=/ or mountpoint=/sysroot also works. Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for root datasets with mountpoint != legacy. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Rafael Kitover <rkitover@gmail.com> Closes openzfs#15149
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts.
mountpoint=/ or mountpoint=/sysroot also works.
Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for non-legacy root datasets, using the support function determine_rootflags() added to zfs-lib.sh.
Motivation and Context
This allows using the dracut kernel commandline option
root=ZFS=pool/dataset
for datasets that havemountpoint=legacy
set.This is documented as already working, but it looks like once the root mount was switched to use the generator stuff it broke.
How Has This Been Tested?
I made the changes in my
/usr/lib/dracut/modules.d/90zfs
and reran dracut on my system, testing booting the root dataset with mountpoint being/
,/sysroot
andlegacy
.Types of changes