2

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.

enter image description here

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.

13
  • You might struggle to get an answer here. Besides the information you provided is very limited and the errors are to generic. You need to go knee deep in debug or go ask in a Linux SE?
    – Piotr Kula
    Nov 6, 2012 at 12:28
  • @ppumkin do you need any further information? I am tired to get a solution Nov 6, 2012 at 15:07
  • No sorry- I have no idea about compiling kernels. It was always regarded as the most complicated thing to do with Linux.(for a beginner and even intermediate user)
    – Piotr Kula
    Nov 6, 2012 at 16:45
  • My guess is that devtmpfs: error mounting -2 is a possible indication of your problem, as I get devtmpfs: initialized when RaspBMC boots on my Pi. Can Linux run without a tmp fs? Could be just noise though ... Nov 7, 2012 at 15:35
  • Thank you for your information. Possibly the error occurring either for initramfs directory structure, mainly for the devices or kernel configuration with devtmpfs support. Let me check with all possibilities. I will surely answer it if I would find a way. Nov 8, 2012 at 6:51

0

Browse other questions tagged or ask your own question.