LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-20-2004, 09:19 AM   #1
shahzadiub
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Rep: Reputation: 0
chroot in lfs


when i issue the command

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



followng message s dsplayed


/tools/bin/env: /tools/bn/bash:no such drectory or fle



but 'bash' and 'env' are present in the given path.


please tell me what's the problem
 
Old 06-20-2004, 12:33 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
assuming the $LFS partition is mounted and the link /tools is right and basic stuff like that

try
not in chroot

readelf -l /tools/bin/env | grep interpreter

The response should read:

Requesting program interpreter: /tools/lib/ld-linux.so.2

If it doesn't, it means your glibc locking in stage didn't
get done correctly, and your software is still linking against stuff on
the host.

or you used a wrong patch or something and the path got messed up ??
 
Old 06-21-2004, 02:55 AM   #3
shahzadiub
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Original Poster
Rep: Reputation: 0
i applied your command and the response was


Requesting program interpreter: /tools/lib/ld-linux.so.2


which according to you is correct.

please tell me what else might be the problem.
 
Old 06-22-2004, 08:08 AM   #4
shahzadiub
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Original Poster
Rep: Reputation: 0
now when i applied the command

chroot $LFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin


it worked fine.

then i applied the command

/tools/bin/bash --login

it also worked fine.

But when i applied the command

chroot $LFS /tools/bin/bash

following error was displayed
/tools/bin/bash:no such file or directory


when i apllied follwing command

chroot $LFS

follwing message was displayed

/bin/bash:nosuch file or directory

please tell me what's causing the problemwhen evrything is placed in right path.
 
Old 06-23-2004, 02:11 AM   #5
shahzadiub
LQ Newbie
 
Registered: Apr 2004
Posts: 8

Original Poster
Rep: Reputation: 0
today i applied some more commands such as


chroot /mnt/lfs /tools/bin/cc

and they worked.

but for some commands following message was displayed


chroot:/mnt/lfs/command:no such file or diretory.


please tell me why some commands are working and some or not.

should i recompile LFS to overcome this problem.

please help as i'm stuck on chroot problem in LFS for 4 days now
 
Old 06-23-2004, 01:08 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
perhaps i'm missing something but when you go to work on your new system
from within the soon to become old one
just become root
mount the lfs partition
then:
export LFS=/mnt/lfs

chroot $LFS /usr/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login

and you are done with the
chroot command.
don't use it anymore
just use the prompt you get there to
do your work as if you are logged onto your new
operating system
(you are actually)

once you get inside the chroot environment
root for your lfs filesystem is no longer
/mnt/lfs
that's now a part of the other operating systems filesystem
in your chroot environment root is /
so you have /tools now
not /mnt/lfs/tools
and $LFS no longer exists

does that make sense ???
 
  


Reply


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
LFS 6 Chapter 6.3 chroot error gatblast45 Linux From Scratch 8 01-01-2008 04:12 AM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 01:31 AM
LFS-7.0-cross-lfs-20050902-x86_64-Multilib Basel Linux From Scratch 0 09-03-2005 06:03 AM
can't chroot back into LFS after install shotokan Linux From Scratch 8 06-01-2005 04:09 PM
chroot problem in LFS shahzadiub Linux From Scratch 4 07-21-2004 12:48 PM


All times are GMT -5. The time now is 06:00 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration