Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628404 - sys-fs/zfs USE=rootfs should optionally depend on dracut
Summary: sys-fs/zfs USE=rootfs should optionally depend on dracut
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Richard Yao (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-20 18:11 UTC by Richard Freeman
Modified: 2020-06-10 21:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Freeman gentoo-dev 2017-08-20 18:11:28 UTC
Dracut is tested and confirmed working on rootfs (and boot) with zfs.  I tested with zfs-7.1 and dracut-044-r1 under systemd.  

The necessary file is /usr/lib64/dracut/modules.d/90zfs/export-zfs.sh - this is installed by sys-fs/zfs.  In theory any zfs versions that provide this file should work, though I'm not sure it is really necessary to backport this.

Note that this will probably only work under systemd - I don't believe that openrc will pivot back to dracut during shutdown.  The functionality to do this has been standard in systemd and dracut for a while.  I suppose you could add an && dep on systemd when using dracut, but inadvertently pulling in systemd when installing zfs is undesirable.

If using zfs+dracut+systemd the export is completely automatic and requires no configuration (other than rebuilding the initramfs, which anybody using zfs on root will have to do anyway when installing zfs).
Comment 1 Simon 2017-10-08 12:58:56 UTC
(In reply to Richard Freeman from comment #0)
> Note that this will probably only work under systemd - I don't believe that
> openrc will pivot back to dracut during shutdown.  The functionality to do
> this has been standard in systemd and dracut for a while.  I suppose you
> could add an && dep on systemd when using dracut, but inadvertently pulling
> in systemd when installing zfs is undesirable.

I'm considering switching to dracut because of bug 627320 and I'm interested in what the above means when using OpenRC.
Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it result in issues?
And what needs to be done to fix it?

P.S. I believe this issue is already adressed in https://bugs.gentoo.org/626362#c12 with this as the result https://github.com/gentoo/gentoo/blob/master/sys-fs/zfs/zfs-0.7.1-r1.ebuild#L56
Comment 2 Richard Freeman gentoo-dev 2017-10-08 13:13:06 UTC
(In reply to Simon from comment #1)
> 
> I'm considering switching to dracut because of bug 627320 and I'm interested
> in what the above means when using OpenRC.
> Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it
> result in issues?
> And what needs to be done to fix it?
> 

Honestly, I'm not sure if there are any issues with openrc.  If it pivots back then it might work fine.  I haven't looked into how openrc works with any of the other apparently-working initramfs solutions.

If it doesn't work then the solution would be to enable openrc to pivot back to dracut.  That might require changes in either or both.

It has been a while since I've run openrc...
Comment 3 Simon 2017-10-08 16:49:05 UTC
(In reply to Richard Freeman from comment #2)
> (In reply to Simon from comment #1)
> > 
> > I'm considering switching to dracut because of bug 627320 and I'm interested
> > in what the above means when using OpenRC.
> > Does what you wrote mean that ZFS + dracut + OpenRC is broken? Will it
> > result in issues?
> > And what needs to be done to fix it?
> > 
> 
> Honestly, I'm not sure if there are any issues with openrc.  If it pivots
> back then it might work fine.  I haven't looked into how openrc works with
> any of the other apparently-working initramfs solutions.
> 
> If it doesn't work then the solution would be to enable openrc to pivot back
> to dracut.  That might require changes in either or both.
> 
> It has been a while since I've run openrc...


OK, thanks for the info!
I'll simply give it a try and file a bug to OpenRC if it doesn't work correctly.
Comment 4 Jonathan Vasquez (RETIRED) gentoo-dev 2017-10-13 03:17:51 UTC
From what I understand from ZFS and from my discussions with ryao and some other ZFS people, ZFS users are not suppose to export their zpools if they are keeping the pool on the same system. Only in situations where zpools are going to be moved/migrated to another machine, should they be exported.
Comment 5 Larry the Git Cow gentoo-dev 2019-08-18 01:19:25 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdc36a3d1f6fbcf8f1496c6e7887e94061a0aa54

commit fdc36a3d1f6fbcf8f1496c6e7887e94061a0aa54
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2019-08-18 00:46:50 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2019-08-18 01:04:15 +0000

    sys-fs/zfs: update live ebuild
    
    clarify initramfs support.
    many people try to use different unsupported  or outdated tools,
    only genkernel and dracut are tested.
    
    Bug: https://bugs.gentoo.org/628404
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 sys-fs/zfs/zfs-9999.ebuild | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
Comment 6 Georgy Yakovlev archtester gentoo-dev 2020-06-10 21:57:09 UTC
we don't depend on initramfs generator, but mention supported ones in postinst message. closing.