LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Bash is behaving weird inside chroot (https://www.linuxquestions.org/questions/linux-from-scratch-13/bash-is-behaving-weird-inside-chroot-744046/)

ReyJavikVI 07-30-2009 10:33 PM

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.

rtg 07-31-2009 03:58 PM

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.

ReyJavikVI 07-31-2009 05:32 PM

Code:

/tools/bin/ldd: line 124: /tools/bin/gcc: No such file or directory

jschiwal 07-31-2009 06:32 PM

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.

ReyJavikVI 07-31-2009 09:56 PM

If I went back now and tried installing GCC pass 2 just in case, would that mess things up further?

ReyJavikVI 08-01-2009 12:07 PM

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?

rtg 08-01-2009 04:16 PM

Symlinks on host system are not accessible to the chrooted environment, you have either to make hardlinks or copy files.

ReyJavikVI 08-01-2009 05:03 PM

But would that work, at least temporarily?

RaptorX 08-06-2009 04:39 PM

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

ReyJavikVI 08-09-2009 08:48 PM

Well, that's what I ended up doing. Everything's right.


All times are GMT -5. The time now is 03:42 AM.