LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-20-2010, 10:45 AM   #1
mrwall-e
Member
 
Registered: Jul 2010
Distribution: Arch Linux, Xubuntu, Gentoo
Posts: 44

Rep: Reputation: 0
Can't chroot


I get the error /tools/bin/env: command not found, though I cd'ed into /tools/bin which contains a file "env". Why doesn't this work? The error is slightly different than others I've seen, so I hope I don't have to start over.
 
Old 07-20-2010, 06:44 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Your question seems to be lacking a little context but for some basic responses .. is the file executable ? .. also it probably won't be in your PATH so you'll need to run it as './env' or '/tools/bin/env'
 
Old 07-20-2010, 08:07 PM   #3
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
What is /tools/bin/env linked to?
Code:
ldd /tools/bin/env
If it's linked to anything that isn't in /tools then it won't work in chroot.
 
Old 07-20-2010, 08:40 PM   #4
mrwall-e
Member
 
Registered: Jul 2010
Distribution: Arch Linux, Xubuntu, Gentoo
Posts: 44

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kbp View Post
Your question seems to be lacking a little context but for some basic responses .. is the file executable ? .. also it probably won't be in your PATH so you'll need to run it as './env' or '/tools/bin/env'
thanks so much for replying...

sorry, but by making it executable, you mean chmod 755, correct? here is the page in the lfs book: http://www.linuxfromscratch.org/lfs/...06/chroot.html and what exactly did you mean by "won't be in your PATH"? sorry, just not sure what you mean...

Last edited by mrwall-e; 07-20-2010 at 08:42 PM.
 
Old 07-20-2010, 09:10 PM   #5
mrwall-e
Member
 
Registered: Jul 2010
Distribution: Arch Linux, Xubuntu, Gentoo
Posts: 44

Original Poster
Rep: Reputation: 0
Oh and btw I'm really sorry about a horrible first post, I was in a rush when I posted it. Thanks so much for your patience.


Quote:
Originally Posted by Andrew Benton View Post
What is /tools/bin/env linked to?
Code:
ldd /tools/bin/env
If it's linked to anything that isn't in /tools then it won't work in chroot.
This command returns: /usr/bin/ldd: line 226: /tools/bin/env: No such file or directory

Last edited by mrwall-e; 07-20-2010 at 09:26 PM.
 
Old 07-21-2010, 03:05 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

As which user are you doing this? Chapter 5 needs to be done as user lfs and chapter 6 as user root.

What's the output of the following commands:

ls -l /tools/bin/{e,ho}*
echo $LFS

The env command is part of the coreutils package (5.17. Coreutils-8.4). If anything went wrong in that chapter, more commands are not correct (try /tools/bin/hostname and /tools/bin/echo "X" and see if those commands work).

Hope this helps.
 
Old 07-21-2010, 07:51 AM   #7
mrwall-e
Member
 
Registered: Jul 2010
Distribution: Arch Linux, Xubuntu, Gentoo
Posts: 44

Original Poster
Rep: Reputation: 0
Thanks so much for replying, I did all of Chapter 5 as user "lfs", created at the beginning, and all of Chapter 6 as root. Here is the output of those commands:

-rwxr-xr-x 1 root root 18708 Jul 20 10:40 /tools/bin/echo
-rwxr-xr-x 1 root root 72140 Jul 20 10:40 /tools/bin/egrep
-rwxr-xr-x 1 root root 18056 Jul 20 10:40 /tools/bin/env
-rwxr-xr-x 1 root root 20512 Jul 20 10:40 /tools/bin/expand
-rwxr-xr-x 1 root root 132312 Jul 20 10:40 /tools/bin/expect
-rwxr-xr-x 1 root root 27316 Jul 20 10:40 /tools/bin/expr
-rwxr-xr-x 1 root root 16416 Jul 20 10:40 /tools/bin/hostid
-rwxr-xr-x 1 root root 16968 Jul 20 10:40 /tools/bin/hostname



/mnt/lfs

Quote:
(try /tools/bin/hostname and /tools/bin/echo "X" and see if those commands work)
Neither of those last two commands work.

Last edited by mrwall-e; 07-21-2010 at 08:24 AM.
 
Old 07-21-2010, 10:34 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If all three commands you tried (env, hostname and echo) failed then something must have gone wrong in chapter 5, probably the coreutils chapter.

You are still in the early stage of chapter 6 so a re-visit to chapter 5 must still be possible. Redo all the steps in chapter 5.17. Coreutils-8.4 (mind you: as user lfs!!).

I don't think any of the later packages need to be redone (the hostname part for perl is only for testing).

Hopefully this solves your problem.
 
  


Reply

Tags
chroot, lfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] in chroot compiled programs do not work in chroot graphit Linux From Scratch 2 04-11-2010 04:04 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 07:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 11:30 AM
SW 11 > can not chroot salmonix Slackware 2 12-14-2006 04:03 PM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 04:57 AM

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

All times are GMT -5. The time now is 10:39 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