Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using lfs live cd for building CLFS Version SVN-20100828-x86_64-Multilib. I was able to build till 10.4.1. Installation of Perl and had to quit due to few errors or possible mistakes on my part.
I wish to the chroot and start over. How do I find out what went wrong and rectify it. I am a BSD user and this is bit trivial for me.
Should I just mount the partition, 'export CLFS=/mnt/clfs' and chroot or I need to do something else.
Best,
Dave
Last edited by grumpy.biatch; 12-30-2010 at 08:35 PM.
Just from memory, here is what you need to do (as root):
Code:
mount /dev/sda1 /mnt/clfs
mount -t proc none /mnt/clfs/proc
mount -o bind /dev /mnt/clfs/dev
chroot /mnt/clfs
So I have assumed that you just have one partition... maybe you will also need to mount boot, usr or another partition.
Another point: I am not sure if that step is mandatory, but you may have to do a "mount -o bind /dev/pts /mnt/clfs/dev/pts". But you will quickly know if that step is mandatory as it may complain about a missing pty or something like that during the chroot step if that's really mandatory.
Just from memory, here is what you need to do (as root):
Code:
mount /dev/sda1 /mnt/clfs
mount -t proc none /mnt/clfs/proc
mount -o bind /dev /mnt/clfs/dev
chroot /mnt/clfs
So I have assumed that you just have one partition... maybe you will also need to mount boot, usr or another partition.
Another point: I am not sure if that step is mandatory, but you may have to do a "mount -o bind /dev/pts /mnt/clfs/dev/pts". But you will quickly know if that step is mandatory as it may complain about a missing pty or something like that during the chroot step if that's really mandatory.
Regards,
Oliv'
Hi Oliv',
Thanks a bunch. I have '/' and everything is in it.
Let me sum this up -
Code:
mount /dev/sdc2 /mnt/clfs
export CLFS=/mnt/clfs
mkdir -pv ${CLFS}
echo ${CLFS}
mount -v /dev/sdc2 ${CLFS}
mount -t proc none /mnt/clfs/proc
mount -o bind /dev /mnt/clfs/dev
mount -o bind /dev/pts /mnt/clfs/dev/pts (uncertain)
chroot "${CLFS}" /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
Let me know if this is right or I am messing it up.
Your first mount is useless... and may fail if /mnt/clfs does not exist as you do the mkdir after
And the mount /dev/pts is also probably useless. In fact, after thinking a bit about that, it would be useful only if use something like 'bin/login' instead of '/bin/bash' when running your chroot command.
Else it seems perfect
Your first mount is useless... and may fail if /mnt/clfs does not exist as you do the mkdir after
And the mount /dev/pts is also probably useless. In fact, after thinking a bit about that, it would be useful only if use something like 'bin/login' instead of '/bin/bash' when running your chroot command.
Else it seems perfect
Best regards,
Oliv'
I will be using live cd so I need to create a directory and a mount point. Please let me know if this is correct-
this setup seems perfect... about your "doubtful" line, I also find it quite strange as to my knowledge a typical mount command is: "mount [option] device mount-point". But there might have evolution that I am not aware
Anyway, I think that you will quickly see if that command fails or not.
I applied mind to this during GCC test suit build and this is according to me should work -
Code:
1. Boot from LiveCD
2. Mount clfs partition
export CLFS=/mnt/clfs
mkdir -pv $CLFS
mount /dev/sdc2 $CLFS
3. swapon /dev/sda5
4. Mount the virtual kernel filesystems
mount -vt proc proc $CLFS/proc
mount -vt sysfs sysfs $CLFS/sys
5. Entering the chroot environment
chroot "$CLFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login
6. Populating /dev
mount -nvt tmpfs none /dev/sbin/udevstart (this is doubtful)
mkdir -v /dev/pts
mkdir -v /dev/shm
mount -vt devpts -o gid=4,mode=620 none /dev/pts
mount -vt tmpfs none /dev/shm
7. Entering working directory
cd /sources
Hi,
I haven't build CLFS yet, however, I think you should switch order of point 5. and 6., i.e.
do all the mounting before you chroot. There should also be no need to create directories like /dev/pts when you re-chroot. I am also not sure if
Code:
mount -nvt tmpfs none /dev/sbin/udevstart (this is doubtful)
is really necessary.
So here is what I would do:
Code:
1. Boot from LiveCD
2. swapon /dev/sda5
3. Mount clfs partition
export CLFS=/mnt/clfs
mkdir -pv $CLFS
mount /dev/sdc2 $CLFS
4. Mount the virtual kernel filesystems
mount -vt proc proc $CLFS/proc
mount -vt sysfs sysfs $CLFS/sys
5. Populating /dev
mount -vt devpts -o gid=4,mode=620 none $CLFS/dev/pts
mount -vt tmpfs none $CLFS/dev/shm
6. Entering the chroot environment
chroot "$CLFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login
7. Entering working directory
cd /sources
It is basically the same procedure as for 'normal' LFS.
I haven't build CLFS yet, however, I think you should switch order of point 5. and 6., i.e.
do all the mounting before you chroot. There should also be no need to create directories like /dev/pts when you re-chroot. I am also not sure if
Code:
mount -nvt tmpfs none /dev/sbin/udevstart (this is doubtful)
is really necessary.
I've not yet installed udev and in my opinion
Quote:
mount -nvt tmpfs none /dev/sbin/udevstart
is not necessary, trying wont hurt; it may return an error at most.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.