Linux From Scratch on Ubuntu Part 3 - Step By Step

Posted by Michael Thu, 25 Jan 2007 09:35:49 GMT

Okay so the build in Linux From Scratch on Ubuntu Part 2 was simple enough, now all that’s left is a bootloader and a reboot.

Make sure your LFS environment variable is set and mount the running dev filesystem into your LFS build:

sudo mkdir -pv $LFS/{dev,proc,sys}
sudo mount --bind /dev $LFS/dev
sudo mount -vt devpts devpts $LFS/dev/pts
sudo mount -vt tmpfs shm $LFS/dev/shm
sudo mount -vt proc proc $LFS/proc
sudo mount -vt sysfs sysfs $LFS/sys

Now we’ll chroot into the new system:

sudo 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

and set a root password:

passwd root

The following COULD overwrite your current bootloader, so you MIGHT WANT TO READ THE LFS BOOK FIRST!

grub 
root(hd0,0)
setup (hd0)
quit

Then create your grub.conf:

cat > /boot/grub/menu.lst << "EOF" 
# Begin /boot/grub/menu.lst
# By default boot the first menu entry.
default 0
# Allow 30 seconds before booting the default.
timeout 30
# Use prettier colors.
color green/black light-green/black
# The first entry is for LFS.
title LFS 6.2
root (hd0,0)
kernel /boot/lfskernel-2.6.16.27 root=/dev/hda1
EOF

a little standards compliance:

mkdir -v /etc/grub &&
ln -sv /boot/grub/menu.lst /etc/grub

echo 6.2 > /etc/lfs-release

then we’ll reboot:

logout
sudo umount -v $LFS/dev/pts
sudo umount -v $LFS/dev/shm
sudo umount -v $LFS/dev
sudo umount -v $LFS/proc
sudo umount -v $LFS/sys
sudo umount -v $LFS

shutdown -r now

Now, since we created a separate disk for this, simply make the IDE disk the first in the boot order and boot it up. If you did exactly what I did, with the same hardware setup, this should work for you as easily as it did me.

Have fun! Oh and did I mention to READ THE LFS BOOK before you email me questions at mike@imapenguin.com?

In Part 4 we’ll talk about where to go from here.

Posted in , ,  | no comments | no trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
http://weblog.imapenguin.com/trackbacks?article_id=linux-from-scratch-on-ubuntu-part-3-step-by-step&day=25&month=01&year=2007

Comments are disabled