LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-07-2003, 02:43 PM   #1
kRu_ZaDeR
LQ Newbie
 
Registered: Jan 2003
Posts: 7

Rep: Reputation: 0
Question Getting in and out and in again in the CHROOT environment?




Hello,

I only have time to do my LFS during the evenings. I shut my computer down during the day when I am at work. Is there a proper way to go in and out of the CHROOT environment to continue building LFS?

Any suggestions appreciated. A step-by-step procedure would gladly be better. Thanks.
 
Old 01-07-2003, 03:05 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,537

Rep: Reputation: 149Reputation: 149
You can mount your / somewhere and chroot to it OR chroot on one console and have another to make all the changes.
 
Old 01-07-2003, 08:15 PM   #3
kRu_ZaDeR
LQ Newbie
 
Registered: Jan 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Re: CHROOT

Fine. So it's really as simple as mounting my workspace and CHROOT'ing into it. If that's all there is to it then it's all fine. What I was worried about was all that crap you had to type in the first time you CHROOT into it i.e.:

"CHROOT & LFS /static/bin/env -i ...yadiyadiyada.. and all the geekf*** whooya"

If I don't have to do that everytime I go in, then all is well I guess...

Appreciate your suggestion. I'll try that.
 
Old 01-08-2003, 02:50 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Well it depends on what stage of the book you are in. You will probably need the chroot command with all the extra's in it until you've finished building bash in the chroot environment. And you will probably also need to mount the proc filesystem everytime.
After you've built bash you could probably enter the chroot with an easier command. That is if you've set everything up already so your environment gets set up properly especially things like your PATH. It doesn't hurt to still chroot into it in the same way though so it might be the easiest if you create a simple scripts which might include things like:

mounting lfs partitions
setting $LFS
chroot into lfs

You will still need to mount the proc filesystem after that.
 
Old 01-08-2003, 12:25 PM   #5
kRu_ZaDeR
LQ Newbie
 
Registered: Jan 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Re: Chroot... (Mik)

Thanks Mik for a more detailed suggestion. I'm just curious about mounting the proc(?) filesystem or whatever, cause I am about almost done completing the static environment. I believe I have gone in and out about 3 to 4 times now with just mounting the lfs, exporting LFS=/mnt/lfs, then chrooting into it. But I never mount the proc filesystem as you suggest. I haven't had any problems so far! Just wondering what problems I may encounter ahead just because I forgot to do this? Could I have just wasted 10 hours of my life for nothing...
 
Old 01-08-2003, 01:52 PM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
Well I'm not sure exactly which programs need it. It's just it says in the LFS book "You have to make sure all the commands in the rest of this chapter and in the following chapters are run from within the chroot environment. If you ever leave this environment for any reason (rebooting for example), you must remember to again enter chroot and mount proc (discussed later) before continuing with the installations."
It doesn't mention in the book which programs need it. All it says it's needed for some programs to function properly.

Oh I just read your post again and you mentioned almost done with the static part. You only need the proc filesystem mounted in the chroot after the static part is completed (beginning of chapter 6). I guess I got confused because you where mentioning doing a chroot to the lfs partition which is only done after the static part is done.

Last edited by Mik; 01-08-2003 at 01:56 PM.
 
Old 01-08-2003, 09:34 PM   #7
kRu_ZaDeR
LQ Newbie
 
Registered: Jan 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Well, you know I may have made a mistake in saying I was still in the static environment cause I think I am done with that. I am already at the point where you CHROOT into the static env. and almost 3/4th of the way through. Sorry if I had a brain fart. So far no major problems and I followed your suggestion of mounting /proc at the half-way point. I'll let you know if it will have an adverse effect when I am done with it (i.e. not mounting proc the first 3 or 4 times). At any rate you have been a big help and I appreciate all your suggestions. Thanks much!
 
Old 01-10-2003, 04:55 PM   #8
newpenguin
Member
 
Registered: Sep 2002
Location: lahore pakistan
Distribution: slackware,redhat, FreeBSD,openbsd
Posts: 219

Rep: Reputation: 30
copy the text from lfs book .
and in gnome terminal paste it .
 
Old 01-13-2003, 12:20 AM   #9
kRu_ZaDeR
LQ Newbie
 
Registered: Jan 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Red face

I believe we can close this thread now. I have completed the base LFS4 without any problems so far. I am currently on the first parts of the BLFS book (firewall). No problems so far with my system. Thanks to Mik and all the others who gave suggestions in this thread. Chow, all !
 
  


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
getting started in chroot environment Mystified Linux From Scratch 3 03-28-2005 09:11 AM
mount in chroot environment not possible moskito01 Suse/Novell 5 12-06-2004 04:06 PM
Apache in a chroot environment tarballedtux Linux - Software 1 04-13-2004 07:37 PM
accessing /proc from within chroot environment JustinHoMi Linux - Security 7 06-06-2003 03:48 PM
Out of the chroot environment? R2RO Linux - Networking 0 05-14-2003 04:01 PM


All times are GMT -5. The time now is 10:04 PM.

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