LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-12-2012, 02:39 AM   #1
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Rep: Reputation: Disabled
[lfs 7.2] many command not found after chroot


Hi experts,

# ldd /tools/bin/bash
linux-vdso.so.1 => (0x00007fff4dbff000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003d5a800000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d4ac00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003d4dc00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d4a400000)
/tools/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x0000003d4a000000)

# ldd /bin/bash
linux-vdso.so.1 => (0x00007fff563ff000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x0000003d5a800000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003d4ac00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d4a400000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d4a000000)

# 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
I have no name!:/# ls
bash: /bin/ls: No such file or directory
I have no name!:/# mkdir
bash: /tools/bin/mkdir: No such file or directory
I have no name!:/#

could anyone point me what's going wrong here?
 
Old 10-12-2012, 11:36 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
There's not enough info yet to point to anything specific.

Just a thought: Is $LFS (still) mounted?

From outside the chrooted environment, what do the following commands show you:
Code:
mount
ls -l $LFS
 
Old 10-16-2012, 01:54 AM   #3
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
There's not enough info yet to point to anything specific.

Just a thought: Is $LFS (still) mounted?

From outside the chrooted environment, what do the following commands show you:
Code:
mount
ls -l $LFS
Thanks for the reply, ls $LFS is still "/mnt/lfs".

I revert everything and start from the beginning, but been blocking at compiling gcc pass1:

configure: error: in `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgomp':
configure: error: C compiler cannot create executables

it happened on my two Fedora 16 box and a RHEL6 box, they have the same result above.
Attached Files
File Type: log config.log (29.3 KB, 4 views)
 
Old 10-16-2012, 02:01 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by mercuyr View Post
ls $LFS is still "/mnt/lfs".
That doesn't answer my question. /mnt/lfs is a mount point and will show when you execute ls $LFS.

Is the partition still mounted on that specific mount point? (2.4. Mounting the New Partition)

Quote:
I revert everything and start from the beginning, but been blocking at compiling gcc pass1:

configure: error: in `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgomp':
configure: error: C compiler cannot create executables

it happened on my two Fedora 16 box and a RHEL6 box, they have the same result above.
Is your host made fully compliant with the host requirements? Run the script mentioned in vii. Host System Requirements and post the outcome.
 
Old 10-16-2012, 04:12 AM   #5
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
$ sh c1-version-check.sh
bash, version 4.2.37(1)-release
/bin/sh -> /usr/bin/bash
Binutils: version 2.22.52.0.1-10.fc17 20120131
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.15
diff (GNU diffutils) 3.2
find (GNU findutils) 4.5.10
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
(GNU libc) 2.15
grep (GNU grep) 2.14
gzip 1.4
Linux version 3.6.1-1.fc17.x86_64 (mockbuild@) (gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC) ) #1 SMP Wed Oct 10 12:13:05 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.82
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.2alpha
gcc compilation OK
 
Old 10-16-2012, 04:24 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by mercuyr View Post
$ sh c1-version-check.sh
bash, version 4.2.37(1)-release
/bin/sh -> /usr/bin/bash
Binutils: version 2.22.52.0.1-10.fc17 20120131
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.15
diff (GNU diffutils) 3.2
find (GNU findutils) 4.5.10
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
(GNU libc) 2.15
grep (GNU grep) 2.14
gzip 1.4
Linux version 3.6.1-1.fc17.x86_64 (mockbuild@) (gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC) ) #1 SMP Wed Oct 10 12:13:05 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.82
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.2alpha
gcc compilation OK
The blue entries might cause problems. I assume you are at the beginning of chapter 6 (6.4), with that in mind: I doubt these are the culprits because you do not mention any problems when building chapter 5.

How about my other/original question? (Is the partition still mounted on that specific mount point?).
 
Old 10-16-2012, 04:39 AM   #7
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
The blue entries might cause problems. I assume you are at the beginning of chapter 6 (6.4), with that in mind: I doubt these are the culprits because you do not mention any problems when building chapter 5.

Thanks for the point out, but my fedora 17 box is already updated to latest. Any suggestion to build the best environment for LFS?


How about my other/original question? (Is the partition still mounted on that specific mount point?).
I have no the original environment now, so I cannot sure about it.
 
Old 10-16-2012, 04:40 AM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,633

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
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
I have no name!:/# ls
bash: /bin/ls: No such file or directory
I have no name!:/# mkdir
bash: /tools/bin/mkdir: No such file or directory
I have no name!:/#

could anyone point me what's going wrong here?
The -i variable makes empty environment.
mkdir will fail because you haven't stated what directory to make.
 
Old 10-16-2012, 04:50 AM   #9
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by EDDY1 View Post
The -i variable makes empty environment.
Yes it does, but the rest of the command sets the environment (including PATH).

Quote:
mkdir will fail because you haven't stated what directory to make.
Also true, but you'll get another error message (mkdir: missing operand), besides that the ls command also doesn't seem to work.
 
Old 10-16-2012, 04:55 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
@mercuyr: This thread seems to tackle an old problem and a new one.

Please tell us:
- which problem you are trying to tackle,
- which host you are using,
- which chapter you are,
- which error(s) you are facing.

If an error meassage is shown, please post it including a few lines before the error (have a look here: Help)
 
Old 10-16-2012, 05:50 AM   #11
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by druuna View Post
@mercuyr: This thread seems to tackle an old problem and a new one.

Please tell us:
- which problem you are trying to tackle,
- which host you are using,
- which chapter you are,
- which error(s) you are facing.

If an error meassage is shown, please post it including a few lines before the error (have a look here: Help)
- The problem I have now is that, compile GCC-4.7.1 Pass 1 failed (chapter 5.5):
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgcc'
Checking multilib configuration for libgomp...
mkdir -p -- x86_64-lfs-linux-gnu/libgomp
Configuring in x86_64-lfs-linux-gnu/libgomp
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for --enable-generated-files-in-srcdir... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-lfs-linux-gnu
checking target system type... x86_64-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-lfs-linux-gnu-strip... /tools/x86_64-lfs-linux-gnu/bin/strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for x86_64-lfs-linux-gnu-gcc... /mnt/lfs/sources/gcc-build/./gcc/xgcc -B/mnt/lfs/sources/gcc-build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include
checking for C compiler default output file name...
configure: error: in `/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgomp':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [configure-target-libgomp] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2

- which host you are using,
Fedora 17 32 & 64, RHEL6.2 64
Currently: BackTrack 5 R3 - 64 Bit

$ sh gh/c1-version-check.sh
bash, version 4.1.5(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.20.1-system.20100303
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.5, 10-Dec-2007.
Coreutils: 7.4
diff (GNU diffutils) 2.8.1
find (GNU findutils) 4.4.2
GNU Awk 3.1.6
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
(Ubuntu EGLIBC 2.11.1-0ubuntu7.10) 2.11.1
GNU grep 2.5.4
gzip 1.3.12
Linux version 3.2.6 (root@bt) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #1 SMP Fri Feb 17 10:34:20 EST 2012
m4 (GNU M4) 1.4.13
GNU Make 3.81
patch 2.6
Perl version='5.10.1';
GNU sed version 4.2.1
tar (GNU tar) 1.22
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 4.999.9beta
gcc compilation OK
Attached Files
File Type: log config.log (28.7 KB, 0 views)
 
Old 10-16-2012, 05:55 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
You mention 4 hosts:
Quote:
Fedora 17 32 & 64, RHEL6.2 64
Currently: BackTrack 5 R3 - 64 Bit
Which one is it? You cannot use all four or use one and then switch to another (assuming the same LFS build).

The version check mentions ubuntu, which would make it 5 hosts (or is this from BackTrack?).

Did you remove the gcc source and build directories before retrying (have a look here: Second Important box).

It seems you are all over the place. I would suggest picking ONE host and start from scratch with the LFS build.
 
Old 10-16-2012, 06:02 AM   #13
mercuyr
LQ Newbie
 
Registered: Oct 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
You mention 4 hosts: Which one is it? You cannot use all four or use one and then switch to another (assuming the same LFS build).

The version check mentions ubuntu, which would make it 5 hosts (or is this from BackTrack?).

Did you remove the gcc source and build directories before retrying (have a look here: Second Important box).

It seems you are all over the place. I would suggest picking ONE host and start from scratch with the LFS build.
It is I have compiled the GCC in 4 hosts, every time was extracting source separately, not use any old dir.
the check version mentioned ubuntu is the backtrack host.
 
Old 10-16-2012, 06:08 AM   #14
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Assuming an Ubuntu based host, have a look here: LFS 7.1 on Ubuntu 12.04. Maybe you notice anything that you do different and can fix the problem that way. Your partition layout may differ, but that shouldn't be a problem.
 
  


Reply

Tags
lfs


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: chroot: command not found satimis Linux From Scratch 9 03-15-2010 08:38 AM
chroot: expect: command not found dbbolton Linux From Scratch 11 12-06-2009 07:33 PM
GCC command not found LFS book 6.3, section 6.7.1 cdc5205 Linux From Scratch 1 08-16-2008 01:56 PM
cant find the "make" command after chroot to the LFS system fengfeng Linux From Scratch 2 02-10-2008 11:34 PM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM


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