docs/initrd.md
You can use the script found here to generate an initrd either based on alpine or suse linux.
The script extracts the init system from each distribution and creates a initrd.
Use this option for creating an initrd if you're building your own init or if you need any specific files / logic in your initrd.
mkdir initrd
cp /path/to/your/init initrd/init
# copy everything else you need in initrd/
cd initrd
find . -print0 | cpio --null --create --verbose --format=newc > initrd.cpio
When setting your boot source, add a initrd_path property like so:
curl --unix-socket /tmp/firecracker.socket -i \
-X PUT 'http://localhost/boot-source' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d "{
\"kernel_image_path\": \"/path/to/kernel\",
\"boot_args\": \"console=ttyS0 reboot=k panic=1 pci=off\",
\"initrd_path\": \"/path/to/initrd.cpio\"
}"
is_root_device: true when using an initrdCONFIG_BLK_DEV_INITRD=yrdinit=/path/to/init to your boot_args propertypivot_root in your init, it won't be possible because the
initrd is mounted as a rootfs and cannot be unmounted. You will need to use
switch_root instead.