Kernel panic - not syncing => Error because of missing libc.so.6

Hi there,

first of all, this is a great Page for getting started with the altera socs.

I am currently trying to follow the Embedded Linux Beginners Guide
but i am Stuck with an Error thrown at boot up.


[ 2.257059] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.265157] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 2.274356] devtmpfs: mounted
[ 2.277624] Freeing unused kernel memory: 436K (c0753000 - c07c0000)
/sbin/init: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
[ 2.463787] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 2.463787]
[ 2.472888] CPU: 0 PID: 1 Comm: init Not tainted 4.1.0 #5
[ 2.478261] Hardware name: Altera SOCFPGA
[ 2.482283] [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[ 2.490000] [] (show_stack) from [] (dump_stack+0x90/0xa0)
[ 2.497194] [] (dump_stack) from [] (panic+0xb0/0x210)
[ 2.504045] [] (panic) from [] (complete_and_exit+0x0/0x2c)
[ 2.511324] [] (complete_and_exit) from [] (do_group_exit+0x5c/0xe8)
[ 2.519382] [] (do_group_exit) from [] (__wake_up_parent+0x0/0x30)
[ 2.527266] [] (__wake_up_parent) from [] (ret_fast_syscall+0x0/0x3c)
[ 2.535407] CPU1: stopping
[ 2.538108] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.0 #5
[ 2.543914] Hardware name: Altera SOCFPGA
[ 2.547917] [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[ 2.555631] [] (show_stack) from [] (dump_stack+0x90/0xa0)
[ 2.562823] [] (dump_stack) from [] (handle_IPI+0x21c/0x238)
[ 2.570189] [] (handle_IPI) from [] (gic_handle_irq+0x68/0x6c)
[ 2.577728] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x54)
[ 2.585175] Exception stack(0xeed0bf60 to 0xeed0bfa8)
[ 2.590206] bf60: 00000000 00000000 00000b14 c00218c0 eed0a000 c07c249c 10c0387d c0822ac0
[ 2.598347] bf80: c07c2450 c07ba304 c0569a18 eed0bfb4 eed0bfb8 eed0bfa8 c001068c c0010690
[ 2.606485] bfa0: 600f0013 ffffffff
[ 2.609963] [] (__irq_svc) from [] (arch_cpu_idle+0x48/0x4c)
[ 2.617336] [] (arch_cpu_idle) from [] (cpu_startup_entry+0x16c/0x268)
[ 2.625567] [] (cpu_startup_entry) from [] (secondary_start_kernel+0x124/0x12c)
[ 2.634575] [] (secondary_start_kernel) from [<0000954c>] (0x954c)
[ 2.641598] —[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 2.641598]

As described in the Guide, I am using buildroot to build my rootfs untar it to the correctly formatted sdcard ext4 partition (also tried with ext2 in case of missing drivers)

I’ve tried different branches of buildroot, lastly 2015.11.1.

Sometimes, when i try to save the config buildroot just states a red box with at the top left corner and the config freezes. Exiting with strg+c brings up this output:

make[1]: *** [nconfig] Error 1
make:*** [_all] Interrupt

It seems to work fine, saves the config and loads it on the next start. Sometimes the error disappers and it exits just fine but this did no difference to my actual problem.

The linaro toolchain used (4.9-2014.09) is no longer a preset in buildroot so I have to set it manually (i think this could be part of my problem)(ive tried enabling c++ support but no difference)

I dont really know what to do next, the next thing I can think of is trying yocto but this would mean to do it all over again.

thy for any help

what seemed to work for me –
the dir /lib/arm-linux-gnueabihf/
and the links in that dir
libcrypt.so.1 -> …/libcrypt.so.1
libc.so.6 -> …/libc.so.6
(and more )
are not created during the build // creating them post build works as expected

Hi,
thanks for your reply.
I can’t find a folder named lib/arm-linux-gnueabihf/ in my toolchain.

I have the root folder of my toolchain “gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux”

and inside a “/lib/gcc/arm-linux-gnueabihf/4.9.2” -> no libcrypt.so.1 or other files/links

and “arm-linux-gnueabihf/lib/” wich has some libs but also not libc or libcrypt.

But I have managed to get it up and running by switching to the master branch of buildroot and linaro-5.2-2015.11-2

sorry for not being clearer
on your TARGET create the directory & links

it should be a step within the Filesystem creation process that is skippped

0)mount your target / (root) on your host & make the following modifications i.e. mount /dev/sd{**} /mnt/temproot

  1. mkdir /mnt/temproot/lib/arm-linux-gnueabihf/
  2. cd /mnt/temproot/lib/arm-linux-gnueabihf/
  3. ln -s …/libcrypt.so.1
  4. ln -s …/libc.so.6
  5. cd -
  6. sync
    end) umount /mnt/temproot