Skip to content
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

Re-enable zfs-dracut packaging #122

Closed
wants to merge 2 commits into from

Conversation

l1k
Copy link

@l1k l1k commented Oct 7, 2014

This was disabled with f044301 in January 2012 as it was broken back then, but the situation has improved vastly in the meantime. The zfs-dracut package not only works well with dracut-038 on Debian Jessie but offers one significant advantage over initramfs-tools: The ability to export a ZFS root on shutdown, eliminating the necessity to force-import on every reboot. A patch to achieve that was submitted yesterday with openzfs/zfs#2766. (I can add that patch to this pull request if you want.) Note that there's currently a bug in Debian's dracut_038-2 package which prevents the systemd unit files from being included in the package. I'll submit a bug report to the maintainer in a bit and will add the bug number in a comment here. Without that fix, exporting the ZFS root on shutdown doesn't work.

I've also added a dependency to package zfs-initramfs on initramfs-tools, analogously to the dependency of package zfs-dracut on dracut. This ensures that a user may install only one of zfs-dracut and zfs-initramfs at the same time since dracut and initramfs-tools conflict.

I'm not sure if this is the correct branch to submit this pull request, all others seemed stale. Please let me know if I should re-submit to a different branch. Thanks.

l1k added 2 commits October 3, 2014 02:18
Remove lines that contain only a hyphen (match '^-$' instead of '-').

I had a root fs with a hyphen in the name (fedora/ROOT/Fedora20-Dev),
it was not detected because sed eliminated that line of output from
'zpool list -Ho bootfs'.

Signed-off-by: Evan Susarret <evansus@gmail.com>
Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2196

(cherry picked from commit dc55d79)
This was disabled with f044301
in January 2012 as it was broken back then, but the situation
has improved vastly in the meantime. The zfs-dracut package
not only works well with dracut-038 on Debian Jessie but offers
one significant advantage over initramfs-tools: The ability to
export a ZFS root on shutdown, eliminating the necessity to
force-import on every reboot.
@dajhorn
Copy link
Member

dajhorn commented Oct 7, 2014

I'm not sure if this is the correct branch to submit this pull request, all others seemed stale. Please let me know if I should re-submit to a different branch.

@l1k, this pull request can stay parked here until it can be rebased on a branch that is maintained by @FransUrbo for Debian.

// Although dracut was promoted to a supported main component in Debian, it is still outdated and unsupported in Ubuntu.

@l1k
Copy link
Author

l1k commented Oct 7, 2014

Just for the record, Debian bug #764393 tracks inclusion of the systemd units in the dracut Debian package. These are required to properly export a ZFS root on shutdown.

@l1k
Copy link
Author

l1k commented Feb 21, 2015

As requested by @FransUrbo, I've rebased this pull request (plus 6 commits made to the dracut directory of zfsonlinux/zfs:master this month) onto snapshot/debian/jessie/0.6.3-26_33b4de_jessie, it can be pulled from l1k/pkg-zfs:snapshot/debian/jessie/0.6.3-26_33b4de_jessie_dracut. (It looks like pull requests can't be initiated from a tag. Am I missing something?).

The Debian dailies contain pull request openzfs/zfs#2087 which proposed a common library that is used by both dracut and initramfs-tools. The pull request was closed without being merged into zfsonlinux/zfs:master, I'm not sure why. My 2 cents on this:

  • Initramfs scripts for ZoL. openzfs/zfs#2087 installs the common library to @datarootdir@/initramfs-tools/scripts/zfs and the dracut script mount-zfs.sh.in sources it from there. Consequently, the zfs-dracut Debian package would have to depend on zfs-initramfs. However, zfs-initramfs depends on initramfs-tools which conflicts with Debian package dracut.
  • The mount-zfs.sh.in script sets various log variables, then sources the common library. Right at the top of the common library those same variables are set once more.
  • Using a common library is a great idea in principle. But: Further down the road the 90zfs dracut module and the zfs initramfs scripts will probably be submitted for inclusion in dracut and initramfs-tools, respecively. Chances are that the code will diverge from that point. For instance I've submitted a pull request to the 90dm dracut module this month and Harald Hoyer (the dracut maintainer) changed backticks to $(...) when he merged it, apparently for consistency with the other modules. I've got no problem with that but it goes to show that when submitting the code to dracut and initramfs-tools (which is generally the right thing to do), we'll cease control of the code and the common library likely won't be common any more.
  • Someone else did a major refactoring of the dracut module with pull request Refactored dracut module openzfs/zfs#3109. The same developer and two other people (including yours truly) contributed changes to the dracut code in zfonlinux/zfs:master this month, most likely being unaware of Initramfs scripts for ZoL. openzfs/zfs#2087. (At least I was unaware of it.) Off the top of my head I'm not sure how to best resolve the two conflicting developments of the dracut module in zfsonlinux/zfs:master versus the Debian dailies. To be able to rebase on snapshot/debian/jessie/0.6.3-26_33b4de_jessie, I reverted the dracut portion of Initramfs scripts for ZoL. openzfs/zfs#2087. The proper solution would probably involve checking that the initramfs code as per Initramfs scripts for ZoL. openzfs/zfs#2087 has feature parity and supports the same kernel parameters as the new dracut code.

@l1k
Copy link
Author

l1k commented Feb 25, 2015

Merged into snapshot/debian/jessie/0.6.3-27_1d9663_jessie. Thank you!

@l1k l1k closed this Feb 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants