LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-10-2005, 11:34 PM   #1
iam whoiam
LQ Newbie
 
Registered: Jul 2004
Posts: 26

Rep: Reputation: 15
what steps to follow when reentering chroot


Ok, so I stopped halfway in chapter 6 and shutdown the system. What steps are necessary when reentering the chroot environment? I'm paranoid that if i make a wrong move i might have to do the whole thing again...... Thanks in advance!
 
Old 02-11-2005, 12:06 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Basically everything non-permanent you did to initialize it - the mount commands and chroot itself - should cover it.
Code:
mount -t proc proc $LFS/proc
mount -t sysfs sysfs $LFS/sys

mount -f -t ramfs ramfs $LFS/dev
mount -f -t tmpfs tmpfs $LFS/dev/shm
mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts

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 +h

mount -n -t ramfs none /dev
mount -t devpts -o gid=4,mode=620 none /dev/pts
mount -t tmpfs none /dev/shm
Or you could try searching for an LFS chroot script of sorts - seems like somebody made a couple of those. Not sure, though.

If you don't have or don't use $LFS, then adjust or reset as necessary.
 
Old 02-11-2005, 05:22 AM   #3
iam whoiam
LQ Newbie
 
Registered: Jul 2004
Posts: 26

Original Poster
Rep: Reputation: 15
thought so too, just wondering whether there was something that i might have overlooked that was important. I did the mount commands and checked some of the symlinks to see whether they were still there. The /dev symlinks seem to be missing... so i redid them. Like i said i am paranoid...... Thanks!
 
Old 02-13-2005, 09:12 AM   #4
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Yea, that was close...

Code:
mount -t proc proc /mnt/lfs/proc
mount -t sysfs sysfs /mnt/lfs/sys
mount -f -t ramfs ramfs /mnt/lfs/dev
mount -f -t tmpfs tmpfs /mnt/lfs/dev/shm
mount -f -t devpts -o gid=4,mode=620 devpts /mnt/lfs/dev/pts

chroot /mnt/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 +h

mount -n -t ramfs none /dev
/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 -t devpts -o gid=4,mode=620 none /dev/pts
mount -t tmpfs none /dev/shm
I ditched the LFS ~/.bashrc and ~/.bash_profile files as soon as I could so I could get my host terminal back to normal. Thats why I switched to absolute paths....

Last edited by jong357; 02-13-2005 at 09:15 AM.
 
  


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
first steps a new admin must follow ddaas Linux - Newbie 3 12-21-2004 04:53 PM
first steps a new admin must follow ddaas Linux - General 3 12-21-2004 10:26 AM
Follow the link alaios Linux - General 1 07-03-2004 07:13 PM
Problem reentering "X" ronnik Red Hat 1 05-23-2004 09:58 PM
follow up from before... juagut Linux - Newbie 2 04-13-2001 11:34 AM

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

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration