LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   can't chroot back into LFS after install (https://www.linuxquestions.org/questions/linux-from-scratch-13/cant-chroot-back-into-lfs-after-install-328936/)

shotokan 05-31-2005 01:07 PM

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?

bulliver 05-31-2005 01:10 PM

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

shotokan 05-31-2005 06:28 PM

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?

kjordan 05-31-2005 06:31 PM

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.

shotokan 05-31-2005 08:41 PM

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?

Harmaa Kettu 06-01-2005 12:56 AM

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.

shotokan 06-01-2005 10:53 AM

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?)

Harmaa Kettu 06-01-2005 11:40 AM

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.

shotokan 06-01-2005 03:09 PM

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)


All times are GMT -5. The time now is 11:25 AM.