Subject: Custom kernel 5.6.2 with luks: unable to mount root

From: David Demelier <[email-masked]>
Date: Fri, 3 Apr 2020 11:19:19 +0200

Hey there,

I'm having few issues with the LTS kernel regarding the iwlwifi driver 
so I wanted to try the latest kernel version by hand.

I had an old kernel configuration that I upgraded to 5.6.2 using `make 
olddefconfig` and checked that every required drivers were still enabled.

I have the following kernel command line:

cryptdm=cryptroot cryptroot=/dev/nvme0n1p2 root=/dev/mapper/cryptroot 
rootfstype=ext4 ro

I also added "cryptsetup" in the features in mkinitfs.conf

But then, with the proper initramfs rebuilt with `mkinitfs 5.6.2` the 
kernel boots and immediately panic with the following error:

VFS: Cannot open root device "mapper/cryptroot" or unknown-block(0,0): 
error -6
Please append a correct "root=" boot option:

Then, a list of devices are listed (including /dev/nvme*)

What I don't understand is why the kernel does not understand that it is 
an encrypted volume and that is has to wait until initramfs ask a 
passphrase for it (the kernel never asks the passphrase, isn't it?).

Here's my kernel config FWIW: https://pastebin.com/mXisHP78

To my understanding, the linux-lts package does not come with any patch, 
so a vanilla kernel should work too. I don't know what could be wrong 
here in my case.

Any help is welcome.

-- 
David

---

From: Daniel Kulesz <[email-masked]>
Date: Fri, 3 Apr 2020 21:46:06 +0200

Hi David,

there could be various reasons thus, personally, I would suggest trying to rebuild the lts kernel with the official config first. Maybe start with the current kernel version (5.4.30), build this first and check if it boots. If it does, switch to your newer 5.6.x kernel and check there.

I would also suggest to use the official config that can be found here:

https://git.alpinelinux.org/aports/plain/main/linux-lts/config-lts.x86_64

 (if I'm not mistaken by the config you shared you are on x86_64)

Good luck!

Cheers, Daniel

On Fri, 3 Apr 2020 11:19:19 +0200