Next Previous Contents

9. Installing basic system software

In this chapter we will install all the software that belongs to a basic Linux system. After you're done with this chapter you have a fully working Linux system. The remaining chapters deals with optional issues such as setting up networking, internet servers + clients (telnet, ftp, http, email), setting up Internet itself and the X Window System. You can skip chapters at your own discretion. If you don't plan on going online with the LFS system there's little use to install the ppp daemon to give an example.

There are a number of packages that need to be linked statically before we can start installing all the basic system software. A typical configure scripts needs programs like rm, grep, sed, mv, cat, cp, diff. You need to be able to ungzip and untar archives, you need to link programs after you have compiled the objects files. All these (and a few more) programs needs to be available before we can install anything else. During the installatin of the basic system software set, we will re-install the statically linked software so that they are linked dynamically against the C library on the LFS system.

9.1 Preparing LFS system for installing basic system software

Installing Binutils

./configure
make LDFLAGS=-all-static
cp gas/as-new $LFS/usr/bin/as
cp gas/gasp-new $LFS/usr/bin/gasp
cp ld/ld-new $LFS/usr/bin/ld
cd binutils
cp addr2line ar c++filt nm-new objcopy objdump ranlib size strings strip-new $LFS/usr/bin
mv $LFS/usr/bin/nm-new $LFS/usr/bin/nm
mv $LFS/usr/bin/strip-new $LFS/usr/bin/strip

Install Diffutils

./configure
make LDFLAGS=-static
cp cmp diff diff3 sdiff $LFS/usr/bin

This package is known to cause static linking problems on certain platforms. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/diffutils-2.7-lfs.tar.gz

Installing Fileutils

./configure
make LDFLAGS=-static
cd src
cp chgrp chmod chown cp dd  df dir dircolors du ginstall ln ls mkdir mkfifo mknod mv rm rmdir sync touch vdir $LFS/usr/bin
cd $LFS/bin
mv ginstall install
ln -s install ginstall

Installing grep

./configure
make LDFLAGS=-static
cd src
cp egrep fgrep grep $LFS/usr/bin

This package is known to cause static linking problems on certain platforms. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/grep-2.4-lfs.tar.gz

Installing gzip

./configure
make LDFLAGS=-static
cp gunzip gzip $LFS/bin

This package is known to cause compilation problems on all platforms we have access to. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/gzip-1.2.4-lfs.tar.gz

Installing Make

./configure
make LDFLAGS=-static
cp make $LFS/usr/bin

Installing Sed

./configure
make LDFLAGS=-static
cp sed/sed $LFS/usr/bin

This package is known to cause static linking problems on certain platforms. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/sed-3.02-lfs.tar.gz

Installing Sh-utils

./configure
make LDFLAGS=-static
cd src
cp basename chroot date dirname echo env expr factor false groups hostid hostname id logname nice nohup pathchk pinky printenv printf pwd seq sleep stty su tee test true tty uname uptime users who whoami yes $LFS/usr/bin

Installing Tar

./configure
make LDFLAGS=-static
cp src/tar $LFS/bin

Installing Textutils

./configure
make LDFLAGS=-static
cd src
cp cat cksum comm csplit cut expand fmt fold head join md5sum nl od paste pr ptx sort split sum tac tail tr tsort unexpand uniq wc $LFS/usr/bin

Installing Util-linux

./configure
cd lib;make
cd ../mount;make LDFLAGS=-static mount umount
cp mount umount $LFS/sbin

9.2 Reboot into LFS

Before we install the rest of the basic system software, you first have to reboot into the LFS system before continuing. Once you're rebooted and logged in, remount the root partition in read-write mode by running: /sbin/mount -n -o remount,rw / /

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.

Installing Bison

./configure --disable-nls
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 on all platforms we have access to. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/findutils-4.1-lfs.tar.gz

Installing Ncurses

./configure --with-shared
make; make install

Installing Less

./configure
make; make install

Installing Perl

./Configure
make; make install

Note that we skip the 'make test' step. This is because at this moment the system isn't ready yet for running the perl test. At this time we'll trust that perl compiled fine.

Installing M4

./configure
make; make install

Installing Texinfo

./configure
make; make install

Installing Autoconf

./configure
make; make install

Installing Automake

./configure
make install

Installing Bash

./configure
make; make install

Installing Flex

./configure
make; make install

Installing Binutils

./configure
make; make install

Installing Diffutils

./configure
make; make install

Installing E2fsprogs

./configure
make; make install

Installing File

./configure
make; make install

Installing Fileutils

./configure
make; make install
cd /usr/bin 
rm ginstall; ln -s install ginstall

Installing GCC

./configure
make LANGUAGES=c
make stage1
make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2" LANGUAGES=c
make stage2
make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" LANGUAGES=c
make compare
make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" LANGUAGES=c install

Installing Grep

./configure
make; make install

Installing Groff

./configure
make; make install

Installing Gzip

./configure
make; make install

This package is known to cause compilation problems on all platforms we have access to. If you're having trouble compiling this package as well, you can download a fixed package from http:/tts.ookhoi.dds.nl/lfs-howto/download/gzip-1.2.4-lfs.tar.gz

Installing Ld.so

cd util; make ldd ldconfig
cp ldd /bin; cp ldconfig /sbin

Installing Libtool

./configure
make; make install

Installing Linux86

cd as
make; make install
cd ../ld
make; make install

Installing Lilo

make; make install

Installing Make

./configure
make; make install

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

Installing Man-db

groupadd -g 1 man
useradd -u 1 -g man man
./configure
make; make install

Installing Modutils

./configure
make; make install

Installing Termcap

./configure
make; make install

Installing Procinfo

make; make install

Installing Procps

make; make XSCPT="" install

Installing Psmisc

make; make install

Installing Sed

./configure
make; make install

Installing Sh-utils

./configure
make; make install

Installing start-stop-daemon

cd scripts; make start-stop-daemon
cp start-stop-daemon /usr/sbin
cp start-stop-daemon.8 /usr/man/man8

Installing Sysklogd

make; make install

Installing Sysvinit

cd src
make; make install

Install Tar

./configure
make; make install

Installing Textutils

./configure
make; make install

Installing Util-linux

./configure
cd lib; make
cd clock; make; make install
cd ../disk-utils; make; make install
cd ../fdisk; make; make install
cd ../login-utils; make agetty
cp agetty /sbin; cp agetty.8 /usr/man/man8
cd ../mount; make; make install
cd ../sys-utils; make; make install
cd ../text-utils; make MOREHELPDIR=/usr/share/more
make MOREHELPDIR=/usr/share/mor install

Installing Vim

./configure
make; make install

Next Previous Contents