1

I have been working on building a linux kernel for qemu. I have been following the tutorial http://xecdesign.com/compiling-a-kernel/ As of now i have been able to boot the kernel until start of init process. But i have been getting the following error: "Kernel panic - not syncing: Attempted to kill init!" I tried debugging and found that executing /sbin/init in the function kernel_init() is resulting in the kernel panic.

...
Freeing init memory: 120K
Kernel panic - not syncing: Attempted to kill init!
Backtrace: 
[<c0017348>] (dump_backtrace+0x0/0x10c) from [<c02fb118>] (dump_stack+0x18/0x1c)
 r6:cf815d60 r5:c03f179c r4:c0409738
[<c02fb100>] (dump_stack+0x0/0x1c) from [<c02fb25c>] (panic+0x64/0x188)
[<c02fb1f8>] (panic+0x0/0x188) from [<c0029d24>] (do_exit+0x564/0x61c)
 r3:cf815d60 r2:cf81be54 r1:cf81be54 r0:c0376584
 r7:cf81a000
[<c00297c0>] (do_exit+0x0/0x61c) from [<c002a03c>] (do_group_exit+0x44/0xa4)
 r7:cf81a000
[<c0029ff8>] (do_group_exit+0x0/0xa4) from [<c0033e34>] (get_signal_to_deliver+0x13c/0x478)
 r4:cf81a000
[<c0033cf8>] (get_signal_to_deliver+0x0/0x478) from [<c0016620>] (do_signal+0x6c/0x530)
[<c00165b4>] (do_signal+0x0/0x530) from [<c0017070>] (do_notify_resume+0x50/0x5c)
[<c0017020>] (do_notify_resume+0x0/0x5c) from [<c0014438>] (work_pending+0x24/0x28)
 r4:ffffffff
Rebooting in 1 seconds..

I am using a custom root file system generated using buildroot. The same rootfs works fine with the "kernel-qemu" originally downloaded from https://xecdesign.com/downloads/linux-qemu/kernel-qemu

Can somebody help me with getting this right? Let me know if further info is required.

migrated from raspberrypi.stackexchange.com Sep 30 '15 at 17:34

This question came from our site for users and developers of hardware and software for Raspberry Pi.

  • Did you compile your kernel with SELinux support? (You can check that on the menuconfig.) If so, you can try to turn it off by appending selinux=0 on the kernel command line. – herbert Sep 30 '15 at 18:19
  • @herbert I checked in menuconfig and selinux is not enabled. But I can see "Unix Discretionary Access Controls" enabled under default security module menu. I am not aware about its function as of now and I am researching. – pradeepmcp Oct 1 '15 at 4:43
  • Check the answer suggesting the use of kpartx in this question: stackoverflow.com/questions/18776387/… . After using kpartx and loopback-mounting the image to comment out the line in ld.so.preload, I managed to boot normally (with the default init). – avl_sweden Oct 17 '15 at 20:43
0

I found the fix with the help of this thread. I had to enable CONFIG_AEABI in my kernel.

0

Mount the file system and type these commands (assuming you mounted in a directory called fs):

cd fs/etc
mv ld.so.preload ld.so
cd ../..
umount fs

Then start

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.