LinuxQuestions.org
Visit Jeremy's Blog.
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 05-31-2005, 01:07 PM   #1
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Rep: Reputation: 30
can't chroot back into LFS after install


I want to chroot back in to LFS from slackware 10, and install BLFS software. (via cutting and pasting code instead of manually typing it to be error free.)

When I do:
Code:
chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login
it says:"chroot: cannot change root directory to : No such file or directory"

Does anyone know what to do?
Or, know of another way to install BLFS software error free?
 
Old 05-31-2005, 01:10 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 65
Looks to me like your $LFS variable is set to "" ie: it has no value.
Try "LFS=/path/to/lfs" and try your chroot command again...
 
Old 05-31-2005, 06:28 PM   #3
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Original Poster
Rep: Reputation: 30
Thanks, I understand the error now I think that means I can do:

Code:
export LFS=/mnt/lfs
to fix the problem like in "LFS, Chapter 4. Final Preparations".
And then mount it, right?
 
Old 05-31-2005, 06:31 PM   #4
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
Quote:
Originally posted by shotokan
Thanks, I understand the error now I think that means I can do:

Code:
export LFS=/mnt/lfs
to fix the problem like in "LFS, Chapter 4. Final Preparations".
And then mount it, right?
That's correct.
 
Old 05-31-2005, 08:41 PM   #5
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Original Poster
Rep: Reputation: 30
Ok, I looked the book over again and I think these are the commands I'm going to need to do to have every thing working as if I booted in LFS.

Code:
export LFS=/mnt/lfs
mount /dev/[xxx] $LFS
mount -t proc proc $LFS/proc
mount -t sysfs sysfs $LFS/sys
chroot "$LFS" /usr/bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login
login then:

Code:
/tools/sbin/udevstart
ln -s /proc/self/fd /dev/fd
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/1 /dev/stdout
ln -s /proc/self/fd/2 /dev/stderr
ln -s /proc/kcore /dev/core
mkdir /dev/pts
mkdir /dev/shm
mount -n -t ramfs none /dev
mount -t devpts -o gid=4,mode=620 none /dev/pts
mount -t tmpfs none /dev/shm
Is all this neccesary?
 
Old 06-01-2005, 12:56 AM   #6
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Yes, it is necessary, but there is a shell script in the udev source tarball that does the udev setup for you. Find a file named start_udev and install it to $LFS/sbin. Then you can run that script instead of the commands listed after chroot.
 
Old 06-01-2005, 10:53 AM   #7
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Original Poster
Rep: Reputation: 30
Thanks, all I do is copy it to sbin right? (to install it)

Also, will it cause problems when actually booting LFS at startup? (Will it conflict with the bootscripts?)
 
Old 06-01-2005, 11:40 AM   #8
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Quote:
Thanks, all I do is copy it to sbin right? (to install it)
Copy and set ownership and permissions.

Quote:
Also, will it cause problems when actually booting LFS at startup? (Will it conflict with the bootscripts?)
It shouldn't cause any problems. In fact you don't need it anymore when your system is bootable, so you can remove it then.
 
Old 06-01-2005, 03:09 PM   #9
shotokan
Member
 
Registered: Mar 2005
Distribution: slackware, LFS
Posts: 204

Original Poster
Rep: Reputation: 30
Quote:
It shouldn't cause any problems. In fact you don't need it anymore when your system is bootable, so you can remove it then.
It's already bootable.

This is to make it so I can use Slackware 10 to do things my LFS can't currently do namely copy, and paste code. (to install blfs programs)

Also, does the start_udev script use udevstart like S10udev does? (as mentioned in "Linux From Scratch - Version 6.0 Chapter 7. Setting Up System Bootscripts")

If not, should I use S10udev, and if so where do I find it in LFS?
(assuming it's installed like the book says)
 
  


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 03:12 AM
LFS Book Chapter 6 - 1st step (chroot to /mnt/lfs) doens't work bauld Linux From Scratch 11 03-15-2006 12:31 AM
hoe to back up the full lfs system : i got an error Vijiram Linux From Scratch 4 11-03-2004 11:23 AM
chroot problem in LFS shahzadiub Linux From Scratch 4 07-21-2004 11:48 AM
chroot in lfs shahzadiub Linux - Newbie 5 06-23-2004 12:08 PM


All times are GMT -5. The time now is 07:17 AM.

Main Menu
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