LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   lfs 10.1 | Entering the Chroot Environment | Ubuntu 20.04 | '/usr/bin/env’: Not a directory (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-10-1-%7C-entering-the-chroot-environment-%7C-ubuntu-20-04-%7C-usr-bin-env%92-not-a-directory-4175692698/)

farhatb 03-26-2021 06:34 PM

lfs 10.1 | Entering the Chroot Environment | Ubuntu 20.04 | '/usr/bin/env’: Not a directory
 
Hello,
Host distribution: Ubuntu 20.04
LFS book version: 10.1
Section where the problem was encountered: 7.4. Entering the Chroot Environment
Error:
Code:

root@farhat-pc:/mnt/lfs# chroot "$LFS" /usr/bin/env -i  \
>    HOME=/root                  \
>    TERM="$TERM"                \
>    PS1='(lfs chroot) \u:\w\$ ' \
>    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
>    /bin/bash --login +h
chroot: failed to run command ‘/usr/bin/env’: Not a directory

$LFS/bin/usr/env:
Code:

root@farhat-pc:/mnt/lfs# ls -lah usr/bin/env
-rwxr-xr-x 1 root root 265K mars 26 15:50 usr/bin/env

'$LFS/usr/env' is a file file not a directory!!
I am sure that I have followed the two previous section 7.2 && 7.3
Any hint please?

goldennuggets 03-26-2021 06:44 PM

I'm experiencing the same thing, building on top of OpenSuse.
https://www.linuxquestions.org/quest...ry-4175692690/

Keith Hedger 03-27-2021 06:11 AM

is LFS set correctly?

farhatb 03-27-2021 07:33 AM

Quote:

Originally Posted by Keith Hedger (Post 6234624)
is LFS set correctly?

Yes, sure

Keith Hedger 03-27-2021 08:51 AM

is $LFS actually mounted?

Keith Hedger 03-27-2021 08:53 AM

what is at $LFS/dev , $LFS/proc etc ie are the virtual systems mounted, what are the mount options for $LFS

goldennuggets 03-27-2021 09:15 AM

Quote:

Originally Posted by Keith Hedger (Post 6234663)
what is at $LFS/dev , $LFS/proc etc ie are the virtual systems mounted, what are the mount options for $LFS

I'm experiencing the same exact issues with $LFS mounted, the proper environment variables set, and virtual systems mounted according to the instructions in the 10.1 guide.
https://www.linuxquestions.org/quest...ry-4175692690/

It's a bit odd that both of us, on the same day, ran into the same issue, at the same exact point in the process.

Keith Hedger 03-27-2021 09:38 AM

I had a similar problem when 1st using the new build system, it was the lib folders, are you using /lib64 and /usr/lib64 ( presuming a 64 bit machine ) or are you using /lib and /usr/lib ?

On my system /lib is symlink to /lib64 and /usr/lib is symlink to /usr/lib64.

goldennuggets 03-27-2021 09:54 AM

Quote:

Originally Posted by Keith Hedger (Post 6234679)
I had a similar problem when 1st using the new build system, it was the lib folders, are you using /lib64 and /usr/lib64 ( presuming a 64 bit machine ) or are you using /lib and /usr/lib ?

On my system /lib is symlink to /lib64 and /usr/lib is symlink to /usr/lib64.

Very interesting and insightful!
So, it appears that I'm using /lib and /usr/lib for all but the following:
Inside /mnt/lfs/lib64 are ld-linux-x86_64.so.2 and ld-lsb-x86-64.so.3
/mnt/lfs/usr/lib64 contains several libstdc++ libraries

What do you think is the best way to proceed from here since there are libs in both?

Keith Hedger 03-27-2021 10:39 AM

My only fix was to start from scratch, and make sure the links were in at the begining sorry :(

goldennuggets 03-27-2021 10:40 AM

Quote:

Originally Posted by Keith Hedger (Post 6234700)
My only fix was to start from scratch, and make sure the links were in at the begining sorry :(

Ouch...

KDSR 03-27-2021 11:07 AM

probably this.... chapter 5.5.1

Code:

case $(uname -m) in
    i?86)  ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
    ;;
    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
            ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
    ;;
esac

sym links not made properly

goldennuggets 03-27-2021 12:39 PM

Quote:

Originally Posted by KDSR (Post 6234708)
probably this.... chapter 5.5.1

Code:

case $(uname -m) in
    i?86)  ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
    ;;
    x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64
            ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
    ;;
esac

sym links not made properly

Okay! Now we're getting somewhere...however...
I've now run into this:
Code:

chroot: failed to run command ‘/usr/bin/env’: Too many levels of symbolic links

farhatb 03-27-2021 01:15 PM

Thank you all,
I restart the process from the beginning and the issue has been resolved(It took me ~2-3 hours)

hendrickxm 03-27-2021 01:21 PM

You should have made those symlinks in chapter 5.5 and not afterwards.
Unfortunately this means redoing chapter 5.


All times are GMT -5. The time now is 09:41 AM.