Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Rep:
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 12:19 AM.
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?
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Original Poster
Rep:
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
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"
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):
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Original Poster
Rep:
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 01:45 AM.
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 02:10 AM.
Reason: fixed a typo
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Original Poster
Rep:
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.
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?
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Original Poster
Rep:
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'.
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 06:10 AM.
Reason: Added url
Distribution: Linux Mint 11 (Katya), Slackware 13.1, Slackware 13.37
Posts: 30
Original Poster
Rep:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.