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

Advanced users • One initramfs to rule them all (and in the darkness bind them)

$
0
0
For context, I'm working on an update to Network Boot A Pi Zero Via the USB Ethernet Gadget

What I'm wondering is whether it is possible to have a single initramfs which contains the required modules for all currently installed kernels. And if so, how.

On Bookworm an initramfs for each provided kernel already exists so sudo initramfs-tools -u -k all works as you would expect. That still gives mutlitple files but the current bootstrap seems able to cope with that and find the correct one.

The problem child is RPiOS Legacy (Bullseye) and earlier.

Those don't have any provided initramfs so, for obvious reasons, sudo initramfs-tools -u -k all does nothing. Neither does sudo initramfs-tools -c -k all. Building the initrafs for the current kernel works as you'd expect (sudo initramfs-tools -c -k `unmame -r`) but unless you know the correct incantation for the other three* kernels building their intramfs is a tedious process that requires bootting on three additional Pi with the correct SoC. At least for the first time you do it on any given OS install.

It also makes things difficult/impossible to do the update on a cerntral, server side basis.

So, given that an initramfs is mostly a cpio archive, surely there's a way to stuff all the required modules into a single one without getting into kernel (cross) compilation.

Or failing that an easy, scriptable way to get the magic string from the installed but not running kernels and pass that to initramfs-tools?

Thoughts?

I wouldn't ask but my web searching fu is failing me.

*: Or more if you have custom kernels installed

Statistics: Posted by thagrol — Tue Sep 03, 2024 9:33 pm — Replies 1 — Views 39



Viewing all articles
Browse latest Browse all 3456

Trending Articles