LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-15-2008, 07:57 AM   #1
trurl23
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
problem with env while entering chroot'ed environment


Hi Folks,

when I have completed compiling the toolchain (chapter 5) and I want to enter the chroot environment, chroot complains about /tools/bin/env not being found. I had the same problem with /tools/bin/bash before which was caused by bash being linked dynamically and those libs were not found.

I tried an ldd /tools/bin/env and found out that /tools/bin/env was also linked dynamically. If I understood it right, all programs in the first chain (from chapter 5) should be linked statically.

However I didn't find a way to make coreutils (6.10) link statically and there also wasn't any hint about this in the LFS book.

I read that linux-gate.so.1 is something like a "virtual" lib exposed by the kernel and libc.so.6 and ld-linux.so.2 are also present in /tools/lib.

The distribution used for creating the toolchain is Slackware 12.1.

Any suggestions what is wrong exactly and how to fix it?

Thanks,
Trurl

Failed command is
Quote:
chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin /tools/bin/bash --login +h
chroot: cannot run command `/tools/bin/env': No such file or directory
Output from ldd /tools/bin/env:
Quote:
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/libc.so.6 (0xb7e61000)
/lib/ld-linux.so.2 (0xb7fdb000)
 
Old 06-15-2008, 03:12 PM   #2
trurl23
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Lightbulb fbbg

Ok, I figured out what was wrong. Making mistakes means learning...
Something went terribly wrong during creation of the linker. I also learned that linkinig dynamically at this stage is okay, but the library prefix should be /tools/lib rather than /lib when checked with ldd.
Just wanted to let you know, if you run into the same troubles, check your gcc compilation.
 
  


Reply



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
Problem with chroot'ed Ubuntu installation under SuSE 8.2 svetho Ubuntu 1 05-07-2006 10:40 PM
set, env, source & "completely empty environment..." ? na5m Linux From Scratch 1 01-28-2005 03:29 AM
Environment Variable: how to change env DISPLAY in Redhat 9 lucastic Linux - General 2 07-21-2004 04:15 PM
Problem entering chroot environment. mullog Linux From Scratch 1 06-05-2004 08:12 AM
How can I do some modification to my initialized "env" environment variable? yuzuohong Linux - General 3 12-18-2002 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:36 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration