Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922443 - sys-kernel/raspberrypi-image-6.1.21_p20230405 genkernel creates broken initramfs images
Summary: sys-kernel/raspberrypi-image-6.1.21_p20230405 genkernel creates broken initra...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-18 19:19 UTC by Jason Cooper
Modified: 2024-04-20 03:24 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 Jason Cooper 2024-01-18 19:19:16 UTC
while attempting to build an encrypted SD Card image for my rpi4B, I encountered some problems with the default kernel (raspberry pi-image)

1) It doesn't seem to include a kernel config anywhere I could find.  This prevents genkernel from detecting the correct KEXT (.ko.xz, not .ko), resulting in no modules being found or included in the initramfs.

2) EXTRAVERSION is not equal to the directory name under which to find the kernel modules, in my case with rpi4B, /lib/modules/6.1.21-v8+.

In order to getting a working initramfs that could successfully ask me for the password and decrypt the partition (LVM2 inside), I needed to do the following:

1) Install sys-kernel/raspberrypi-sources
2) HACK: Force genkernel to use KEXT='.ko.xz' (no kernel config found)
3) HACK: cd /usr/src; ln -s linux-6.1.21_p20230405-raspberrypi linux-6.1.21-v8+
4) HACK: Set EXTRAVERSION="-v8+" in /usr/src/linux-6.1.21-v8+/Makefile

#3 and #4 fix the modules included in the initramfs not being found due to being in the wrong directory.  '/lib/modules/6.1.21_p20230405-raspberrypi' vice '/lib/modules/6.1.21-v8+' which is what the prebuilt kernel is configured as.

After this, I have a booting system :)

I'm not really sure how to fix this easily.  I suspect there needs to be different ebuilds for the different raspberrypi-image archs, then the corresponding sources could more easily have the correct info.