TLDR: I'm trying to create an EBS-backed AMI instance and then pivot to it using Busybox but I get a kernel panic:
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 156k freed
Kernel panic - not syncing: No init found. Try passing init= option to kernel.
The repository for the code is here: https://github.com/atramos/ec2-spotter
How it works is:
- Create a static busybox image using the script make-busybox.sh.
- Create the basic filesystem - /boot, /etc, /sbin, and so on.
- Create a pivot script to replace /sbin/init
- Bundle the busybox image to an AMI and upload the AMI to an S3 bucket
- Create an EBS volume
- Clone my current OS to the EBS volume
- Fix up device paths
- Create a new EC2 instance with the busybox AMI
- Attach the EBS volume
- Boot the new EC2 instance and pivot to the EBS volume
Everything goes swimmingly until #9, the instance boots, but then the kernel panics as shown above.
I've tried different paths for the init script. I've tried building a static "Hello World" C program to use as init. The same error occurs.
Thanks for your help!