Sabayon / genkernel-next

An improved and modern remake of Gentoo genkernel (in: udev, plymouth; out: cross compiler support)
47 stars 45 forks source link

Error message with multiple crypt root devices: Could not find the lv_root_2 in /dev/Volume00/lv_root_2 #44

Open sebasmannem opened 7 years ago

sebasmannem commented 7 years ago

When used with multiple encrypted root disks booting results in error message:

Could not find the lv_root_2 in /dev/Volume00/lv_root_2.

Dropping to shell and entering:

cryptsetup luksOpen -d /mnt/key/key /dev/Volume00/lv_root_2 lv_root_2

Does open the disk correctly and after that booting finishes correctly. I added some good_msg lines for debugging and found that, for every root device a new -d option would be added to cryptsetup_opts, resulting in a cryptsetup Luksopen command like:

cryptsetup luksOpen -d /mnt/key/key -d /mnt/key/key /dev/Volume00/lv_root_2 lv_root_2

And that fails, since cryptsetup only supports one -d option. The patch below changes _open_luks() in defaults/initrd.d/00-crypt.sh, by clearing cryptsetup_opts for each device which fixes this issue. genkernel-next.txt