Installing basic system software

The installation of all the software is pretty straightforward and you'll think it's so much easier and shorter to give the generic installation instructions for each package and only explain how to install something if a certain package requires an alternate installation method. Although I agree with you on this aspect, I, however, choose to give the full instructions for each and every package. This is simply to avoid any possible confusion and errors. Before you continue with this document you have to restart your system and boot into the LFS system. But before you do that, you need to determine which partition is used as your swap partition. This information can usually be found in the /etc/fstab file. Check this file for a line similar to this one: /dev/hda6 none swap sw 0 0 A different variation is a line simlar to this one: /dev/hda6 swap swap defaults 0 0

The 4th field in a line must contain 'sw'. Or the 2nd and/or 3rd field in a line must contain 'swap'. Keep in mind that there are more variantions possible, though it shouldn't be hard to recognize which line represents a swap partition (because it either contains 'sw' or 'swap' in it). All you need to remember is it's designation (which is /dev/hda6 in my case but this will probably be different on your system). When you have determined which partition is the swap partition, you can reboot your computer now and continue from here.

After you have rebooted you need to run /sbin/hwclock if you're on a PPC system before you execute anything else.

Remounting partition and activating swap

Before the software can be installed we need to remount the partition in read-write mode. Also, we need to activate the swap partition so that we won't risk running out of memory during large compilation processes (such as compiling gcc):


mount -n -o remount,rw / /
/sbin/swapon <swap device>

Replace <swap device> with the designation that you have determined before you rebooted the system (which is /dev/hda6 in my case).

Installing GCC


mkdir /usr/src/gcc-build
cd /usr/src/gcc-build
../gcc-2.95.2/configure --with-gxx-include-dir=/usr/include/g++ \
        --enable-shared --enable-languages==c,c++
make bootstrap
make install

Installing Bison


./configure --datadir=/usr/share/bison
make
make install

Installing Mawk


./configure
make
make install
cd /usr/bin
ln -s mawk awk

Installing Findutils


./configure
make
make install

This package is known to cause compilation problems. If you're having trouble compiling this package as well, you can download a fixed package from http://www.linuxfromscratch.org/download/findutils-4.1-fixed.tar.gz

Installing Termcap


./configure
make
make install

Installing Ncurses


./configure --with-shared
make
make install

Installing Less


./configure
make
make install
mv /usr/bin/less /bin

Installing Perl


./Configure
make
make install

Note that we skip the make test step. This is because at the moment the system isn't ready yet for running the perl test suite. So we'll trust that perl compiled properly. If you want to be 100% sure, you have to reinstall Perl youself using the above instructions after you have created the bootscripts and have rebooted the system.

Installing M4


./configure
make
make install

Installing M4


./configure
make
make install

Installing Texinfo


./configure
make
make install

Installing Autoconf


./configure
make
make install

Installing Automakme


./configure
make install

Installing Bash


./configure
make
make install
mv /usr/bin/bash /bin

Installing Flex


./configure
make
make install

Installing Binutils


./configure
make
make install

Installing Bzip2


make
make install
cd /usr/bin
mv bunzip2 bzip2 /bin

Installing Diffuitls


./configure
make
make install

Installing E2fsprogs


./configure
make
make install
mv /usr/sbin/mklost+found /sbin

Installing File


./configure
make
make install

Installing Fileutils


./configure
make
make install
cd /usr/bin
mv chgrp chmod chown cp dd df ln /bin
mv ls mkdir mknod mv rm rmdir sync /bin

Installing Grep


./configure
make
make install

Installing Groff


./configure
make
make install

Installing Gzip


./configure
make
make install
cd /usr/bin
mv *z /bin

Installing Ld.so


cd util
make ldd ldconfig
cp ldd /bin
cp ldconfig /sbin
rm /usr/bin/ldd

Installing Libtool


./configure
make
make install

Installing Linux86


cd as
make
make install
cd ../ld
make ld86
make install

Installing Lilo


make
make install

Installing Make


./configure
make
make install

Installing Shell Utils


./configure
make
make install
cd /usr/bin
mv date echo false pwd stty /bin
mv su true uname hostname /bin

Installing Shadow Password Suite


./configure
make
make install
cd etc
cp limits login.access login.defs.linux shells suauth /etc
mv /etc/login.defs.linux /etc/login.defs
cd /usr/bin
mv chpasswd dpasswd groupadd groupdel groupmod logoutd /sbin
mv mkpasswd newusers useradd userdel usermod grpchk /sbin
mv pwck vipw grpconv grpunconv pwconv pwunconv /sbin

Installing Man


./configure -default
make
make install

Installing Modutils


./configure -default
make
make install

Installing Procinfo


make
make install

Installing Procps


gcc -O3 -Wall -Wno-unused -c watch.c
make
make -e XSCPT="" install
mv /usr/bin/kill /bin

Installing Psmisc


make
make install

Installing Sed


./configure
make
make install
mv /usr/bin/sed /bin

Installing Start-stop-daemon


make start-stop-daemon
cp start-stop-daemon /sbin
cp start-stop-daemon.8 /usr/share/man/man8

Installing Sysklogd


make
make install

Installing Sysvinit


cd src
make
make install

Installing Tar


./configure
make
make install
mv /usr/bin/tar /bin

Installing Textutils


./configure
make
make install
mv /usr/bin/cat /bin

Installing Vim


./configure
make
make install
cd /usr/bin
ln -s vim vi

Installing Util-Linux


HAVE_PASSWD=yes
HAVE_SLN=yes
HAVE_TSORT=yes


groupadd -g 5 tty
./configure
make
make install


#!/bin/sh
# Begin /sbin/hwclock

/sbin/clock -s

# End /sbin/hwclock


chmod 755 hwclock
mv hwclock /sbin