LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-04-2004, 01:15 PM   #1
netstv
Member
 
Registered: May 2004
Location: Martinez, CA
Distribution: Ubuntu
Posts: 38

Rep: Reputation: 15
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 and I think I will be FOREVER!
 
Old 11-04-2004, 03:58 PM   #2
greg.hellings
LQ Newbie
 
Registered: Nov 2004
Location: Houghton, New York
Distribution: Gentoo, Fedora Core 2, Debian, Knoppix
Posts: 12

Rep: Reputation: 0
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.
 
Old 11-04-2004, 04:09 PM   #3
netstv
Member
 
Registered: May 2004
Location: Martinez, CA
Distribution: Ubuntu
Posts: 38

Original Poster
Rep: Reputation: 15
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 ..

Its a love hate relationship I think.
 
Old 11-05-2004, 12:36 PM   #4
netstv
Member
 
Registered: May 2004
Location: Martinez, CA
Distribution: Ubuntu
Posts: 38

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FYI: shared libs and iostream (C++) ta0kira Programming 18 10-26-2007 07:48 AM
shared libs help spatula Linux - Software 3 12-14-2005 04:48 AM
Recompile ALL shared libs? ta0kira Programming 3 06-13-2005 01:49 AM
Qt Libs Static or Shared magicm Slackware 2 10-15-2003 06:05 AM
shared libs hanzerik Linux From Scratch 2 03-14-2002 02:08 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration