Creating and using an initrd for Firecracker
Creating
Based on alpine or suse
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.
Custom
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.
Usage
When setting your boot source, add a initrd_path property like so:
Notes
You should not use a drive with
is_root_device: truewhen using an initrdMake sure your kernel configuration has
CONFIG_BLK_DEV_INITRD=yIf you don't want to place your init at the root of your initrd, you can add
rdinit=/path/to/initto yourboot_argspropertyIf you intend to
pivot_rootin your init, it won't be possible because the initrd is mounted as a rootfs and cannot be unmounted. You will need to useswitch_rootinstead.