Closed l1k closed 9 years ago
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.
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.
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 zfsonlinux/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:
@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
.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.$(...)
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.Merged into snapshot/debian/jessie/0.6.3-27_1d9663_jessie. Thank you!
This was disabled with f044301bacbe69848fd4c0fcd02f5b4d08d7f298 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 zfsonlinux/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.