LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Getting in and out and in again in the CHROOT environment? (https://www.linuxquestions.org/questions/linux-from-scratch-13/getting-in-and-out-and-in-again-in-the-chroot-environment-40619/)

kRu_ZaDeR 01-07-2003 02:43 PM

Getting in and out and in again in the CHROOT environment?
 
:confused:

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.

Mara 01-07-2003 03:05 PM

You can mount your / somewhere and chroot to it OR chroot on one console and have another to make all the changes.

kRu_ZaDeR 01-07-2003 08:15 PM

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.

Mik 01-08-2003 02:50 AM

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.

kRu_ZaDeR 01-08-2003 12:25 PM

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... :(

Mik 01-08-2003 01:52 PM

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.

kRu_ZaDeR 01-08-2003 09:34 PM

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!

newpenguin 01-10-2003 04:55 PM

copy the text from lfs book .
and in gnome terminal paste it .:D

kRu_ZaDeR 01-13-2003 12:20 AM

:p 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 !


All times are GMT -5. The time now is 08:10 AM.