LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Error While Trying Build of Binutils (1st Attempt) (https://www.linuxquestions.org/questions/linux-from-scratch-13/error-while-trying-build-of-binutils-1st-attempt-885257/)

druuna 06-10-2011 11:04 AM

Hi,

/tools should be present and is not removed during the build. Before you enter the chrooted environment, what does ls -l / show? If /tools -> /mnt/lfs/tools is not present, do the following (as root):
Code:

ln -sv $LFS/tools /
Hope this helps.

gdawg 06-10-2011 12:33 PM

Hi,

That link is there. Here is the output:
Quote:

dhcppc0:~ # ls -l /
total 108
drwxr-xr-x 2 root root 4096 May 27 09:09 bin
drwxr-xr-x 3 root root 4096 Jun 3 21:29 boot
drwxr-xr-x 19 root root 3920 Jun 10 10:21 dev
drwxr-xr-x 117 root root 12288 Jun 10 10:35 etc
drwxr-xr-x 7 root root 4096 Jun 8 11:05 home
drwxr-xr-x 20 root root 12288 Jun 3 09:58 lib
drwx------ 2 root root 16384 May 26 14:47 lost+found
drwxr-xr-x 3 root root 4096 Jun 10 10:17 media
drwxr-xr-x 3 root root 4096 Jun 8 09:03 mnt
drwxr-xr-x 2 root root 4096 Feb 18 06:48 opt
dr-xr-xr-x 166 root root 0 Jun 10 10:16 proc
drwx------ 11 root root 4096 Jun 10 11:22 root
drwxr-xr-x 3 root root 12288 Jun 3 09:58 sbin
drwxr-xr-x 2 root root 4096 Feb 18 06:48 selinux
drwxrwxrwt 2 root root 4096 Jun 8 09:43 sources
drwxr-xr-x 4 root root 4096 May 26 14:47 srv
drwxr-xr-x 12 root root 0 Jun 10 10:17 sys
drwxrwxrwt 93 root root 4096 Jun 10 11:15 tmp
lrwxrwxrwx 1 root root 14 Jun 8 11:03 tools -> /mnt/lfs/tools
drwxr-xr-x 12 root root 4096 May 26 14:47 usr
drwxr-xr-x 16 root root 4096 Jun 3 21:29 var
drwxr-xr-x 5 root root 4096 May 26 14:47 windows
d
What else could be causing the error? Thanks.

druuna 06-10-2011 12:42 PM

Hi,

You did verify that $LFS is mounted? df -h | grep $LFS

Does this provide any output: ls -l /tools/bin/env

Hope this helps.

gdawg 06-10-2011 02:17 PM

Hi,

$LFS was not mounted although I did mount it this morning. Also "echo $LFS" did not work even though I fixed it this morning. Here are the latest commands and outputs:
Quote:

dhcppc0:~ # df -h | grep $LFS
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
dhcppc0:~ # echo $LFS

dhcppc0:~ # export LFS=/mnt/lfs
dhcppc0:~ # echo $LFS
/mnt/lfs
dhcppc0:~ # mount -t ext3 /dev/sdb6 $LFS
dhcppc0:~ # df -h | grep $LFS
/dev/sdb6 9.9G 265M 9.1G 3% /mnt/lfs
dhcppc0:~ # ls -l /tools/bin/env
ls: cannot access /tools/bin/env: No such file or directory
dhcppc0:~ # 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
After becoming "root user" this morning I checked "echo $LFS": no output - ran "export LFS=/mnt/lfs" - that fixed "echo" command. Ran check if LFS was mounted - no output - mounted LFS using "df -h | grep $LFS" command. Ran the other "mount" commands.
I don't know how or why they changed. Thank you for your patience and help.

druuna 06-10-2011 02:24 PM

Hi,

I might have an idea what has happened.

Unmount $LFS (umount /mnt/lfs) and post the output of ls -la /mnt/lfs/

I'm guessing you build (part of?) LFS while /dev/sdb6 was not mounted. If that is true then you need to delete everything and start from the beginning again.

Hope this helps.

gdawg 06-10-2011 03:01 PM

Hi,

Here are the results of advised actions:
Quote:

dhcppc0:~ # umount /mnt/lfs/
umount: /mnt/lfs/: not mounted
dhcppc0:~ # ls -la /mnt/lfs/
total 100
drwxr-xr-x 21 root root 4096 Jun 8 20:18 .
drwxr-xr-x 3 root root 4096 Jun 8 09:03 ..
drwxr-xr-x 2 root root 4096 Jun 9 22:12 bin
drwxr-xr-x 2 root root 4096 Jun 8 20:18 boot
drwxr-xr-x 2 root root 4096 Jun 8 20:10 dev
drwxr-xr-x 5 root root 4096 Jun 9 22:00 etc
drwxr-xr-x 2 root root 4096 Jun 8 20:18 home
drwxr-xr-x 4 root root 4096 Jun 9 21:34 lib
drwxr-xr-x 4 root root 4096 Jun 8 20:18 media
drwxr-xr-x 2 root root 4096 Jun 8 20:18 mnt
drwxr-xr-x 2 root root 4096 Jun 8 20:18 opt
drwxr-xr-x 2 root root 4096 Jun 8 20:09 proc
drwxr-x--- 2 root root 4096 Jun 8 20:23 root
drwxr-xr-x 2 root root 4096 Jun 9 22:05 sbin
drwxrwxrwt 2 lfs root 4096 Jun 9 22:27 sources
drwxr-xr-x 2 root root 4096 Jun 8 20:18 srv
drwxr-xr-x 2 root root 4096 Jun 8 20:09 sys
drwxrwxrwt 2 root root 20480 Jun 9 22:11 tmp
drwxr-xr-x 13 root root 4096 Jun 8 18:11 tools
drwxr-xr-x 9 root root 4096 Jun 8 20:18 usr
drwxr-xr-x 12 root root 4096 Jun 8 20:18 var
Thanks. I cd'd into /tools/bin and there is no /env directory or file.

gdawg 06-10-2011 08:12 PM

Hi,

I've decided to start over from beginning. Thank you very much for your help.

druuna 06-11-2011 12:54 AM

Hi again,

Maybe the following will help you with you new build:

- Add the following line to your /root.bashrc file: export LFS=/mnt/lfs
- Add this to your /etc/fstab: /dev/sdb6 /mnt/lfs ext3 defaults 0 2

The above 2 suggestion need to be added to your host (Suse if I recall correctly). This way the LFS variable will always be set and LFS will be mounted when booting.

Good luck with the new build!

gdawg 06-12-2011 09:42 AM

Hi,
Thanks again for all your help. I think some of the problem has to do with the external hard drive I'm installing lfs on. I've noticed that it doesn't light-up until I boot win 7.

Kind regards,

Glen


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