View previous topic :: View next topic |
Author |
Message |
Rarog n00b
Joined: 24 Jan 2022 Posts: 3
|
Posted: Wed Jan 26, 2022 12:30 am Post subject: [SOLVED]Cryptdevice support in genkernel initramfs |
|
|
Hi,
I'm in the process of (so far) relatively successful migration from Slackware on my main workstation.
I've managed to compile working kernel and generally I am able to boot. But some of my partitions are luks2 encrypted (among others /root, /home). And I can't get them working in the way as they used to.
1. Is there a simple/elegant way to name root decrypted device-mapper device?
I've generated Initramfs using this command:
Code: | genkernel --install --luks --mdadm --kernel-config=/usr/src/linux/.config initramfs |
In /etc/default/grub I have:
Code: | GRUB_CMDLINE_LINUX="crypt_root=UUID={valid UUID] root=/dev/mapper/crypt0" |
And after entering correct passphrase boot hangs, because initramfs expects decrypted device to be named "root".
*Of course I can continue manualy.
[/code]
When I change root parameter to
Code: | root=/dev/mapper/root |
Boot working correctly, after passphrase, boot process continues. But if I omit "root=" parameter process working same way and boots correctly
What is the point of this parameter if it's selects default and only one value?
Can I change that somehow?
I've tried to specify crypt_root in Arch's way(for cryptdevice parameter):
Code: | crypt_root=UUID={valid UUID]:crypt0 |
or
Code: | crypt_root=UUID={valid UUID]=crypt0 |
As I found that notation somewhere. But both not working for "crypt_root" parameter.
I've also tried using "crypt_root_options" parameter, but with no success.
Is there genkernel way to achieve this or I'm forced to use dracut or custom initramfs?
2. In Slackware basically all necessary luks configuration was in /etc/crypttab. I've created it in my Gentoo installation, but is it even used in Gentoo with OpenRC?
Or only /etc/conf.d/dmcrypt is used in device encryption mapping?
Thanks in advance
Last edited by Rarog on Fri Jan 28, 2022 9:35 am; edited 1 time in total |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1660
|
Posted: Wed Jan 26, 2022 12:45 am Post subject: Re: Cryptdevice support in genkernel initramfs |
|
|
Rarog wrote: | Hi,
I'm in the process of (so far) relatively successful migration from Slackware on my main workstation.
I've managed to compile working kernel and generally I am able to boot. But some of my partitions are luks2 encrypted (among others /root, /home). And I can't get them working in the way as they used to.
1. Is there a simple/elegant way to name root decrypted device-mapper device?
Is there genkernel way to achieve this or I'm forced to use dracut or custom initramfs? |
Not without editing the files that genkernel installs.. it always opens as root. Rarog wrote: |
2. In Slackware basically all necessary luks configuration was in /etc/crypttab. I've created it in my Gentoo installation, but is it even used in Gentoo with OpenRC?
Or only /etc/conf.d/dmcrypt is used in device encryption mapping?
Thanks in advance |
No, crypttab is a systemd or dracut thing. Not used in Gentoo for anything besides those.
Edit: But on this note, it is usually not a big deal since grub will use root=UUID= automatically so it is not necessary to add to /etc/default/grub. Not very much cares about the naming of the device. Using UUID= in fstab will also bypass most device mapper naming issues. |
|
Back to top |
|
|
Rarog n00b
Joined: 24 Jan 2022 Posts: 3
|
Posted: Fri Jan 28, 2022 12:11 am Post subject: Re: Cryptdevice support in genkernel initramfs |
|
|
Thank You @grknight
I've managed to make it working the way I want with dracut.
I think I will stay with it, at least for some time, as I liked it's flexibility.
grknight wrote: | No, crypttab is a systemd or dracut thing. Not used in Gentoo for anything besides those.
|
Yeah I've noticed now. It's interesting as it was also used in Slackware which generally is systemd free
grknight wrote: | Edit: But on this note, it is usually not a big deal since grub will use root=UUID= automatically so it is not necessary to add to /etc/default/grub. Not very much cares about the naming of the device. Using UUID= in fstab will also bypass most device mapper naming issues. |
Yes, but I have quite few of device-mapper devices and I like to keep their naming consistent. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|