Skip to content

Instantly share code, notes, and snippets.

@wenerme
Last active October 22, 2020 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenerme/2a4b25df88ec206e7b53a8aa35ccaa89 to your computer and use it in GitHub Desktop.
Save wenerme/2a4b25df88ec206e7b53a8aa35ccaa89 to your computer and use it in GitHub Desktop.
AlpineLinux netboot initrd missing ext4 module
# download firecracker
latest=$(basename $(curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/firecracker-microvm/firecracker/releases/latest))
curl -LOJ https://github.com/firecracker-microvm/firecracker/releases/download/${latest}/firecracker-${latest}-$(uname -m)
mv firecracker-${latest}-$(uname -m) firecracker
chmod +x firecracker
# download netbook kernel and initrd
curl --remote-name-all -LC- https://mirrors.aliyun.com/alpine/v3.12/releases/x86_64/netboot/{modloop,vmlinuz,config,initramfs}-virt
# vmlinux
curl -LOC- https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux
chmod +x extract-vmlinux
./extract-vmlinux $PWD/vmlinuz-virt > vmlinux-virt
# rootfs - invalid rootfs to check the initrd modules
fallocate -l 1G alpine.rootfs.ext4
# conf
cat <<CONF > alpine.json
{
"boot-source": {
"initrd_path":"initramfs-virt",
"kernel_image_path": "vmlinux-virt",
"boot_args": "console=ttyS0 reboot=k panic=1 pci=off modules=virtio_mmio,ext4 rootfstype=ext4"
},
"drives": [
{
"drive_id": "rootfs",
"path_on_host": "ubuntu.rootfs.ext4",
"is_root_device": true,
"is_read_only": false
}
],
"machine-config": {
"vcpu_count": 1,
"mem_size_mib": 1024,
"ht_enabled": false
}
}
CONF
# start
rm /tmp/firecracker.socket;./firecracker --api-sock /tmp/firecracker.socket --config-file alpine.json
# missing ext4
cat /proc/filesystems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment