Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 544520 - Initramfs: ZFS-Root import attempt before unlocking GPG-LUKS device
Summary: Initramfs: ZFS-Root import attempt before unlocking GPG-LUKS device
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL: http://forums.gentoo.org/viewtopic-t-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-25 22:52 UTC by Mark D
Modified: 2021-03-15 21:47 UTC (History)
0 users

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 Mark D 2015-03-25 22:52:21 UTC
Recap of what I discovered in:
http://forums.gentoo.org/viewtopic-t-1011144.html

When using sys-kernel/genkernel-next (version ~60) to generate an initramfs that unlocks a LUKS device with a GPG-encrypted keyfile, to then import a ZFS root, the ZFS import does not take place, or takes place too soon. The initramfs cannot mount the root volume and drops into the rescue shell.

I ran this line to create it:
genkernel --install --luks --gpg --busybox --zfs initramfs

I'm booting with:
real_root=ZFS=system/root ro crypt_root=UUID=xxxxxx root_keydev=UUID=xxxxxx root_key=luks-key.gpg

Unpacking the init-file, I discovered the load order of its functions:
-------------------------------------------------
start_volumes
zfs_start_volumes

setup_keymap

# Initialize LUKS root device except for livecd's
is_livecd || start_luks 
-------------------------------------------------

I did an amateur fix by placing another zfs_start_volumes AFTER the start_luks:
-------------------------------------------------
start_volumes
zfs_start_volumes

setup_keymap

# Initialize LUKS root device except for livecd's
is_livecd || start_luks

zfs_start_volumes 
-------------------------------------------------

This then successfully imports the ZFS pools after the LUKS-unlock. But I assume there's a better fix than that.

I believe LUKS-ZFS worked during my tests, the issue appeared when using GPG-LUKS-ZFS. If desired, I could test GPG-LUKS-EXT4 and LUKS-ZFS and report back?
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-03-15 21:47:53 UTC
ZFS support in genkernel has changed in the past years. Is this still a problem with >=genkernel-4.1.2?