-   Linux From Scratch (
-   -   LFS 6.6 - chap6.7 - Linux- API Headers (problems in this step) (

ukiuki 05-22-2010 09:04 AM

LFS 6.6 - chap6.7 - Linux- API Headers (problems in this step)
I just got lost here i assumed it should be done as in chap. 5,
so i untar the package into source directory and cd to there:


root:/sources/linux- make mrproper
/bin/sh: find: command not found
/bin/sh: line 5: xargs: command not found
make: *** [clean] Error 127

This is my 1st LFS and i dunno what is wrong , everything else been fine so far. I need some help here.

Thanks in advance

druuna 05-22-2010 09:20 AM


After finishing chapter 5, did you enter the chrooted env correctly (chap 6.4)? Looks like a PATH problem at first glance.


I just got lost here i assumed it should be done as in chap. 5
Forget chap 5 and the way things are done there. Focus on 6. Some of the things are done the same as in chapter 5 but chapter 5 and 6 build different environments and should not be compared.

Hope this helps.

ukiuki 05-22-2010 10:01 AM

1 Attachment(s)
I checked all the steps through 6.2 - 6.6, all commands been done correctly,
yes i did enter the chroot environment:


dbox:~# 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!:/#

I'm not sure what is wrong. I copied all the commands done through 6.2-6.6
and attached txt file.

Thanks in advance

druuna 05-22-2010 10:40 AM


All the commands in the attachment and the chroot command look ok.

What does ls -l /bin and echo $PATH show (from inside the chrooted env)?

BTW: If ls also doesn't work: cd /bin && echo *

ukiuki 05-22-2010 11:12 AM

Here is the output:


root:/# ls -l /bin
total 0
lrwxrwxrwx 1 root root 15 May 22 09:03 bash -> /tools/bin/bash
lrwxrwxrwx 1 root root 14 May 22 09:03 cat -> /tools/bin/cat
lrwxrwxrwx 1 root root 15 May 22 09:03 echo -> /tools/bin/echo
lrwxrwxrwx 1 root root 14 May 22 09:03 pwd -> /tools/bin/pwd
lrwxrwxrwx 1 root root  4 May 22 09:08 sh -> bash
lrwxrwxrwx 1 root root 15 May 22 09:03 stty -> /tools/bin/stty
root:/# echo $PATH
root:/# cd /bin && echo *
bash cat echo pwd sh stty

Thanks in advance

druuna 05-22-2010 11:36 AM

Hi again,

That output looks ok.

What about the /tools/bin directory? Are the "missing" executables present (find and xargs two name just 2).

ukiuki 05-22-2010 12:47 PM

Hi !

Looks like that is the problem, what did i miss ?


root:/tools/bin# ls f*
factor        false  fgrep  fmt  fold
root:/tools/bin# ls x*

Thanks in advance !

druuna 05-22-2010 01:27 PM


Both find and xargs are part of the Findutils package. Guess something went wrong during the build/install (or did you unintentionally skip it?).

You are just starting chapter 6 so going back to 5 should still be possible:

- Leave the chrooted env (if you haven't already),
- Switch to the lfs user (su - lfs),
- Check if the LFS variable is still set (echo $LFS),
- Goto the sources directory (cd $LFS/sources),
- Unpack the Findutils package (tar zxf findutils-4.4.2.tar.gz)
- Enter the newly created directory and execute the steps in 5.19. Findutils-4.4.2

After that log out again and start with chap 6 again: If you did not reboot the mounts etc from chap 6.2 should still be in place, so start with chap 6.4.

Hope this helps.

ukiuki 05-22-2010 02:08 PM


Ok yes i have skipped that by accident, i look at lfs user bash_history i just saw that,
ill go back and do as you said.

here my history file: diffutils is step 5.18 and gawk 5.20 oops!

tar -zxf diffutils-2.8.1.tar.gz
cd diffutils-2.8.1
./configure --prefix=/tools
make check
make install
cd ..
rm -Rf diffutils-2.8.1
tar -jxf gawk-3.1.7.tar.bz2
cd gawk-3.1.7
./configure --prefix=/tools
make install
cd ..
rm -Rf gawk-3.1.7

Thanks in advance !

druuna 05-22-2010 02:20 PM

:) That happens......

Glad to see you've figured out what was wrong.

ukiuki 05-23-2010 02:42 AM


Well not as easy as i was hopping, im having problem to install findutils
i saw the permission denied line to /tools i gave the owner back to user lfs
but after that i still have the same problem.


test -z "/tools/bin" || /tools/bin/mkdir -p "/tools/bin"
  /tools/bin/install -c 'find' '/tools/bin/find'
/tools/bin/install: cannot create regular file `/tools/bin/find': Permission denied
make[3]: *** [install-binPROGRAMS] Error 1
make[3]: Leaving directory `/mnt/lfs/sources/findutils-4.4.2/find'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/findutils-4.4.2/find'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/findutils-4.4.2/find'
make: *** [install-recursive] Error 1

Thanks in advance !

druuna 05-23-2010 03:52 AM


Going back to chapter 5 once you started chapter 6 isn't always possible, it depends a bit on where you are in chapter 6. I do believe it should be possible for you in this case. Worst case scenario: You need to start all over again. But lets try something else first!

The reason for the problems: One of the last steps in chapter 5 (5.32) is changing the ownership of $LFS/tools (chown -R root:root $LFS/tools), which means that the tools dir and everything inside it is given to root (owner and group) and user lfs doesn't have access anymore.

Possible solution for the problem:

- As root (normal root, not the chrooted env root) change $LFS/tools to user LFS: chown -R lfs $LFS/tools,

- Execute the findutils install steps as user lfs (chapter 5.19.) also see post #8,

- As (normal) root change the $LFS/tools permissions back to root: chown -R root:root $LFS/tools (chapter 5.32).

From tis point on you can start with chapter 6. I'm not sure if you rebooted in the meantime, so start with chapter 6.2. You will get some error messages which you can probably ignore (some of the directories already exist due to your previous visit to chapter 6).

Before you start: Remove the unpacked findutils directory first!

Hope this gets you going agagin.

ukiuki 05-23-2010 04:13 AM


I was doing this: chown -v lfs $LFS/tools , that is why it didn't work,
I got the findutils installed , got a backup of /tools, permissions are set back
to normal root and no restarts on system so i can go back to chap6 steps i guess, is it possible to just enter in the chroot invironment (6.4)
since nothing else changed?
Anything else i should be concerned about ?

Thanks in advance !

druuna 05-23-2010 04:43 AM


If, as you mention, all is still set (especially the mounts), you can start with 6.4.

I assume you checked to see if you haven't skipped any other packages, which means you can continue. The only thing you need to be concerned about is following the book to the letter.

Have fun!

ukiuki 05-23-2010 05:31 AM

I did check for the package installation, none else missed.

Thank you very much !!

All times are GMT -5. The time now is 10:31 AM.