LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 12-27-2010, 11:05 PM   #1
grumpy.biatch
Member
 
Registered: Jun 2010
Posts: 48

Rep: Reputation: 0
Lightbulb 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.

Last edited by grumpy.biatch; 12-27-2010 at 11:09 PM.
 
Old 12-28-2010, 03:33 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

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

Regards,

Oliv'
 
Old 12-28-2010, 06:57 AM   #3
grumpy.biatch
Member
 
Registered: Jun 2010
Posts: 48

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Oliv' View Post
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.
 
Old 12-28-2010, 07:12 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Quote:
Originally Posted by grumpy.biatch View Post
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'
 
Old 12-28-2010, 09:17 AM   #5
grumpy.biatch
Member
 
Registered: Jun 2010
Posts: 48

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Oliv' View Post
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'

Last edited by grumpy.biatch; 12-28-2010 at 09:38 AM.
 
Old 12-28-2010, 10:55 AM   #6
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
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'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chown clfs:clfs mishap Louis_Carole Linux From Scratch 4 03-21-2007 07:40 PM
Knoppix - Remastering - unable to chroot mikedeatworld Linux - Newbie 1 10-29-2006 09:45 PM
Unable to chroot mikedeatworld Linux - Newbie 5 10-25-2006 06:50 AM
Unable to mount on chroot /mnt/sysimage NickNihal Linux - Hardware 2 09-05-2006 04:07 AM
Unable to get shell when using SSH/CHROOT/PAM_TACPLUS slug420 Linux - Security 0 11-16-2004 09:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration