hello I have compiled my custom kernel and pack initramfs into it. I have created two partition fat32 and ext3. fat32 contains bootloaders and kernel and ext3 contains rootfs. I have made a raw disk image on that. But when I try this on qemu it's show init script not found.
Here is the screenshot.
here is my init script
!/bin/busybox sh
rescue_shell() {
echo "Something went wrong. Dropping you to a shell."
busybox --install -s
exec /bin/sh
}
mount -t proc none /proc
mount -t sysfs none /sys
echo "This script mounts rootfs and boots it up, nothing more!"
mount -o ro /dev/sda2 /mnt/root || rescue_shell
umount /proc
umount /sys
exec switch_root /mnt/root /sbin/init
I have put the init script on initramfs with
chmod +x init
I am using qemu with the follwing parameter
qemu-system-arm.exe -M versatilepb -cpu arm1176 -hda my_custom_image.img -kernel kernel-qemu -m 256 -append "root=/dev/sda2"
Here is my initramfs structure
.: directory
./etc: directory
./mnt: directory
./mnt/root: directory
./dev: directory
./dev/sda2: block special
./dev/null: character special
./dev/console: character special
./dev/tty: character special
./dev/sda1: block special
./lib: directory
./bin: directory
./bin/busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.16, stripped
./root: directory
./sbin: directory
./sys: directory
./proc: directory
And my rootfs contains also the same structure. Is there anything wrong what I have done so far?.
And Another thing when my same structure is in physical raspberry the init script got error and entering in rescue mode with the following error.
kernel panic not syncing attempted kill init
Can any one show me a proper guidance. I can't find a way out.
If additional details require I will surely provide. Thank You.
devtmpfs: error mounting -2
is a possible indication of your problem, as I getdevtmpfs: initialized
when RaspBMC boots on my Pi. Can Linux run without a tmp fs? Could be just noise though ...