LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Unable to chroot into clfs (https://www.linuxquestions.org/questions/linux-from-scratch-13/unable-to-chroot-into-clfs-852734/)

grumpy.biatch 12-27-2010 11:05 PM

Unable to chroot into clfs
 
Hi,

I get this error while changing root -


Code:

chroot "${CLFS}" /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
(12:03:28 AM) lfs-livecd: chroot: cannot change root directory to : No such file or directory

here is my status before chroot attempt -I have reinstalled ncurses and bash but the error continues.

Best.

Oliv' 12-28-2010 03:33 AM

Hello,

it seems that you get this error because your CLFS environment variable is not set... seems that's an empty string.

Regards,

Oliv'

grumpy.biatch 12-28-2010 06:57 AM

Quote:

Originally Posted by Oliv' (Post 4205211)
it seems that you get this error because your CLFS environment variable is not set... seems that's an empty string.

I did that right at start and it is very much there.

Code:

clfs [ ~ ]$ cat > ~/.bash_profile << "EOF"
exec env -i HOME=${HOME} TERM=${TERM} PS1='\u:\w\$ ' /bin/bash
EOF

clfs [ ~ ]$ cat > ~/.bashrc << "EOF"
set +h
umask 022
CLFS=/mnt/clfs
LC_ALL=POSIX
PATH=/cross-tools/bin:/bin:/usr/bin
export CLFS LC_ALL PATH
EOF

source ~/.bash_profile

This is strange -
Code:

ldd /tools/bin/bash
        not a dynamic executable

Its built with staticlib but i dont recollect doing that.

Oliv' 12-28-2010 07:12 AM

Quote:

Originally Posted by grumpy.biatch (Post 4205034)
I get this error while changing root -

Code:

chroot "${CLFS}" /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
(12:03:28 AM) lfs-livecd: chroot: cannot change root directory to : No such file or directory


I thought that because of your error. I mean
Code:

cannot change root directory to :
If CLFS variable was correctly set, you should get a message like:
Code:

cannot change root directory to /mnt/clfs: ...
To be sure, before running your "chroot" command, try a:
Code:

echo "CLFS variable set to: ${CLFS}"
Kind regards,

Oliv'

grumpy.biatch 12-28-2010 09:17 AM

Quote:

Originally Posted by Oliv' (Post 4205352)
I thought that because of your error. I mean
Code:

cannot change root directory to :
If CLFS variable was correctly set, you should get a message like:
Code:

cannot change root directory to /mnt/clfs: ...
To be sure, before running your "chroot" command, try a:
Code:

echo "CLFS variable set to: ${CLFS}"
Kind regards,

Oliv'

Been there done that -

Code:

clfs:~$ echo "CLFS variable set to: ${CLFS}"
CLFS variable set to: /mnt/clfs

And this is what I get now
Code:

clfs:/mnt/clfs$ chroot "${CLFS}" /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: cannot change root directory to /mnt/clfs: Operation not permitted

Later I opened another console and did this -

Code:

linux-taup:~ # export CLFS=/mnt/clfs
linux-taup:~ # echo ${CLFS}
/mnt/clfs
linux-taup:~ # chroot "${CLFS}" /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!:/#

Thanks Oliv'

Oliv' 12-28-2010 10:55 AM

In the first case, it failed because you need root permissions to do a chroot.
Well anyway, now it works, so have fun with your clfs installation ;)

Oliv'


All times are GMT -5. The time now is 05:01 PM.