Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7323

Advanced users • initramfs & cryptsetup on Raspberry Pi 5 (modules not loading or console not updating)

$
0
0
Hi everyone,

I’ve been trying to set up a custom initramfs on my Raspberry Pi 5 (running Raspberry Pi OS 64-bit) to use cryptsetup, but I’m facing a couple of problems:

Case 1: The modules (e.g. algif_skcipher) don’t seem to load inside the initramfs environment.

Case 2: The system appears stuck (black screen) when booting with the other initramfs, but it’s actually waiting for input. If I type exit and press Enter, it continues the normal boot.

Below are my full logs/commands, as well as two photos that show the console output (or lack thereof) for each case.
(Based on https://rr-developer.github.io/LUKS-on-Raspberry-Pi/ and https://github.com/rr-developer/LUKS-on ... /issues/11)


System Details
Hardware: Raspberry Pi 5

OS: Raspberry Pi OS (64-bit) with kernel 6.12.20+rpt-rpi-v8 and 6.12.20+rpt-rpi-2712

Steps & Logs

Code:

# 1) Update & Upgradesudo apt updatesudo apt upgrade# This triggers an update-initramfs process:Processing triggers for initramfs-tools (0.142+rpt3+deb12u1) ...update-initramfs: Generating /boot/initrd.img-6.12.20+rpt-rpi-v8'/boot/initrd.img-6.12.20+rpt-rpi-v8' -> '/boot/firmware/initramfs8'update-initramfs: Generating /boot/initrd.img-6.12.20+rpt-rpi-2712'/boot/initrd.img-6.12.20+rpt-rpi-2712' -> '/boot/firmware/initramfs_2712'# 2) Install cryptsetup packagessudo apt install cryptsetupsudo apt install cryptsetup-initramfs# Another update-initramfs runs automatically:Processing triggers for initramfs-tools (0.142+rpt3+deb12u1) ...update-initramfs: Generating /boot/initrd.img-6.12.20+rpt-rpi-v8'/boot/initrd.img-6.12.20+rpt-rpi-v8' -> '/boot/firmware/initramfs8'update-initramfs: Generating /boot/initrd.img-6.12.20+rpt-rpi-2712'/boot/initrd.img-6.12.20+rpt-rpi-2712' -> '/boot/firmware/initramfs_2712'# 3) Verify cryptsetup (just a quick check)cryptsetup benchmark -c xchacha20,aes-adiantum-plain64# Result: ~400-420 MiB/s for encryption/decryption# 4) Custom hooks (luks_hooks) to include extra toolssudo nano /etc/initramfs-tools/hooks/luks_hooks   !/bin/sh -e    PREREQS=""    ...    copy_exec /sbin/resize2fs /sbin    copy_exec /sbin/fdisk /sbin    copy_exec /sbin/cryptsetup /sbinsudo chmod +x /etc/initramfs-tools/hooks/luks_hooks# 5) Modules file: /etc/initramfs-tools/modulesalgif_skcipherxchacha20adiantumaes_armsha256nhpoly1305dm-crypt# 6) Update initramfs againsudo update-initramfs -u# It generates initramfs8 and initramfs_2712# 7) Check the contents of initramfslsinitramfs /boot/firmware/initramfs8 | grep -P "sbin/(cryptsetup|resize2fs|fdisk)"   usr/sbin/cryptsetup   usr/sbin/resize2fs   usr/sbin/fdisklsinitramfs /boot/firmware/initramfs8 | grep -P "(algif_skcipher|chacha|adiantum|aes-arm|sha256|nhpoly1305|dm-crypt)"   usr/lib/modules/6.12.20+rpt-rpi-v8/kernel/arch/arm64/crypto/chacha-neon.ko   ...   usr/lib/modules/6.12.20+rpt-rpi-v8/kernel/crypto/algif_skcipher.ko   ...   usr/lib/modules/6.12.20+rpt-rpi-v8/kernel/drivers/md/dm-crypt.ko   ...# Same checks for initramfs_2712 show the same modules included.# 8) Adjust cmdline and configsudo nano /boot/firmware/cmdline.txt   console=serial0,115200 console=tty1 root=PARTUUID=36a36232-02 rootfstype=ext4 fsck.repair=yes rootwait break=premountsudo nano /boot/firmware/config.txt   auto_initramfs=0   initramfs initramfs8 followkernel# (Case 1: Photo 1) - Modules not loading?# Then, switching to:sudo nano /boot/firmware/config.txt   auto_initramfs=0   initramfs initramfs_2712 followkernel# (Case 2: Photo 2) - Screen not updating until 'exit'
Photo 1: Shows that in the initramfs shell, modprobe algif_skcipher doesn’t provide any clear output/error, but also doesn’t seem to load.
20250402_154009.jpg
Photo 2 : The screen appears “hung,” but if I type exit (blindly) and press Enter, the boot continues normally.
20250402_154226.jpg

Suspected a mismatch between kernel versions, but I see the modules are built for 6.12.20+rpt-rpi-v8 or 6.12.20+rpt-rpi-2712, which matches the Pi.


I’d greatly appreciate any advice, tips, or config suggestions you might have! Let me know if more logs or details would help.

Thank You!

Statistics: Posted by tdakos — Wed Apr 02, 2025 1:33 pm — Replies 1 — Views 34



Viewing all articles
Browse latest Browse all 7323

Trending Articles