LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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-13-2011, 01:09 AM   #1
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Rep: Reputation: 0
Unhappy Error while 'chrooting' into build environment


Hi, I have taken up LFS as my college project. I have completed the test system installation so far and now going to continue with actual system building (i.e. chapter 6)

The problem is that when I give the 'chroot' command i.e.

Quote:
chroot "$LFS" /tools/bin/env -i......
I get error as
Quote:
:/tools/bin/env - no such file or folder found
.

But when I manually check the /tools/bin directory,I can find the required file 'env'. So what can be the error?

Last edited by sudeepkulkarni; 07-13-2011 at 01:19 AM.
 
Old 07-13-2011, 02:09 AM   #2
zer0signal
Member
 
Registered: Oct 2010
Location: Cleveland
Distribution: Slackware, Fedora, RHEL (4,5), LFS 6.7, CentOS
Posts: 258

Rep: Reputation: 29
a) are you root?

b) do the command pwd from where you are issueing the

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
 
Old 07-14-2011, 01:54 AM   #3
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Yes, I am indeed performing the operation as root.

The o/p of pwd command is, as expected:

Quote:
/
 
Old 07-14-2011, 03:41 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
Hi,

I really doubt that the following is what was shown after the chroot command:
Quote:
:/tools/bin/env - no such file or folder found
Can you post the complete and correct error message that is shown?

Also provide some basic information:
- Are you building the latest stable LFS (6.8),
- Which host are you using and did you make it compliant,
- Did you have any problems in the previous chapters.

Although the error message shown isn't correct/complete, the only thing I can come up with is this: Is $LFS (/mnt/lfs) mounted?

Hope this helps.
 
Old 07-16-2011, 02:29 AM   #5
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Here are the answers as requested:

1) Yes, I am using the latest build i.e. 6.8

2)I am using Linux Mint 11 (Katya) i686. I am not sure what you mean when you say "making it compliant" - but I have run the script to test whether the system is ready for compilation or not and the output was "compilation OK"

3)I did encounter a few problems while building the test system, e.g. GCC, GLIBC didn't compile successfully at first. But then i simply removed the respective files and folders and reinstalled it - then there was no problem.

4)Here is the output of "mount" command confirming that I have indeed mounted the /mnt/lfs i.e. $LFS partition:

Quote:
/dev/sda8 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/swapnil/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=swapnil)
/dev/sda10 on /mnt/lfs type ext3 (rw)
Quote:
swapnil-inspiron / # 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: failed to run command `/tools/bin/env': No such file or directory
swapnil-inspiron / #

5)Here is the o/p of of the "/tools/bin/env" command which is a symlink to $LFS/tools/bin/env

Quote:
swapnil-inspiron bin # env
ORBIT_SOCKETDIR=/tmp/orbit-swapnil
SSH_AGENT_PID=1533
SHELL=/bin/bash
TERM=xterm
XDG_SESSION_COOKIE=97d685c54e6ce41e1602a4d500000008-1310796704.632489-1247394897
WINDOWID=62914593
GNOME_KEYRING_CONTROL=/tmp/keyring-23T8sl
GTK_MODULES=canberra-gtk-module
USER=root
LFS=/mnt/lfs
SSH_AUTH_SOCK=/tmp/keyring-23T8sl/ssh
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
USERNAME=swapnil
SESSION_MANAGER=local/swapnil-inspiron:@/tmp/.ICE-unix/1500,unix/swapnil-inspiron:/tmp/.ICE-unix/1500
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
MAIL=/var/mail/root
DESKTOP_SESSION=gnome
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
LC_MESSAGES=en_IN.UTF-8
PWD=/tools/bin
GDM_KEYBOARD_LAYOUT=us
LANG=en_IN
GNOME_KEYRING_PID=1481
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
GDM_LANG=en_IN
COMPIZ_CONFIG_PROFILE=ubuntu
UBUNTU_MENUPROXY=libappmenu.so
GDMSESSION=gnome
HOME=/root
SHLVL=2
LANGUAGE=en_IN:en
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=root
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-DJu28hmYb6,guid=b17f26ce8eabb92246c934db00000026
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
WINDOWPATH=7
DISPLAY=:0
XAUTHORITY=/var/run/gdm/auth-for-swapnil-x2XoKc/database
COLORTERM=gnome-terminal
_=/usr/bin/env
OLDPWD=/
Hope this much information is sufficient.
 
Old 07-16-2011, 04:36 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
Hi,
Quote:
Originally Posted by sudeepkulkarni View Post
2)I am using Linux Mint 11 (Katya) i686. I am not sure what you mean when you say "making it compliant" - but I have run the script to test whether the system is ready for compilation or not and the output was "compilation OK"
I am talking about this: vii. Host System Requirements

Quote:
4)Here is the output of.....
Quote:
swapnil-inspiron / # 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: failed to run command `/tools/bin/env': No such file or directory
I see mistakes in the above command (in red). These aren't show stoppers, but I do wonder if you made any other "typo's".

Quote:
5)Here is the o/p of of the "/tools/bin/env" command which is a symlink to $LFS/tools/bin/env
The env command is reachable and working, as the above output shows.

Maybe something went wrong in chapter 5 (I'm guessing the toolchain or gcc), if that is the case all packages you build are not linked correctly. What is the output of the following command (as root):
Code:
ldd /tools/bin/env
The output should show something like this:
Code:
ldd /tools/bin/env
   libc.so.6 => /tools/lib/libc.so.6
   /tools/lib64/ld-linux-x86-64.so.2
If the bold parts are missing: You need to start all over again!

Hope this helps.
 
1 members found this post helpful.
Old 07-18-2011, 02:37 AM   #7
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Oh no!!! the bold parts are definitely missing. So I screwed up while installing, resulting in incorrect links. All the libraries are linked to the host system itself

So I am going to start the whole procedure again. But I do have one question - is there a way to verify that whatever packages that have been installed are set up properly? It would be immensely helpful if I could verify the correctness of the installed packages.

Also can anyone suggest what would be the perfect host system for installing this LFS latest build? I am thinking of following distros:

1)Slackware (13.1/13.37)

2)Linux Mint(10/11)

3)CentOS (5.6/6)

Which of these sounds good?

Last edited by sudeepkulkarni; 07-18-2011 at 02:45 AM.
 
Old 07-18-2011, 03:09 AM   #8
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
Hi,
Quote:
Originally Posted by sudeepkulkarni View Post
Oh no!!! the bold parts are definitely missing. So I screwed up while installing, resulting in incorrect links. All the libraries are linked to the host system itself
That's a bummer!

Quote:
So I am going to start the whole procedure again. But I do have one question - is there a way to verify that whatever packages that have been installed are set up properly? It would be immensely helpful if I could verify the correctness of the installed packages.
The build process for each package should, in general, tell you if it was done correctly. When you reach chapter 6 you will also do a make check/test step to verify the build. Doing this step in chapter 5 isn't useful (as mentioned in the book). You could run them, but a failed test does not mean that the package was build incorrectly (for chapter 5, you must run the make check/test steps in chapter 6).

The LFS team created some test for packages/steps that are really important (have a look at 5.8 and 5.10). These test should not fail, if they do you need to figure out what went wrong and fix it before continuing!

Quote:
Also can anyone suggest what would be the perfect host system for installing this LFS latest build? I am thinking of following distros:
1)Slackware (13.1/13.37)
2)Linux Mint(10/11)
3)CentOS (5.6/6)
Which of these sounds good?
The LFS liveCD is the best host, although if you have state of the art hardware it might fail (mentioned here).

If you do want to use a distro I would choose Slackware (I prefer Debian, but that one isn't on your list). Do make sure that you make the host compliant!! Not doing so will get you in trouble.

TIP: Once you reach the end of chapter 5 I would advise you to make a backup of what you have build this far. This will make sure that you do not have to start from scratch if you make a mistake in chapter 6 (caution box near the bottom).

Hope this helps.

Last edited by druuna; 07-18-2011 at 03:10 AM. Reason: fixed a typo
 
Old 07-18-2011, 10:11 AM   #9
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
So I started rebuilding the system and soon encountered an error. The GCC pass-1 phase didn't complete successfully. I encountered problem while running command "make". I have attached the "config.log" file from GCC build process here. Please tell me what is wrong.

Thanks for the help.
Attached Files
File Type: log config.log (30.6 KB, 8 views)
 
Old 07-18-2011, 10:15 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
Hi,

Can you also post the error(s) shown in the terminal?

EDIT: Is the make command installed on your host distro?

Last edited by druuna; 07-18-2011 at 10:34 AM.
 
Old 07-19-2011, 01:04 AM   #11
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Here is the output of "make" command as attachment.

And yes, make command is there on Slackware 13.37 (host)
Attached Files
File Type: txt make-error.txt (2.9 KB, 11 views)
 
Old 07-19-2011, 02:49 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
Hi,

The only time I've seen errors like this is when the host is not compliant. In this case I'm guessing that gcc related programs are missing on your host. Revisit the host requirements page and make sure _all_ is correct!

BTW: Why don't you use the LFS liveCD instead of Slackware?
 
Old 07-21-2011, 06:29 AM   #13
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Okay, so I am now past GCC compilation, it is successful. Now when I try to install glibc-2.13, I get following error:

Quote:
make[1]: Failed to remake makefile `/mnt/lfs/tools/build/config.make'.
make[1]: *** No rule to make target `/mnt/lfs/tools/build/Versions.all', needed by `/mnt/lfs/tools/build/abi-versions.h'. Stop.
make[1]: Leaving directory `/mnt/lfs/tools/glibc-2.13'
make: *** [all] Error 2
Is it again due to non-compliance? The glibc version in host is 2.11.1, which I think is allowed. I am attaching the 'config.log' file and o/p of the shell script 'version-check.sh'.
Attached Files
File Type: log config.log (74.8 KB, 4 views)
File Type: txt version-check.txt (705 Bytes, 1 views)
 
Old 07-21-2011, 06:51 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
Hi,

The error message you posted is just that, the possible interesting parts are the lines before the error is shown. Please post those (if you are not sure, post the 10-15 lines before the make[1]: Failed to remake makefile `/mnt/lfs/tools/build/config.make'. line.

One thing that I do notice: I don't see the glibc-build directory from which you should do the build steps (/mnt/lfs/sources/glibc-2.13 vs /mnt/lfs/sources/glibc-build) and there's also no /mnt/lfs/sources directory.

BTW: I had a look at the output created by the version-check.txt script: That looks fine.

EDIT: Please read this chapter so we don't have to keep asking for extra/correct information: 1.5. Help

Last edited by druuna; 07-21-2011 at 07:10 AM. Reason: Added url
 
Old 07-22-2011, 12:51 AM   #15
sudeepkulkarni
Member
 
Registered: Mar 2011
Location: Sangli, Maharashtra, India
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30

Original Poster
Rep: Reputation: 0
Here is what I do while installing any package:

1. Unpack the package archive in the host OS itself.
2. Change its permissions
3. cp -rv /path/to/<pkg-name> $LFS/tools
4. mkdir -v $LFS/tools/<pkg-build>
5. cd <pkg-build>
6. $LFS/tools/<pkg-name>/configure...........
7. make
8. make install

IS there something wrong with this scheme? Do I have to create the sources directory?

P.S. I will post the whole make log shortly.
 
  


Reply

Tags
chroot, 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
LXer: Chrooting into a Linux environment LXer Syndicated Linux News 0 06-29-2008 10:00 PM
no kernel module build environment" Error message during RPM install gotmonkey Linux - Hardware 7 12-07-2007 03:08 AM
Gentoo Install 'FATAL: kernel too old' when chrooting into environment HayGuyyys Linux - General 9 02-02-2007 11:37 PM
BLFS: Error on chrooting into LFS environment StevePhM Linux From Scratch 13 08-01-2005 04:28 AM
build environment arkss Linux - Software 0 06-25-2005 04:54 PM


All times are GMT -5. The time now is 11:50 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration