LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 07-30-2009, 11:33 PM   #1
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Rep: Reputation: 16
Bash is behaving weird inside chroot


I think it's Bash, though it may be a problem with the installation.

Right after chrooting in chapter 6, Bash doesn't want to read /tools/bin/gcc. The file is there, I checked, and I can use it from outside chroot. However, if I try to run it, I get a "No such file or directory" error. Other files in /tools/bin work perfectly. It's not an issue with $PATH, since I'm using the absolute path. It doesn't seem to be a permissions problem either, since other files work all right and have the exact same permissions.
 
Old 07-31-2009, 04:58 PM   #2
rtg
Member
 
Registered: Aug 2005
Location: Ukraine
Distribution: Ubuntu 9.04
Posts: 99
Blog Entries: 3

Rep: Reputation: 19
Looks like you are missing some library to me.

Try running ldd on /tools/bin/gcc while being in chroot and see what is missing.
 
Old 07-31-2009, 06:32 PM   #3
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Original Poster
Rep: Reputation: 16
Code:
/tools/bin/ldd: line 124: /tools/bin/gcc: No such file or directory
 
Old 07-31-2009, 07:32 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
You may have missed a step, before chrooting, that copied files over to the chroot environment, or used "mount --bind" to mount a system directory inside the chroot environment.
Or these files weren't built in a previous step.
 
Old 07-31-2009, 10:56 PM   #5
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Original Poster
Rep: Reputation: 16
If I went back now and tried installing GCC pass 2 just in case, would that mess things up further?
 
Old 08-01-2009, 01:07 PM   #6
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Original Poster
Rep: Reputation: 16
OK, I figured it out. GCC is linked against the host's /lib/ld-linux.so.2. It seems that making a symlink to it from /tools/lib would work for now and then in chapter 6 when the library is reinstalled everything would work fine. Is this correct?
 
Old 08-01-2009, 05:16 PM   #7
rtg
Member
 
Registered: Aug 2005
Location: Ukraine
Distribution: Ubuntu 9.04
Posts: 99
Blog Entries: 3

Rep: Reputation: 19
Symlinks on host system are not accessible to the chrooted environment, you have either to make hardlinks or copy files.
 
Old 08-01-2009, 06:03 PM   #8
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Original Poster
Rep: Reputation: 16
But would that work, at least temporarily?
 
Old 08-06-2009, 05:39 PM   #9
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
Quote:
you have either to make hardlinks or copy files
and you can try reinstalling gcc and make sure to link it to the correct library
 
Old 08-09-2009, 09:48 PM   #10
ReyJavikVI
Member
 
Registered: Jun 2009
Posts: 67

Original Poster
Rep: Reputation: 16
Well, that's what I ended up doing. Everything's right.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash behaving differently jxrod2000 Linux - Software 2 10-06-2008 06:58 PM
gcc inside of a chroot jail iidroneii Linux - General 1 12-20-2007 04:12 PM
Can cups be ran inside chroot? JackieBrown Debian 2 07-03-2006 12:53 AM
KDE behaving weird (switches desktop to gnome) powadha Linux - Software 3 01-31-2004 11:23 AM


All times are GMT -5. The time now is 04:23 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