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.
./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
./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
./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
./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
./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
./configure make LDFLAGS=-static cp make $LFS/usr/bin
./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
./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
./configure make LDFLAGS=-static cp src/tar $LFS/bin
./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
./configure cd lib;make cd ../mount;make LDFLAGS=-static mount umount cp mount umount $LFS/sbin
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.
./configure --disable-nls make; make install
./configure make; make install cd /usr/bin; ln -s mawk awk
./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
./configure --with-shared make; make install
./configure make; make install
./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.
./configure make; make install
./configure make; make install
./configure make; make install
./configure make install
./configure make; make install
./configure make; make install
./configure make; make install
./configure make; make install
./configure make; make install
./configure make; make install
./configure make; make install cd /usr/bin rm ginstall; ln -s install ginstall
./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
./configure make; make install
./configure make; make install
./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
cd util; make ldd ldconfig cp ldd /bin; cp ldconfig /sbin
./configure make; make install
cd as make; make install cd ../ld make; make install
make; make install
./configure make; make install
./configure make; make install cd etc cp limits login.access login.defs.linux shells suauth /etc mv /etc/login.defs.linux /etc/login.defs
groupadd -g 1 man useradd -u 1 -g man man ./configure make; make install
./configure make; make install
./configure make; make install
make; make install
make; make XSCPT="" install
make; make install
./configure make; make install
./configure make; make install
cd scripts; make start-stop-daemon cp start-stop-daemon /usr/sbin cp start-stop-daemon.8 /usr/man/man8
make; make install
cd src make; make install
./configure make; make install
./configure make; make install
./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
./configure make; make install