LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   chroot and shared libs not being found. (https://www.linuxquestions.org/questions/linux-general-1/chroot-and-shared-libs-not-being-found-251115/)

netstv 11-04-2004 01:15 PM

chroot and shared libs not being found.
 
Hi Everyone.

So I'm an embedded linux developer. I'm starting out with a new 2.6 based kernel. I'm able to use the GNU cLib and I create a ramdisk. I also use busybox and tinylogin.

So usually at first what I do is create a ramdisk_source directory which contains basically my linux root directory, you know.. /etc /bin /sbin ...

I don't have any inittab or anything like that yet.

I run and I get the error...
Quote:

/usr/sbin/chroot ./ramdisk_src /bin/sh
/bin/sh: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
libm.so.6 is in my /lib directory.

My Question

Where or when in the bootup process do I need to set my LIB path? Or do I need to? Do I need an inittab? If so, what is the LIB path variable I need to set?

Thanks.

I'm still a :newbie: and I think I will be FOREVER!

greg.hellings 11-04-2004 03:58 PM

Is the library in the /lib of the ramdisk? Such is essential for chrooting. I would assume you have done so, but it must be there.

netstv 11-04-2004 04:09 PM

Yep. But I think I just found the problem. When I did

ldd $CHROOTHOME/bin/sh I found a wayward lib reference in there. So it was to /lib/tls/libc.....

So that definately isn't in my path! UGH!

This Linux stuff .. :confused:

Its a love hate relationship I think. :cry:

netstv 11-05-2004 12:36 PM

So yes the problem was when I did a ldd on my applets (i.e. /bin/sh, /bin/cat... whatever... ) I had a bad lib linked in there. THEN!!!!
I did an ldd on the libs as well because I kept getting the same error message. I found out that the libs weren't build correctly. What a chore.

Ok..what I was trying to do.

Trying to build my own "linux" from scratch with a GNU toolchain.

Problem I had....

Was that when I built the GNU libc, I didn't have the same directory structure as my "chroot" jail. Therefore all the lib paths were off.

So .. short story longer...

Make your toolchain and your system you are running on the same.

-netstv :Pengy:


All times are GMT -5. The time now is 05:17 PM.