cosmicboy
Posts: 17
Joined: Mon Sep 03, 2012 9:25 am

RPI3 with initramfs built into kernel

Fri Apr 27, 2018 3:26 pm

Has anyone ever managed to compile the initramfs into the kernel and get this running on a raspberry pi?
I have been trying for days, but can't get it to work. It seems to only work with an external initramfs file.
Is this correct, or is there a way to set kernel configs and bootargs to get it up and running?

If so, it would be great if you could share a brief description.

HiassofT
Posts: 191
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: RPI3 with initramfs built into kernel

Sat Apr 28, 2018 5:31 pm

Yes, it works, we're using it in LibreELEC. Basically you just have to point CONFIG_INITRAMFS_SOURCE to a cpio file of your initramfs and set root=/dev/ram0 on the command line.

Here's the link to the RPi2/3 kernel config we are using (INITRAMFS_SOURCE is filled in by the build scripts): https://github.com/LibreELEC/LibreELEC. ... x.arm.conf

And here's the link to the build script which creates the cpio of the initramfs https://github.com/LibreELEC/LibreELEC. ... package.mk

so long,

Hias

cosmicboy
Posts: 17
Joined: Mon Sep 03, 2012 9:25 am

Re: RPI3 with initramfs built into kernel

Tue May 01, 2018 5:54 am

Thanks, this works, however I meant using initramfs build into the kernel without an external image using the kernel config parameter INITRAMFS_SOURCE="xyz"

cosmicboy
Posts: 17
Joined: Mon Sep 03, 2012 9:25 am

Re: RPI3 with initramfs built into kernel

Tue May 01, 2018 5:56 am

... to make things more complicated I would like to use a fitImage with u-boot containing the kernel with built-in initramfs.
Does anybody have experiences with that ;-)

HiassofT
Posts: 191
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: RPI3 with initramfs built into kernel

Tue May 01, 2018 11:44 am

cosmicboy wrote:
Tue May 01, 2018 5:54 am
Thanks, this works, however I meant using initramfs build into the kernel without an external image using the kernel config parameter INITRAMFS_SOURCE="xyz"
I don't quite understand what you are trying to achieve. If you want an initramfs compiled into the kernel image you have to use INITRAMFS_SOURCE and point it to a cpio of the initramfs you want to have built in or to a list of directories/files with the contents of your initramfs.

so long,

Hias

Return to “Advanced users”