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 setup Internet for example.
There are a number of packages that need to be already installed 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. These programs are going to be linked statically. The reasoning behind this is that your normal Linux system may have a different C Library version than the LFS system is going to have. The programs you install in this section will be linked against the C Library of your normal Linux system. This may cause library conflicts if you run those programs on the LFS system. Therefore we have to link those programs statically. During the installation 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.
Every program and library is default compiled with debugging symbols. This means you can run a program or library through a debugger and the debugger's output will be more user friendly. These debugging symbols also enlarge the program or binary significantly. This document will not install software without debugging symbols (as I don't know if the majority of readers do or don't debug software). In stead, you can remove those symbols manually if you want with the strip program.
To remove debugging symbols from a binary (must be an a.out or ELF binary) run strip --strip-debug filename You can use wild cards if you need to strip debugging symbols from multiple files (use something like strip --strip-debug $LFS/usr/bin/*).
Before you wonder if these debugging symbols would make a big difference, here are some statistics:
A static Bash binary with debugging symbols: 2.3MB
A static Bash binary without debugging symbols: 645KB
A dynamic Bash binary with debugging symbols: 1.2MB
A dynamic Bash binary without debugging symbols: 478KB
$LFS/lib and $LFS/usr/lib (glibc and gcc files) with debugging symbols: 87MB
$LFS/lib and $LFS/usr/lib (glibc and gcc files) without debugging symbols: 16MB
Sizes may vary depending on which compiler has been used and which C library version is used to link dynamic programs against, but your results will be very similar if you compare programs with and without debugging symbols. After I was done with this chapter and stripped all debugging symbols from all LFS binaries and libraries I regained a little over 102 MB of disk space. Quite the difference. The difference would be even greater when I would do this at the end of this book when everything is installed.