init: cannot load libc.so.0, kernel panic:trying to kill init

Mahanteshwari Hiremath Mahanteshwari.Hiremath at lnties.com
Mon Oct 24 04:45:20 UTC 2011


Hi Rob,
            the generated binaries are successfully running on my linux desktop machine, as Mr.Wang Jiong said to use '-static' accordingly every uclibc commands are working and I am able to complile my programs also.

BUT THE PROBLEM HERE IS , ROOTFS generated by build root(rootfs.ext2).
hey I am doing Linux Board bringing up project where in I am using the ROOTFS generated by buildroot, and while bootng it gives error msg saying,

>/sbin/init:can't load libc.so.0
>kernel panic: trying to kill init

I see all necessary library file present in RFS /lib of buildroot

and below is what /lib contents(buildroot RFS),

drwxr-xr-x 28 root root   4096 2011-10-19 16:48 firmware
-rwxr-xr-x  1 root root  25192 2011-10-21 15:08 ld-uClibc-0.9.32.so
lrwxrwxrwx  1 root root     19 2011-10-21 15:08 ld-uClibc.so.0 -> ld-uClibc-0.9.32.so
-rwxr-xr-x  1 root root   8796 2011-10-21 15:08 libcrypt-0.9.32.so
lrwxrwxrwx  1 root root     18 2011-10-21 15:08 libcrypt.so.0 -> libcrypt-0.9.32.so
lrwxrwxrwx  1 root root     19 2011-10-21 15:08 libc.so.0 -> libuClibc-0.9.32.so
-rwxr-xr-x  1 root root   8944 2011-10-21 15:08 libdl-0.9.32.so
lrwxrwxrwx  1 root root     15 2011-10-21 15:08 libdl.so.0 -> libdl-0.9.32.so
-rwxr-xr-x  1 root root  41664 2011-10-21 15:08 libm-0.9.32.so
lrwxrwxrwx  1 root root     14 2011-10-21 15:08 libm.so.0 -> libm-0.9.32.so
-rwxr-xr-x  1 root root   4592 2011-10-21 15:08 libnsl-0.9.32.so
lrwxrwxrwx  1 root root     16 2011-10-21 15:08 libnsl.so.0 -> libnsl-0.9.32.so
-rwxr-xr-x  1 root root  62940 2011-10-21 15:08 libpthread-0.9.32.so
lrwxrwxrwx  1 root root     20 2011-10-21 15:08 libpthread.so.0 -> libpthread-0.9.32.so
-rwxr-xr-x  1 root root   4592 2011-10-21 15:08 libresolv-0.9.32.so
lrwxrwxrwx  1 root root     19 2011-10-21 15:08 libresolv.so.0 -> libresolv-0.9.32.so
-rwxr-xr-x  1 root root  13096 2011-10-21 15:08 librt-0.9.32.so
lrwxrwxrwx  1 root root     15 2011-10-21 15:08 librt.so.0 -> librt-0.9.32.so
-rwxr-xr-x  1 root root 314384 2011-10-21 15:08 libuClibc-0.9.32.so
-rwxr-xr-x  1 root root   4656 2011-10-21 15:08 libutil-0.9.32.so
lrwxrwxrwx  1 root root     17 2011-10-21 15:08 libutil.so.0 -> libutil-0.9.32.so
drwxr-xr-x  3 root root   4096 2011-10-19 16:46 modules

and in /usr/lib I ahve put all linker libraries,


-rw-r--r-- 1 root root     804 2011-10-21 15:08 crt1.o
-rw-r--r-- 1 root root    2024 2011-10-21 15:08 crti.o
-rw-r--r-- 1 root root    1828 2011-10-21 15:08 crtn.o
-rw-r--r-- 1 root root 1278948 2011-10-21 15:08 libc.a
lrwxrwxrwx 1 root root       6 2011-10-21 15:08 libc_pic.a -> libc.a
-rw-r--r-- 1 root root   14286 2011-10-21 15:08 libcrypt.a
lrwxrwxrwx 1 root root      10 2011-10-21 15:08 libcrypt_pic.a -> libcrypt.a
lrwxrwxrwx 1 root root      23 2011-10-21 15:08 libcrypt.so -> ../../lib/libcrypt.so.0
-rw-r--r-- 1 root root     276 2011-10-21 15:08 libc.so
-rw-r--r-- 1 root root   22454 2011-10-21 15:08 libdl.a
lrwxrwxrwx 1 root root       7 2011-10-21 15:08 libdl_pic.a -> libdl.a
lrwxrwxrwx 1 root root      20 2011-10-21 15:08 libdl.so -> ../../lib/libdl.so.0
-rw-r--r-- 1 root root  205280 2011-10-21 15:08 libm.a
lrwxrwxrwx 1 root root       6 2011-10-21 15:08 libm_pic.a -> libm.a
lrwxrwxrwx 1 root root      19 2011-10-21 15:08 libm.so -> ../../lib/libm.so.0
-rw-r--r-- 1 root root     908 2011-10-21 15:08 libnsl.a
lrwxrwxrwx 1 root root       8 2011-10-21 15:08 libnsl_pic.a -> libnsl.a
lrwxrwxrwx 1 root root      21 2011-10-21 15:08 libnsl.so -> ../../lib/libnsl.so.0
-rw-r--r-- 1 root root  224086 2011-10-21 15:08 libpthread.a
-rw-r--r-- 1 root root    1164 2011-10-21 15:08 libpthread_nonshared.a
lrwxrwxrwx 1 root root      22 2011-10-21 15:08 libpthread_nonshared_pic.a -> libpthread_nonshared.a
lrwxrwxrwx 1 root root      12 2011-10-21 15:08 libpthread_pic.a -> libpthread.a
-rw-r--r-- 1 root root     189 2011-10-21 15:08 libpthread.so
-rw-r--r-- 1 root root     914 2011-10-21 15:08 libresolv.a
lrwxrwxrwx 1 root root      11 2011-10-21 15:08 libresolv_pic.a -> libresolv.a
lrwxrwxrwx 1 root root      24 2011-10-21 15:08 libresolv.so -> ../../lib/libresolv.so.0
-rw-r--r-- 1 root root   28020 2011-10-21 15:08 librt.a
lrwxrwxrwx 1 root root       7 2011-10-21 15:08 librt_pic.a -> librt.a
lrwxrwxrwx 1 root root      20 2011-10-21 15:08 librt.so -> ../../lib/librt.so.0
-rw-r--r-- 1 root root    7476 2011-10-21 15:08 libutil.a
lrwxrwxrwx 1 root root       9 2011-10-21 15:08 libutil_pic.a -> libutil.a
lrwxrwxrwx 1 root root      22 2011-10-21 15:08 libutil.so -> ../../lib/libutil.so.0
-rw-r--r-- 1 root root     868 2011-10-21 15:08 Scrt1.o
-rw-r--r-- 1 root root     988 2011-10-21 15:08 uclibc_nonshared.a

I feel, now you understood my problem.
Kindly give some ideas, so I can bring up my Kernel.




Regards,
Mahanteshwari Hiremath.

________________________________________
From: Rob Landley [rob at landley.net]
Sent: Friday, October 21, 2011 10:51 PM
To: Mahanteshwari Hiremath
Cc: WANG.Jiong; uclibc at uclibc.org
Subject: Re: init: cannot load libc.so.0, kernel panic:trying to kill init

On 10/21/2011 05:02 AM, Mahanteshwari Hiremath wrote:
> Hi WANG.Jiong,
>
> Thanks for your reply.
> It really helped me to run standalone application on my linux machine.
> Problem what I am facing is with the x86 board, which is failing to boot.
> I have used rootfs generated from buildroot along with toolchains which gives the following error during boot :
>
>  >/sbin/init:can't load libc.so.0
>  >kernel panic: trying to kill init
>
> Please help me out in solving the issue. Im not even able to do anything as it is showing kernel panic.

Run uClibc's ldd against your binary.  (Note that glibc's won't work
against uClibc, but uClibc's will work against glibc.  Which is better
is left as an exercise for the reader.)

If you haven't got uClibc's ldd, run readelf -a against it and grep for
the word "interpreter".

Rob


Larsen & Toubro Limited

www.larsentoubro.com

This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.


More information about the uClibc mailing list