darkpenguin
Posts: 4
Joined: Fri May 24, 2019 6:04 pm

Where is "rpi-initramfs-tools"?

Fri May 24, 2019 7:49 pm

As far as I understand, due to the specifics of the Raspberry Pi, we must copy initramfs.img-<kernel_version> to initramfs.img (or change config.txt after every time it changes its name). Is that still true?

In /etc/default/raspberrypi-kernel , we seem to have a fix for this:

Code: Select all

# Uncomment the following line to enable generation of
# /boot/initrd.img-KVER files (requires initramfs-tools)
INITRD=Yes

# Uncomment the following line to enable generation of
# /boot/initrd(7).img files (requires rpi-initramfs-tools)
RPI_INITRD=Yes
So, where or what is "rpi-initramfs-tools"? Not the repo, not even google seems to know.

Maybe there is another, more obvious way? Maybe it could be possible to tweak initramfs-tools to specify its output file, or add a command to copy the file after it's generated?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5673
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Where is "rpi-initramfs-tools"?

Fri May 24, 2019 7:57 pm

It doesn't exist yet. That change was just a way to clear the way for a hypothetical rpi-initramfs-tools if I had time to work on it, but also a place people could drop their own hooks.

darkpenguin
Posts: 4
Joined: Fri May 24, 2019 6:04 pm

Re: Where is "rpi-initramfs-tools"?

Sun May 26, 2019 12:50 pm

I solved this problem by adding a hook to initramfs that replaces any mention of "initramfs ..." in config.txt with "initramfs initrd.img-`uname -r`":

Code: Select all

sed -i "s|^initramfs .*|initramfs initrd.img-`uname -r`|" /boot/config.txt
Maybe the solution could be to simply add something like this to raspberrypi-sys-mods, or to that "rpi-initramfs-tools"?..

I think a better solution would be to specify the output file for update-initramfs, but apparently there is no way to specify a "default" filename without hacking mkinitramfs...

I could probably work on this. Is there a discussion anywhere about the preferable way to do this?

Return to “Beginners”