Linux From Scratch

Version 5.0-pre1

Gerard Beekmans

This book describes the process of creating a Linux system from scratch, using nothing but the sources of the required software.

Copyright (c) 1999-2002, Gerard Beekmans

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions in any form must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Neither the name of "Linux From Scratch" nor the names of its contributors may be used to endorse or promote products derived from this material without specific prior written permission.

  • Any material derived from Linux From Scratch must contain a reference to the "Linux From Scratch" project.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Dedication

This book is dedicated to my loving and supportive wife Beverly Beekmans.

Table of Contents
Preface
Foreword
Audience
Who would want to read this book
Who would not want to read this book
Prerequisites
Structure
Part I - Introduction
Part II - Preparing for the build
Part III - Building the LFS system
Part IV - Appendices
I. Part I - Introduction
1. Introduction
Acknowledgments
How things are going to be done
Conventions used in this book
Book version
Mirror sites
Changelog
Mailing lists
News server
FAQ
Contact information
2. Important information
About $LFS
About SBUs
About the test suites
How to ask for help
II. Part II - Preparing for the build
3. Preparing a new partition
Introduction
Creating a new partition
Creating a file system on the new partition
Mounting the new partition
4. The materials: packages and patches
Introduction
All the packages
Needed patches
5. Preparing the LFS system
Introduction
Why we use static linking
Creating the $LFS/tools directory
Adding the user lfs
Setting up the environment
Installing Binutils-2.14 - Pass 1
Installing GCC-3.3.1 - Pass 1
Installing Linux-2.4.22 headers
Installing Glibc-2.3.2
"Locking in" Glibc
Installing Tcl-8.4.4
Installing Expect-5.39.0
Installing DejaGnu-1.4.3
Installing GCC-3.3.1 - Pass 2
Installing Binutils-2.14 - Pass 2
Installing Gawk-3.1.3
Installing Coreutils-5.0
Installing Bzip2-1.0.2
Installing Gzip-1.3.5
Installing Diffutils-2.8.1
Installing Findutils-4.1.20
Installing Make-3.80
Installing Grep-2.5.1
Installing Sed-4.0.7
Installing Gettext-0.12.1
Installing Ncurses-5.3
Installing Patch-2.5.4
Installing Tar-1.13.25
Installing Texinfo-4.6
Installing Bash-2.05b
Installing Util-linux-2.12
Installing Perl-5.8.0
Stripping
III. Part III - Building the LFS system
6. Installing basic system software
Introduction
About debugging symbols
Entering the chroot environment
Changing ownership
Creating directories
Mounting the proc and devpts file systems
Creating essential symlinks
Creating the passwd and group files
Creating devices (Makedev-1.7)
Installing Linux-2.4.22 headers
Installing Man-pages-1.60
Installing Glibc-2.3.2
Re-adjusting the toolchain
Installing Binutils-2.14
Installing GCC-3.3.1
Installing Coreutils-5.0
Installing Zlib-1.1.4
Installing Lfs-Utils-0.3
Installing Findutils-4.1.20
Installing Gawk-3.1.3
Installing Ncurses-5.3
Installing Vim-6.2
Installing M4-1.4
Installing Bison-1.875
Installing Less-381
Installing Groff-1.19
Installing Sed-4.0.7
Installing Flex-2.5.4a
Installing Gettext-0.12.1
Installing Net-tools-1.60
Installing Inetutils-1.4.2
Setting up Basic Networking
Installing Perl-5.8.0
Installing Texinfo-4.6
Installing Autoconf-2.57
Installing Automake-1.7.6
Installing Bash-2.05b
Installing File-4.04
Installing Libtool-1.5
Installing Bzip2-1.0.2
Installing Ed-0.2
Installing Kbd-1.08
Installing Diffutils-2.8.1
Installing E2fsprogs-1.34
Installing Grep-2.5.1
Installing Grub-0.93
Installing Gzip-1.3.5
Installing Man-1.5m2
Installing Make-3.80
Installing Modutils-2.4.25
Installing Patch-2.5.4
Installing Procinfo-18
Installing Procps-3.1.11
Installing Psmisc-21.3
Installing Shadow-4.0.3
Installing Sysklogd-1.4.1
Installing Sysvinit-2.85
Installing Tar-1.13.25
Installing Util-linux-2.12
Installing GCC-2.95.3
Revised chroot command
Installing LFS-Bootscripts-1.11
Configuring system components
7. Setting up system boot scripts
Introduction
How does the booting process with these scripts work?
Configuring the setclock script
Do I need the loadkeys script?
Configuring the sysklogd script
Configuring the localnet script
Creating the /etc/hosts file
Configuring the network script
8. Making the LFS system bootable
Introduction
Creating the /etc/fstab file
Installing Linux-2.4.22
Making the LFS system bootable
9. The End
The End
Get Counted
Rebooting the system
What now?
IV. Part IV - Appendices
A. Package descriptions and dependencies
Introduction
Autoconf
Automake
Bash
Binutils
Bison
Bzip2
Coreutils
Diffutils
E2fsprogs
Ed
File
Findutils
Flex
Gawk
GCC
Gettext
Glibc
Grep
Groff
Grub
Gzip
Inetutils
Kbd
Less
LFS-Bootscripts
Lfs-Utils
Libtool
Linux (the kernel)
M4
Make
MAKEDEV
Man
Man-pages
Modutils
Ncurses
Net-tools
Patch
Perl
Procinfo
Procps
Psmisc
Sed
Shadow
Sysklogd
Sysvinit
Tar
Texinfo
Util-linux
Vim
Zlib
B. Index of programs and library files

Preface


Foreword

Having used a number of different Linux distributions, I was never fully satisfied with any of them. I didn't like the arrangement of the bootscripts. I didn't like the way certain programs were configured by default. Much more of that sort of thing bothered me. Finally I realized that if I wanted full satisfaction from my Linux system I would have to build my own system from scratch, using only the source code. I resolved not to use pre-compiled packages of any kind, nor CD-ROM or boot disk that would install some basic utilities. I would use my current Linux system to develop my own.

This wild idea seemed very difficult at the time and often seemed an impossible task. After sorting out all kinds of problems, such as dependencies and compile-time errors, a custom-built Linux system was created that was fully operational. I called this system a Linux From Scratch system, or LFS for short.

I hope you will have a great time working on your own LFS!


-- 
Gerard Beekmans
gerard@linuxfromscratch.org


Audience


Who would want to read this book

There are many reasons why somebody would want to read this book. The principal reason being to install a Linux system straight from the source code. A question many people raise is "Why go through all the hassle of manually building a Linux system from scratch when you can just download and install an existing one?". That is a good question and is the impetus for this section of the book.

One important reason for LFS's existence is to help people learn how a Linux system works from the inside out. Building an LFS system helps demonstrate to you what makes Linux tick, how things work together and depend on each other. One of the best things that this learning experience provides is the ability to customize Linux to your own tastes and needs.

A key benefit of LFS is that you have more control of your system without relying on someone else's Linux implementation. With LFS, you are in the driver's seat and dictate every aspect of your system, such as the directory layout and bootscript setup. You also dictate where, why and how programs are installed.

Another benefit of LFS is the ability to create a very compact Linux system. When installing a regular distribution, you are usually forced to install several programs which you are likely never to use. They're just sitting there wasting precious disk space (or worse, CPU cycles). It isn't difficult to build an LFS system less than 100 MB. Does that still sound like a lot? A few of us have been working on creating a very small embedded LFS system. We successfully built a system that was just enough to run the Apache web server with approximately 8MB of disk space used. Further stripping could bring that down to 5 MB or less. Try that with a regular distribution.

We could compare distributed Linux to a hamburger you buy at a fast-food restaurant -- you have no idea what you are eating. LFS, on the other hand, doesn't give you a hamburger, but the recipe to make a hamburger. This allows you to review it, to omit unwanted ingredients, and to add your own ingredients which enhance the flavor of your burger. When you are satisfied with the recipe, you go on to preparing it. You make it just the way you like it: broil it, bake it, deep-fry it, barbecue it, or eat it tar-tar (raw).

Another analogy that we can use is that of comparing LFS with a finished house. LFS will give you the skeletal plan of a house, but it's up to you to build it. You have the freedom to adjust your plans as you go.

One last advantage of a custom built Linux system is security. By compiling the entire system from source code, you are empowered to audit everything and apply all the security patches you feel are needed. You don't have to wait for somebody else to compile binary packages that fix a security hole. Unless you examine the patch and implement it yourself you have no guarantee that the new binary package was built correctly and actually fixes the problem (adequately).

There are too many good reasons to build your own LFS system for them all to be listed here. This section is only the tip of the iceberg. As you continue in your LFS experience, you will find on your own the power that information and knowledge truly bring.


Who would not want to read this book

There are probably some, for whatever reason, would feel that they do not want to read this book. If you do not wish to build your own Linux system from scratch, then you probably don't want to read this book. Our goal is to help you build a complete and usable foundation-level system. If you only want to know what happens while your computer boots, then we recommend the "From Power Up To Bash Prompt" HOWTO. The HOWTO builds a bare system which is similar to that of this book, but it focuses strictly on creating a system capable of booting to a BASH prompt.

While you decide which to read, consider your objective. If you wish to build a Linux system while learning a bit along the way, then this book is probably your best choice. If your objective is strictly educational and you do not have any plans for your finished system, then the "From Power Up To Bash Prompt" HOWTO is probably a better choice.

The "From Power Up To Bash Prompt" HOWTO is located at http://axiom.anu.edu.au/~okeefe/p2b/ or on The Linux Documentation Project's website at http://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html.


Prerequisites

This book assumes that its reader has a good deal of knowledge about using and installing Linux software. Before you begin building your LFS system, you should read the following HOWTOs:


Structure

This book is divided into the following four parts:


Part I - Introduction

Part I explains a few important things on how to proceed with the installation, and gives meta information about the book (version, changelog, acknowledgments, associated mailing lists, and so on).


Part II - Preparing for the build

Part II describes how to prepare for the building process: making a partition, downloading the packages, and compiling temporary tools.


Part III - Building the LFS system

Part III guides you through the building of the LFS system: compiling and installing all the packages one by one, setting up the boot scripts, and installing the kernel. The resulting basic Linux system is the foundation upon which you can build other software, to extend your system in the way you like.


Part IV - Appendices

Part IV consists of two appendices. The first is an alphabetical list of all the packages that are installed -- for each package giving its official download location, its contents, and its installation dependencies. The second appendix lists all the programs and libraries installed by these packages in alphabetical order, so you can easily find out to which package a certain program or library belongs.

(Much of the first appendix is integrated into Parts II and III. This enlarges the book somewhat, but we believe it makes for easier reading. Now you don't have to keep referencing the appendix while doing the installation. This going back and forth would be a real chore, especially if you're reading a plain text version of the book.)

I. Part I - Introduction

Table of Contents
1. Introduction
2. Important information

Chapter 1. Introduction


Acknowledgments

We would like to thank the following people and organizations for their contributions to the Linux From Scratch Project.


Current Project Team Members

  • Gerard Beekmans <gerard@linuxfromscratch.org> -- LFS Project Organization/Leadership.

  • Matthew Burgess <matthew@linuxfromscratch.org> -- LFS General Package maintainer, LFS Book editor.

  • Craig Colton <meerkats@bellsouth.net> -- LFS, ALFS, BLFS and Hints Project logo creator.

  • Jeroen Coumans <jeroen@linuxfromscratch.org> -- Website developer, FAQ maintainer.

  • Bruce Dubbs <bruce@linuxfromscratch.org> -- LFS Quality Assurance Team Leader, BLFS Book editor.

  • Alex Groenewoud <alex@linuxfromscratch.org> -- LFS Book editor.

  • Mark Hymers <markh@linuxfromscratch.org> -- CVS maintainer, BLFS Book Creator, former LFS Book editor.

  • James Iwanek <iwanek@linuxfromscratch.org> -- System Administration team member.

  • Nicholas Leippe <nicholas@linuxfromscratch.org> -- Wiki maintainer.

  • Anderson Lizardo <lizardo@linuxfromscratch.org> -- Website backend scripts creator and maintainer.

  • Bill Maltby <bill@linuxfromscratch.org> -- LFS Project Organization/Leadership.

  • Scot Mc Pherson <scot@linuxfromscratch.org> -- LFS NNTP gateway maintainer.

  • Ryan Oliver <ryan@linuxfromscratch.org> -- Testing Team Leader, co- creator of PLFS.

  • James Robertson <jwrober@linuxfromscratch.org> -- Bugzilla maintainer, Wiki developer, LFS Book editor.

  • Greg Schafer <greg@linuxfromscratch.org> -- Toolchain Maintainer, LFS Book editor, co-creator of PLFS.

  • Tushar Teredesai <tushar@linuxfromscratch.org> -- BLFS Book editor, Hints and Patches Projects maintainer.

  • Jeremy Utley <jeremy@linuxfromscratch.org> -- LFS Book editor, Bugzilla maintainer.

  • Countless other people on the various LFS and BLFS mailinglists who are making this book happen by giving their suggestions, testing the book and submitting bug reports, instructions and their experiences with installing various packages.


Translators


Mirrors

  • Jason Andrade <jason@dstc.edu.au> -- au.linuxfromscratch.org mirror.

  • doc.cs.univ- paris8.fr <archive@doc.cs.univ-paris8.fr> -- www2.fr.linuxfromscratch.org mirror.

  • William Astle <lost@l-w.net> -- ca.linuxfromscratch.org mirror.

  • Baque <baque@cict.fr> -- lfs.cict.fr mirror.

  • Stephan Brendel <stevie@stevie20.de> -- lfs.netservice-neuss.de mirror.

  • Vrije Universiteit Brussels -- linuxfromscratch.rave.org mirror.

  • Ian Chilton <ian@ichilton.co.uk> -- us.linuxfromscratch.org, linuxfromscratch.co.uk mirrors.

  • Mikhail Pastukhov <miha@xuy.biz> -- lfs.130th.net mirror.

  • Fredrik Danerklint: se.linuxfromscratch.org mirror.

  • David D.W. Downey <pgpkeys@aeternamtech.com> -- lfs.learnbyexample.com mirror.

  • Eduardo B. Fonseca <ebf@aedsolucoes.com.br> -- br.linuxfromscratch.org mirror.

  • Hagen Herrschaft <hrx@hrxnet.de> -- de.linuxfromscratch.org mirror.

  • Tim Jackson <tim@idge.net> -- linuxfromscratch.idge.net mirror.

  • Barna Koczka <barna@siker.hu> -- hu.linuxfromscratch.org mirror.

  • Simon Nicoll <sime@dot-sime.com> -- uk.linuxfromscratch.org mirror.

  • Ervin S. Odisho <ervin@activalink.net> -- lfs.activalink.net mirror.

  • Guido Passet <guido@primerelay.net> -- nl.linuxfromscratch.org mirror.

  • Jeremy Polen <jpolen@rackspace.com> -- us2.linuxfromscratch.org mirror.

  • UK Mirror Service -- linuxfromscratch.mirror.co.uk mirror.

  • Thomas Skyt <thomas@sofagang.dk> -- dk.linuxfromscratch.org mirror.

  • Antonin Sprinzl <Antonin.Sprinzl@tuwien.ac.at> -- at.linuxfromscratch.org mirror.

  • Dag Stenstad <dag@stenstad.net> for providing no.linuxfromscratch.org and Ian Chilton for running it.

  • Jesse Tie-Ten- Quee <highos@linuxfromscratch.org> for providing and running the linuxfromscratch.org server.

  • Alexander Velin <velin@zadnik.org> -- bg.linuxfromscratch.org mirror.

  • Martin Voss <Martin.Voss@ada.de> -- lfs.linux-matrix.net mirror.

  • Pui Yong <pyng@spam.averse.net> -- sg.linuxfromscratch.org mirror.


Donations

  • Dean Benson <dean@vipersoft.co.uk> for several monetary contributions.

  • DREAMWVR.COM for their past sponsorship of donating various resources to the LFS and related sub projects.

  • Hagen Herrschaft <hrx@hrxnet.de> for donating a P4 2.2Ghz system.

  • O'Reilly for donating books on SQL and PHP.

  • VA Software who, on behalf of Linux.com, donated a VA Linux 420 (former StartX SP2) workstation.

  • Mark Stone for donating shadowfax the linuxfromscratch.org server.

  • Jesse Tie-Ten- Quee <highos@linuxfromscratch.org> for donating a Yamaha CDRW 8824E cd writer.

  • Countless other people on the various LFS mailinglists who are making this book happen by giving their suggestions, testing the book and submitting bug reports.


Previous Team Members and Contributors

  • Timothy Bauscher <timothy@linuxfromscratch.org> -- LFS Book editor, Hints Project maintainer.

  • Robert Briggs for originally donating the linuxfromscratch.org and linuxfromscratch.com domain names.

  • Ian Chilton <ian@ichilton.co.uk> for maintaining the Hints project

  • Marc Heerdink <gimli@linuxfromscratch.org> -- LFS Book editor.

  • Seth W. Klein <sklein@linuxfromscratch.org> -- LFS FAQ Creator.

  • Garrett LeSage <garrett@linuxart.com> -- Original LFS banner creator.

  • Simon Perreault <nomis80@videotron.ca> -- Hints Project maintainer.

  • Geert Poels <Geert.Poels@skynet.be> -- Original BLFS banner creator; based on the original LFS banner by Garrett LeSage.

  • Frank Skettino <bkenoah@oswd.org> -- Initial design of the old website - OSWD.

  • Jesse Tie-Ten- Quee <highos@linuxfromscratch.org> for answering countless questions on irc and having a great deal of patience.


How things are going to be done

You are going to build your LFS system by using a previously installed Linux distribution such as Debian, Mandrake, Red Hat, etc. The existing Linux system (host) will be used as a starting point, because you will need programs like a compiler, linker, text editor, and other development tools to build the new system. Ordinarily, the required tools are available by default if you selected "development" as one of your installation options when you installed your Linux distribution.

After you have downloaded the packages that make up an LFS system, you will create a new Linux native partition and filesystem. This new Linux partition and filesystem is where your new LFS system will be compiled and installed onto.

Chapter 5 will then discuss the installation of a number of packages that will form the basic development suite (or tool-set) which is used to build the actual system in Chapter 6. Some of these packages are needed to resolve circular dependencies. For example, to compile a compiler you need a compiler.

The first thing to be done in Chapter 5 is build a first pass of the toolchain, which is made up of Binutils and GCC. The programs from these packages will be linked statically in order for them to be used independently of the host system. The second thing to do is build Glibc, the C library. Glibc will be compiled by the toolchain programs we just built in the first pass.

The third thing to do is build a second pass of the toolchain. This time the toolchain will be dynamically linked against the newly built Glibc. The remaining Chapter 5 packages are all built using this second pass toolchain and dynamically linked against the new host-independent Glibc. When this is done, the LFS installation process will no longer depend on the host distribution, with the exception of the running kernel. This is known as "self contained" and "self hosted". There is a discussion of the differences between statically and dynamically linked programs at the beginning of Chapter 5.

You may be asking yourself "that seems like a lot of work, just to get away from my host distribution". Let us take a few minutes to discuss this question. The work involved in building the packages in Chapter 5 is to ensure that as little information from your host makes it into your brand new LFS system. When you build the first two packages in Chapter 5, Binutils and GCC, they will be compiled statically. This means that the version of the C library on your host distribution will be embedded inside all the binary programs you just compiled. This has the potential to cause problems for you down the road. The host's Glibc is usually an unknown quantity and might even contain bugs or anything else we don't know about until it is too late. A well known issue is that statically linked binaries compiled on a Glibc-2.2.x based system that contain calls to the getpwuid() function crash when run on a Glibc-2.3.x based system. Seeing as we are about to build a Glibc-2.3.x based system, we need to shield ourselves from problems of this nature. The procedure employed in Chapter 5 achieves this goal. With all these things in mind, you can see that the extra effort to compile Binutils and GCC twice is well worth it.

In Chapter 6 your real LFS system will be built. The chroot (change root) program is used to enter a virtual environment and start a new shell whose root directory will be set to the LFS partition. This is very similar to rebooting and instructing the kernel to mount the LFS partition as the root partition. The reason that you don't actually reboot, but instead chroot, is that creating a bootable system requires additional work which isn't necessary. As well, chrooting allows you to continue using the host while LFS is being built. While software is being installed you can simply switch to a different VC (Virtual Console) or X desktop and continue using the computer as you normally would.

When all the software from Chapter 6 is installed, the temporary tools built in Chapter 5 will be removed. Chapters 7, 8 and 9 will finalize the installation. The bootscripts are setup in Chapter 7, the kernel and boot loader are setup in Chapter 8 and Chapter 9 has some pointers to help you after you finish with the book. Then, finally, you reboot your computer into your new LFS system.

This is the process in a nutshell. Detailed information on the steps you will take are discussed in the chapters and package descriptions as you progress through them. If something isn't completely clear now, don't worry, everything will fall into place soon.

Please read Chapter 2 carefully as it explains a few important things you should be aware of before you begin to work through Chapters 5 and beyond.


Conventions used in this book

To make things easy to follow, there are a number of conventions used throughout the book. Following are some examples:

./configure --prefix=/usr

This form of text is designed to be typed exactly as seen unless otherwise noted in the surrounding text. It is also used in the explanation sections to identify which of the commands is being referenced.

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir'

This form of text (fixed width text) is showing screen output, probably as the result of commands issued, and is also used to show filenames, such as /etc/lilo.conf.

Emphasis

This form of text is used for several purposes in the book, mainly to emphasize important points, and to give examples of what to type.

http://www.linuxfromscratch.org/

This form of text is used for hyperlinks, both within the book and to external pages such as HOWTOs, download locations and websites.

cat > $LFS/etc/group << "EOF"
root:x:0:
bin:x:1:
......
EOF

This type of section is used mainly when creating configuration files. The first command (in bold) tells the system to create the file $LFS/etc/group from whatever is typed on the following lines until the sequence EOF is encountered. Therefore, this whole section is generally typed as seen.


Book version

This is LFS-BOOK version 5.0-pre1 dated September 17th, 2003. If this version is older than a month a newer version is probably already available for download. Check one of the mirror sites below for updated versions.


Mirror sites

The LFS project has a number of mirrors setup world-wide to make it easier and more convenient for you to access the website and download the required packages. Please visit the http://www.linuxfromscratch.org website for the list of current mirrors.


Changelog

5.0-pre1 - September 17th, 2003

  • Upgraded to:

    • automake-1.7.6

    • bash-2.05b

    • binutils-2.14

    • e2fsprogs-1.34

    • file-4.04

    • findutils-4.1.20

    • gawk-3.1.3

    • gcc-3.3.1

    • gettext-0.12.1

    • glibc-2.3.2

    • glibc-2.3.2-sscanf-1.patch

    • grep-2.5.1

    • groff-1.19

    • gzip-1.3.5

    • less-381

    • libtool-1.5

    • linux-2.4.22

    • man-1.5m2

    • man-1.5m2-80cols.patch

    • man-1.5m2-manpath.patch

    • man-1.5m2-pager.patch

    • man-pages-1.60

    • modutils-2.4.25

    • procps-3.1.11

    • procps-3.1.11.patch

    • psmisc-21.3

    • sed-4.0.7

    • sysvinit-2.85

    • tar-1.13.25

    • texinfo-4.6

    • util-linux-2.12

    • vim-6.2

  • Added:

    • bash-2.05b-2.patch

    • bison-1.875-attribute.patch

    • coreutils-5.0

    • coreutils-5.0-uname.patch

    • coreutils-5.0-hostname-2.patch

    • dejagnu-1.4.3

    • expect-5.39.0

    • expect-5.39.0.patch

    • gawk-3.1.3.patch

    • gcc-2.95.3

    • gcc-2.95.3-2.patch

    • gcc-2.95.3-returntype-fix.patch

    • gcc-3.3.1-no_fixincludes-2.patch

    • gcc-3.3.1-specs-1.patch

    • gcc-3.3.1-suppress-libiberty.patch

    • grub-0.93

    • grub-0.93-gcc33-1.patch

    • inetutils-1.4.2

    • lfs-utils-0.3

    • ncurses-5.3-etip-2.patch

    • ncurses-5.3-vsscanf.patch

    • perl-5.8.0-libc-3.patch

    • shadow-4.0.3-newgroup-fix.patch

    • tcl-8.4.4

    • zlib-1.1.4-vsnprintf.patch

  • Removed:

    • bin86-0.16.3

    • fileutils-4.1

    • fileutils-4.1.patch

    • findutils-4.1-segfault.patch

    • findutils-4.1.patch

    • glibc-2.3.1-libnss.patch

    • glibc-2.3.1-root-perl.patch

    • gzip-1.2.4b.patch

    • lilo-22.2

    • netkit-base-0.17

    • sh-utils-2.0

    • sh-utils-2.0.patch

    • sh-utils-2.0-hostname.patch

    • tar-1.13.patch

    • textutils-2.1

    • vim-6.1.patch

  • September 17th, 2003 [greg]: Chapter 6 - GCC-2.95.3: Added rationale notes.

  • September 17th, 2003 [jwrober]: Updated the acknowledgements page to match the website.

  • September 17th, 2003 [jeremy]: Upgraded File to 4.04

  • September 17th, 2003 [jeremy]: Chapter 6 - changed 2 of the occurances of exec bash --login to include the +h directive.

  • September 17th, 2003 [greg]: Chapters 5 and 6 - Locking in Glibc and Re-adjusting the toolchain: Do "make -C ld install" instead of "make -C ld install-data-local" to install a whole new linker instead of just the new ldscripts.

  • September 17th, 2003 [alex]: Normalized the spelling of 'Tcl' and 'DejaGnu', following their own documentation.

  • September 17th, 2003 [alex]: Properly alphabetized the dependencies.

  • September 16th, 2003 [alex]: Finally updated the dependencies for the new Coreutils.

  • September 16th, 2003 [greg]: Chapters 5 and 6 - Locking in Glibc and Re-adjusting the toolchain: Added sanity checks.

  • September 16th, 2003 [greg]: Chapters 5 and 6 - Binutils, GCC, and Glibc: Added notes on the test suites.

  • September 15th, 2003 [alex]: Corrected several typos and some inconsistencies.

  • September 14th, 2003 [greg]: Chapter 6 - Revised chroot command: Removed no longer needed set +h.

  • September 14th, 2003 [alex]: Fixed some typos, and added some markup. Dropped the removal of program files from the Stripping section in Chapter 5.

  • September 14th, 2003 [greg]: Chapter 6 - Create essential symlinks: Add symlink /usr/lib/libgcc_s.so.1 to allow gcc abi_check to run. Future NPTL needs this as well.

  • September 13th, 2003 [jwrober]: Added PLFS hint text to the page in Chapter 6 for creating passwd and group: bug 596.

  • September 13th, 2003 [jwrober]: Updated the "How things are going to be done" page to include more of the PLFS hint's text.

  • September 13th, 2003 [jwrober]: Preface - Merged whoread and whonotread into a single audience page.

  • September 13th, 2003 [greg]: Chapter 2 - Added new section about the test suites.

  • September 12th, 2003 [jeremy]: Chapter 5 - Ncurses: Added description for the --without-ada configure switch.

  • September 12th, 2003 [jeremy]: Chapter 5 - Gawk: Added the testsuite

  • September 12th, 2003 [jeremy]: Chapter 5 - Grep: Added descriptions of configure switches courtesy of Anderson Lizardo

  • September 12th, 2003 [gerard]: Removed /usr/lib/locale directory creation - it's created during Chapter 6 - Glibc where it's more relevant.

  • September 11th, 2003 [jwrober]: Chapter 5 - Fixed GCC Pass 2 specs patch text to be more vague, but in actuality more accurate - provided by Anderson Lizardo.

  • September 11th, 2003 [jwrober]: Chapter 5 - Grammar fix in Tcl install directions provided by Anderson Lizardo.

  • September 11th, 2003 [jwrober]: Chapter 5 - Small textual change in the locking in Glibc page for /lib/ld.so.1 provided by Anderson Lizardo.

  • September 11th, 2003 [jeremy]: Added bootloader setup to Chapter 8, after the addition of Grub to the book.

  • September 11th, 2003 [gerard]: Removed Bin86 and LILO and replaced it with Grub.

  • September 11th, 2003 [jeremy]: Dropped non-toolchain tests to optional actions. Added a note to use the Wiki for failed tests.

  • September 11th, 2003 [jeremy]: Added Bison patch, backported from CVS, to fix pwlib compilation problems

  • September 11th, 2003 [jeremy]: Added Greg's patch to GCC to suppress the installation of libiberty, and changed Binutils to allow its libiberty to stay.

  • September 11th, 2003 [jeremy]: Added caution tags around the reminder to not delete the Binutils source and build directories in Chapter 5.

  • September 11th, 2003 [jeremy]: Added new perl-libc-3 patch from Anderson Lizardo

  • September 9th, 2003 [jwrober]: Fixed the Findutils package download link on the packages page closing bug 578.

  • September 9th, 2003 [jeremy]: Chapter 6 - GCC 2.95.3: Removed compilation of C++, added Zack's return-type patch.

  • September 9th, 2003 [jeremy]: Chapter 6 - Coreutils: Added coreutils-5.0-hostname-2.patch, which suppresses the build of the hostname binary, and also suppresses its check.

  • September 9th, 2003 [jeremy]: Added some notes regarding failed tests to Glibc and DejaGnu.

  • September 9th, 2003 [jeremy]: Glibc - Added commands to both Chapter 5 and 6 to include minimum locales necessary for checks.

  • September 9th, 2003 [jeremy]: Chapter 6 - Removed Zlib's munging of CFLAGS in favor of a note to add -fPIC.

  • September 8th, 2003 [matt]: Chapter 5 - Fixed the rm command that deletes unneeded documentation from /tools/share.

  • September 6th, 2003 [matt]: Chapter 6 - Removed a reference to "the static" directory in the intro.

  • September 6th, 2003 [jeremy]: Chapter 4 - Updated download locations for some packages.

  • September 5th, 2003 [jeremy]: Chapter 5 - GCC Pass 2: Corrected the make check error explanation

  • September 5th, 2003 [jeremy]: Chapter 6 - Makedev: Changed the default device creation to generic-nopty, because we now use devpts by default.

  • September 5th, 2003 [jeremy]: Chapter 6 - GCC: Corrected wording to reflect the removal of the /usr/lib/cpp symlink.

  • September 5th, 2003 [jeremy]: Corrected perl libc patch to -2, changing the old /stage1 structure to /tools

  • September 5th, 2003 [matt]: Chapter 6 - Updated gcc specs patch and upgraded to man-1.5m2

  • September 4th, 2003 [jeremy]: Chapter 6 - Creating Directories: Eliminated the creation of /usr/tmp - Closes bug 176.

  • September 4th, 2003 [jeremy]: Chapter 6 - Mounting Proc: Added mounting the devpts filesystem into chroot here. Closes bug 533.

  • September 4th, 2003 [jeremy]: Chapter 6 - Mounting Proc: Added a warning at the end regarding checking that proc is still mounted if you stop and restart the lfs process.

  • September 4th, 2003 [jeremy]: Chapter 6 - Gzip: Altered text to better explain the reason behind the sed command used in the gzip installation. Closes bug 551.

  • September 4th, 2003 [jeremy]: Chapter 4 - Downloading patches: Added a note regarding Tushar's patches project, and a link to the patches home page.

  • September 3rd, 2003 [matt]: Fixed issue with util-linux not utilising headers and libraries installed in /stage1.

  • September 3rd, 2003 [matt]: Removed "rm /bin/pwd" instruction from chapter06 kernel-headers installation as the link is still required by Glibc's installation.

  • September 2nd, 2003 [alex]: Adjusted all the SBUs from the values posted by Jeremy.

  • September 2nd, 2003 [alex]: Finally got around to renaming /stage1 to /tools.

  • September 2nd, 2003 [alex]: Merged several of the main book structure files.

  • September 2nd, 2003 [alex]: Alphabetized download lists, added note to Tcl instructions.

  • September 2nd, 2003 [alex]: Reworded Organization, $LFS and SBUs sections.

  • September 1, 2003 [jeremy] - Chapter 6 - Groff - Added note about choice of A4 or letter for the PAGE variable.

  • September 1, 2003 [jeremy] - Added in shadow newgrp patch from Greg Schafer

  • August 31, 2003 [jeremy] - Chapter 6 - Inetutils - added the --disable-whois and --disable-servers flags

  • August 31, 2003 [jeremy] - Added in Greg's new instructions for GCC 3.3.1 with respect to the fixincludes process. Also added extra verbiage to the locking-in and GCC pass 2 pages on the fixincludes process.

  • August 31, 2003 [jeremy] - Added user nobody to passwd and group files, so coreutils tests will pass.

  • August 31st, 2003 [alex]: Reworded some paragraphs, added missing markup, and rearranged the changelog.

  • August 31st, 2003 [alex]: Wrapped the 'Last checked' lines in parentheses. Several other small retouches.

  • August 30, 2003 [jeremy] - Updated fix-includes patch to GCC 3.3.1

  • August 29, 2003 [jeremy] - Glibc - updated instructions with the sscanf patch from patches.

  • August 29, 2003 [jeremy] - Updated GCC to version 3.3.1, including fixes based on Zack's mini-hint for GCC 3.3, and patches from his docs.

  • August 29th, 2003 [alex]: Removed obsolete Netkit-base, Fileutils, Sh-utils, and Textutils files.

  • August 29th, 2003 [alex]: Added some missing markup, changed a few /static's to /stage1's.

  • August 29th, 2003 [alex]: Chapter 06 - Added all the missing text lines before the make checks, and reworded other lines.

  • August 28, 2003 [matt] - Updated packages to linux-2.4.22, man-pages-1.60, expect-5.39.0, findutils-4.1.20 and tcl-8.4.4

  • August 28, 2003 [jeremy] - New bash-2.05b-2.patch file to include the 7 patches from ftp.gnu.org

  • August 28th, 2003 [alex]: Chapter 06 - Re-adjusting toolchain: Added a forgotten backslash.

  • August 28th, 2003 [alex]: Fixed a few typos and added some missing markup.

  • August 28th, 2003 [alex]: Chapter 06 - Binutils and GCC: Integrated text from the pure-lfs hint.

  • August 27, 2003 [jeremy] - Chapter 06 - Inetutils: Added --sysconfdir=/etc --localstatedir=/var and moved the ping binary from /usr/bin to /bin

  • August 27th, 2003 [alex]: Chapter 06 - Glibc: Integrated text from the pure-lfs hint.

  • August 26, 2003 [jeremy] - Chapter 07 - Creating /etc/hosts: Changed www.mydomain.org to <value of HOSTNAME>.mydomain.org

  • August 26th, 2003 [alex]: Chapter 06 & 08 - Moved the installation of the kernel manpages from chapter 6 to 8.

  • August 26, 2003 [jeremy] - Chapter 04 - Mounting the LFS partition: Added text regarding mounting with too restrictive permissions.

  • August 26, 2003 [jeremy] - Chapter 06 - Creating Directories: Added the creation of the /dev/shm directory.

  • August 26, 2003 [jeremy] - Chapter 08 - Creating fstab: Added the mount of tmpfs filesystem to /dev/shm.

  • August 26, 2003 [jeremy] - Chapter 08 - Kernel Installation: Added a reminder to compile tmpfs support into the kernel.

  • August 25th, 2003 [alex]: Chapter 06 - Rewrote the installation text of Shadow and Util-Linux while correcting some typos.

  • August 25th, 2003 [alex]: Chapter 05 & 06 - Made the "Locking in" and "Re-adjusting" look similar.

  • August 24th, 2003 [alex]: Chapter 04 - Merged the many little files into one file. Gave packages and patches a separate page.

  • August 17th, 2003 [alex]: Chapter 05 - From Bash to Perl: put text in between commands. Added a section on stripping unneeded symbols to decrease the size of the tools.

  • August 16th, 2003 [alex]: Chapter 05 - From Make to Texinfo: put text in between commands.

  • August 11th, 2003 [alex]: Chapter 05 - From Binutils Pass 1 to Findutils: several small textual adjustments. For the second passes not giving the contents and dependencies.

  • August 11th, 2003 [alex]: Chapter 04 - Listed separate core, g++, and test suite tarballs for GCC.

  • August 11th, 2003 [alex]: Chapter 04 - Suppressed the mention of a wget script.

  • August 9th, 2003 [alex]: Chapter 05 - Binutils Pass2 and GCC Pass 2: integrated some text from the pure-lfs hint.

  • August 8th, 2003 [alex]: Chapter 05 - Tcl, Expect, and DejaGnu: added some text.

  • August 6th, 2003 [gerard]: Applied Alex Groenewoud's patch that adds Appendix B, providing a list of all installed programs and libraries plus references to the installation pages.

  • July 30th, 2003 [gerard]: Chapter 06 - Vim: Changed the way the global vimrc and gvimrc locations are defined.

  • July 30th, 2003 [gerard]: Chapter 05 - Binutils Pass2: removed the lib patch, it's no longer needed with the binutils-2.14 upgrade.

  • July 30th, 2003 [gerard]: Chapter 05 Binutils Pass1: Added make configure-host.

  • July 30th, 2003 [gerard]: Upgraded to binutils-2.14, linux-2.4.21, expect-5.38.4, gawk-3.1.3, texinfo-4.6, util-linux-2.12, man-pages-1.58, lfs-utils-0.3, vim-6.2, gettext-0.12.1, automake-1.7.6, file-4.03, e2fsprogs-1.34, procps-3.1.11, psmisc-21.3

  • June 3rd, 2003 [gerard]: Chapter 06 - Gawk: removed the removal of /bin/awk. This symlink isn't created anymore.

  • May 21st, 2003 [gerard]: Chapter 06 - GCC-2.95.3: Added /opt/gcc-2.95.3/lib to the /etc/ld.so.conf file so the libraries can be found during run-time.

  • May 21st, 2003 [gerard]: Chapter 05 - Gzip: Simplified commands.

  • May 21st, 2003 [gerard]: Chapter 05 - Bzip2: Simplified commands.

  • May 21st, 2003 [gerard]: Chapter 06 - Shadow: Added the grpconv command to complement the enabling of all shadowed passwords.

  • May 21st, 2003 [winkie]: Chapter 06 - Creating Files: All those ln commands can be made into a few long ln commands.

  • May 21st, 2003 [winkie]: Chapter 05 - Installing Glibc: Create an ld.so.conf file before building Glibc, to prevent an (harmless) error.

  • May 21st, 2003 [winkie]: Chapter 06 - Installing Glibc: Don't bother doing the 'exec /stage1/bin/bash' stuff, it doesn't do anything now that we use PLFS.

  • May 21st, 2003 [winkie]: Chapter 05 & 06 - Installing Coreutils: Only test the non-root stuff in Chapter 05, but test everything in Chapter 06.

  • May 21st, 2003 [winkie]: Chapter 05 - Installing Expect: Don't bother passing anything more than --prefix=/stage1. None of it is needed.

  • May 16th, 2003 [gerard]: Chapter 06: Net-tools: Changed make install to make update.

  • May 15th, 2003 [timothy]: Chapter 05: Installing Patch: Added CPPFLAGS=-D_GNU_SOURCE before ./configure to fix patch build on PPC.

  • May 13th, 2003 [gerard]: Chapter 06: When we exec /path/to/bash --login, also run set +h to keep the hashing option turned off. Fixes bug #531

  • May 13th, 2003 [gerard]: Chapter 06 - Basic Network: Changed the single quotes to double quotes in the echo command. Without it, $(hostname) won't expand which defeats the sole purpose of this command - to make Perl's hostname check work.

  • May 13th, 2003 [winkie]: Removed all occurrences &&. Updated bug syntax. Added "make check/test" where necessary in Chapter 6.

  • May 13th, 2003 [winkie]: Chapter 06: Applied "Changing ownership" patch to polish the text. Closes bug #511.

  • May 13th, 2003 [winkie]: Chapter 06: Applied "Configuring system components" patch to polish the text. Closes bug #510.

  • May 13th, 2003 [gerard]: Chapter 06: Removed Tcl, Expect and DejaGnu. Nothing uses this once past GCC in chapter 6. The versions in /stage1/bin do the job just fine.

  • May 13th, 2003 [winkie]: Chapter 06 - Installing Shadow: Touching the /usr/bin/passwd file before installation. Not doing so results in Shadow thinking passwd will be in /bin/passwd.

  • May 13th, 2003 [winkie]: Chapter 06 - Installing Procps: Remove the /lib/libproc.so symlink. No package outside of Procps itself uses this library, and none should.

  • May 13th, 2003 [winkie]: Chapter 06 - Installing Net-tools: Run "make config" before doing make. Fixes bugs #462 and #497.

  • May 13th, 2003 [gerard]: Chapter 06 - Ncurses: Added the vsscanf patch.

  • May 12th, 2003 [gerard]: Chapter 05 - Gzip: Removed make check. It doesn't do anything.

  • May 12th, 2003 [winkie]: Chapter 05 - Installing Texinfo: Don't install the texmf data. It's not used by anything.

  • May 12th, 2003 [winkie]: Chapter 05 & 06 - Installing Ncurses: In Chapter 6, symlink creation has been updated to include libcurses.*, and libncurses++.a has its properties changed to 644. Chapter 5 doesn't need any libcurses.* so those are removed.

  • May 12th, 2003 [gerard]: Chapter 06 - Basic Network: Added $(hostname) to /etc/hosts, without it Perl's hostname test doesn't pass.

  • May 12th, 2003 [gerard]: Chapter 06 - Installing GCC: Don't try to remove /usr/include/libiberty.h. It isn't installed in the first place.

  • May 12th, 2003 [winkie]: Upgraded to findutils-4.1.7, gzip-1.3.5, and tar-1.13.25.

  • May 12th, 2003 [winkie]: Chapter 05 - Installing Perl: Added extra commands to build certain modules into Perl. This is to accommodate the Coreutils "make check". Partially fixes bug #528.

  • May 12th, 2003 [winkie]: Chapter 05 - Installing Gzip: Nothing in Chapter 6 checks for or uses the uncompress command, therefore we shouldn't create it.

  • May 12th, 2003 [winkie]: Chapter 05 - Installing Bzip2: Running "make" implies "make check", therefore there is no reason whatsoever for us to run it manually.

  • May 12th, 2003 [winkie]: Chapter 05 - Installing Lfs-Utils: Removed. The only package that checks for mktemp before it is installed is GCC, and that's only for gccbug.

  • May 11th, 2003 [gerard]: Chapter 06 - GCC-2.95.3: Added --enable-threads=posix as well to complete the C++ addition.

  • May 11th, 2003 [gerard]: Chapter 06 - GCC-2.95.3: Added --enable-languages=c,c++ to fix that GCC's version bug with regards to -Wreturn-type. Fixes bug #525

  • May 11th, 2003 [gerard]: Chapter 05 - Bash: Removed the --without-bash-malloc configure option.

  • May 11th, 2003 [gerard]: Updated to gcc-3.2.3-specs-4.patch.

  • May 11th, 2003 [winkie]: Chapter 06 - Setting up Basic Networking: Added section. Create a basic /etc/hosts files, and create /etc/services and /etc/protocols from IANA. Fixes bugs #359 & #515.

  • May 11th, 2003 [winkie]: Upgrading to lfs-utils-0.2.2. This adds two files needed for proper networking configuration.

  • May 11th, 2003 [winkie]: Removed Netkit-base 0.17. Added Inetutils 1.4.2. Fixes bug #490.

  • May 11th, 2003 [winkie]: Added lfs-utils-0.2.1. Fixes bug #493.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Ncurses: Fix up the symlinks so that they follow suit of other library symlinks. No more weirdness here.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Procps: Removed XSCPT="" cruft and its corresponding paragraph. This stuff isn't needed anymore.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Ncurses: Pass --without-debug to the configure script. It seems to have gotten lost at some point.

  • May 11th, 2003 [timothy]: Chapter 5 & 6 - Installing Bzip2, Installing Zlib: Modified build commands per bug #524.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Glibc: Install the linuxthreads man pages, too. This got lost somewhere.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Grep: Added --with-included-regex to prevent Grep from using Glibc's somewhat bugged regex.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Coreutils: Fix some functionality of the uname command with a patch.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Net-tools: Just do regular old "make install" instead of "make update". The latter works fine now.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing GCC: After installation, remove /usr/include/libiberty.h. It is not used outside of the GCC build tree.

  • May 11th, 2003 [winkie]: Upgraded to Bash 2.05b and added its patch.

  • May 11th, 2003 [winkie]: Chapter 06 - Installing Zlib: Apply a patch to fix the buffer overflow in gzprintf().

  • May 11th, 2003 [winkie]: Chapter 06 - Configuring system components: Moved the creation of the btmp, wtmp, lastlog and utmp to just before Shadow, so that they are detected at their proper locations.

  • May 10th, 2003 [winkie]: Chapter 06 - Installing Automake: Run "make" before installing. This is needed now with the newer releases of Automake.

  • May 10th, 2003 [winkie]: Chapter 06 - Installing Vim: Removed the patch. It hasn't been required since GCC 3.2.1.

  • May 10th, 2003 [winkie]: Chapter 06 - Creating the mtab file: Removed. Mounting /proc has the side effect of creating /etc/mtab for us.

  • May 10th, 2003 [winkie]: Chapter 06 - Installing Make: Removed modification of /usr/bin/make file. It is no longer mistakenly installed with strange ownership or permissions.

  • May 10th, 2003 [winkie]: Chapter 06 - Installing Glibc: Made /etc/localtime a file instead of a symlink. The symlink method breaks on systems where /usr is a separate partition.

  • May 10th, 2003 [winkie]: Chapter 06 - Installing E2fsprogs: Removed install-info commands for e2fsprogs. The "make install" target handles this for us.

  • May 10th, 2003 [gerard]: Removed all CFLAGS and LDFLAGS variables where they are not essential (so, not including static binutils, GCC and compiling Zlib with -fPIC).

  • May 10th, 2003 [gerard]: Chapter 05 - Binutils (pass1, pass2), locking in Glibc and adjusting toolchain: Changed tooldir to /stage1 (likewise we use tooldir=/usr in Chapter 6).

  • May 10th, 2003 [gerard]: Chapter 05 - Kernel headers: Removed the usage of cp -H because there are distributions out there that do not know about the -H option.

  • May 10th, 2003 [gerard]: New gcc-3.2.3-specs-3.patch.

  • May 10th, 2003 [gerard]: Chapter 06 - Adjusting toolchain: Made it more architecture-independent.

  • May 10th, 2003 [gerard]: Chapter 05 - Locking in Glibc: Made it more architecture-independent.

  • May 7th, 2003 [gerard]: Removed GCC No Debug patches. No longer assume gcc-core and gcc-g++ packages are downloaded, so added appropriate --enable-languages options.

  • May 7th, 2003 [gerard]: Removed Chapter 6 - Glibc-Pass2. It's not needed anymore with the pure-lfs integration.

  • May 7th, 2003 [gerard]: Downgraded to flex-2.5.4a again. Newer versions just don't work properly.

  • May 5th, 2003 [gerard]: Removed zlib installation from chapter 5 (its inclusion was a mistake).

  • May 5th, 2003 [gerard]: Various bug fixes that were introduced during the pure-lfs integration.

  • May 2nd, 2003 [gerard]: Upgraded to: automake-1.7.4, e2fsprogs-1.33, file-4.02, flex-2.5.31, gawk-3.1.2, gcc-3.2.3, glibc-2.3.2, grep-2.5.1, groff-1.19, less-381, libtool-1.5, man-1.5l, man-pages-1.56, modutils-2.4.25, procps-3.1.8, sed-4.0.7, sysvinit-2.85, texinfo-4.5, util-linux-2.11z

  • May 2nd, 2003 [gerard]: Removed fileutils-4.1, sh-utils-2.0, textutils-2.1 (all replaced with coreutils-5.0).

  • May 2nd, 2003 [gerard]: Added binutils-2.13.2-libc.patch, coreutils-5.0, dejagnu-1.4.3, expect-5.38, gawk-3.1.2, gcc-2.95.3, tcl-8.4.2

  • May 2nd, 2003 [gerard] - Integrated new installation method from the Pure LFS hint written by Greg Schafer and Ryan Oliver.

4.1 - April 28th, 2003

  • Upgraded to:

    • autoconf-2.57

    • automake-1.7.2

    • bison-1.875

    • e2fsprogs-1.32

    • gawk-3.1.1-3.patch

    • gcc-3.2.1

    • glibc-2.3.1

    • groff-1.18.1

    • kbd-1.08

    • less-378

    • lfs-bootscripts-1.11

    • libtool-1.4.3

    • linux-2.4.20

    • make-3.80

    • man-1.5k-2.patch

    • man-pages-1.54

    • modutils-2.4.22

    • ncurses-5.3

    • procps-3.1.5

    • psmisc-21.2

    • sed-4.0.5

    • texinfo-4.3

    • util-linux-2.11y

  • Added:

    • findutils-4.1-segfault.patch

    • glibc-2.3.1-libnss.patch

    • glibc-2.3.1-root-perl.patch

    • kbd-1.08.patch

    • man-1.5k-80cols.patch

    • man-1.5k-manpath.patch

    • man-1.5k-pager.patch

  • Removed:

    • gcc-3.2.1-nofixincludes-2.patch

    • glibc-2.3.1.patch

    • kbd-1.06-3.patch

    • man-1.5k-2.patch

    • ncurses-5.2-2.patch

  • February 3rd, 2003 [gerard]: Upgraded to lfs-bootscripts-1.11 to implement Seth Klein's mtab changes (see entry below this one).

  • February 3rd, 2003 [sklein]: Chapter 06: Changed /etc/mtab from a symlink to a file.

  • January 29th, 2003 [gerard]: Chapter 06 - GCC: Changed the install target to install-no-fixedincludes.

  • January 29th, 2003 [gerard]: Downgraded to binutils-2.13.2 due to a GCC bug that can't parse the version string of binutils 2.13.2.1. The only changes between 2.13.2 and 2.13.2.1 are documentation changes, so there is no actual code downgrade. A better fix will be added to the book later.

  • January 27th, 2003 [gerard, timothy, billy]: Converted the software installation pages into a new format. Also merged software installations with their configure components from "Configuring essential software".

  • January 22nd, 2003 [timothy]: Chapter 06 - Configuring essential software: Corrected kernel directory for keymap location.

  • January 10th, 2003 [gerard]: Added a new chroot command after the second Glibc installation that is to be used from that point onwards.

  • January 9th, 2003 [timothy]: Appendix A - Gzip: Added patch URL.

  • January 9th, 2003 [timothy]: Chapter 05 - Findutils: Removed -D_GNU_SOURCE flag for now because it's breaking compilation; 4 people have reported this bug.

  • January 8th, 2003 [timothy]: Chapter 05 - Findutils: Added missing / before configure line.

  • January 6th, 2003 [gerard]: Chapter 06 - Bison: removed yacc script creation. Bison now installs this by default.

  • January 6th, 2003 [gerard]: Upgraded to Binutils-2.13.2.1, Bison-1.875 and Man-pages-1.54

  • January 6th, 2003 [gerard]: Chapter 05+06 - Findutils: Added CPPFLAGS=-D_GNU_SOURCE to promote proper compiling on non-x86 architectures.

  • January 6th, 2003 [gerard]: Chapter 06 - Zlib: Added CFLAGS variable to define -fPIC so the dynamic library gets compiled properly at all times.

  • January 5th, 2003 [timothy]: Chapter 05 - Applied a revised version of Alex's patch to split the Install all software as an unprivileged user page into two pages: Adding the user lfs and Setting up the environment.

  • January 2nd, 2003 [gerard]: Chapter 05 - All packages whose configure script supports the LDFLAGS environment variable now use it rather than passing the variable down to make.

  • January 2nd, 2003 [gerard]: Chapter 06 - Fixed the gawk patch. make uninstall will no longer wipe out the /usr/bin directory. Also, renamed /usr/share/gawk to /usr/share/gawk-3.1.1.

  • January 2nd, 2003 [gerard]: Replaced the glibc-2.3.1 mega-patch with two separate patches (glibc-2.3.1-root-perl.patch and glibc-2.3.1-libnss.patch).

  • January 2nd, 2003 [gerard]: Replaced the man-1.5k mega-patch with three separate patches (man-1.5k-80cols.patch, man-1.5k-manpath.patch and man-1.5k-pager.patch).

  • January 1st, 2003 [gerard]: Chapter 06 - Glibc Second Pass: Fixed typo in linuxthreads man pages installation.

  • January 1st, 2003 [gerard]: Chapter 06 - Linux Kernel: The man pages can't be installed here because it requires Perl. Moved to end of chapter 6.

  • December 31st, 2002 [gerard]: Chapter 06 - Man: Updated the patch so man pages are formatted properly on screens with more than 80 columns.

  • December 31st, 2002 [gerard]: Chapter 06 - Linux: Added make mandocs to create man pages and copy them to /usr/share/man/man9

  • December 31st, 2002 [gerard]: Appendix A - Bzip2: Changed the download location to http://sources.redhat.com/bzip2

  • December 31st, 2002 [gerard]: Chapter 06: Added second Glibc installation at the end of the chapter. Removed the separate linuxthreads man-pages installation and moved that to the second Glibc installation.

  • December 31st, 2002 [gerard]: Upgraded to Glibc-2.3.1

  • December 31st, 2002 [gerard]: Chapter 05 - GCC: Removed nofixincludes patch and use the built-in install-no-fixedincludes make target.

  • December 31st, 2002 [gerard]: Chapter 05 - GCC: Removed HAVE_GAS_HIDDEN, added --with-ld and --with-as configure switches.

  • December 29th, 2002 [timothy]: Updated to binutils-2.13.2, procps-3.1.5.

  • December 29th, 2002 [timothy]: Chapter 05: Changed all LDFLAGS=-static to LDFLAGS="-static".

  • December 29th, 2002 [timothy]: Chapter 06 - Flex: Added symlink from libfl.a to libl.a.

  • December 20th, 2002 [timothy]: Updated to sed-4.0.5.

  • December 18th, 2002 [timothy]: Updated to procps-3.1.4.

  • December 17th, 2002 [timothy]: Chapter 5 & 6: Modified paragraphs about unpacking patches since they are no longer compressed.

  • December 15th, 2002 [timothy]: Updated to autoconf-2.57, automake-1.7.2, binutils-2.13.1, e2fsprogs-1.32, gcc-3.2.1, libtool-1.4.3, linux-2.4.20, modutils-2.4.22, procps-3.1.3, sed-4.0.4, texinfo-4.3, util-linux-2.11y.

  • December 15th, 2002 [timothy]: Chapter 06 - Glibc: Removed warning about --enable-kernel.

  • December 10th, 2002 [gerard]: Chapter 04 - Changed all links into Freshmeat.net project links, removed lfs-packages tarball. This was done because the LFS FTP archive won't contain the packages anymore, instead you have to go to the package's download sites to get them.

  • December 5th, 2002 [gerard]: Chapter 08 - Renamed usbdevfs into usbfs as the kernel guys made this change to reduce confusion with devfs.

  • December 3rd, 2002 [gerard]: Chapter 05 - Sed: Added --disable-nls

  • December 3rd, 2002 [gerard]: Chapter 03 - Creating filesystem: Added a note that mkswap has to be run if a new swap partition has been created.

  • December 3rd, 2002 [gerard]: Chapter 06 - Bzip2: Removed unnecessary lines that first create a symlink, then remove it again.

  • December 3rd, 2002 [gerard]: Appendix A - Bzip2: Updated the download URL.

  • December 3rd, 2002 [gerard]: Chapter 06 - Groff: Removed the PROCESSEDEXAMPLEFILES="" variables.

  • October 25th, 2002 [timothy]: Preface: Added "Prerequisites" section.

  • October 25th, 2002 [timothy]: Chapter 09: Added "What now?" section.

  • October 25th, 2002 [timothy]: Removed Appendix B.

  • October 25th, 2002 [timothy]: Chapter 02: Removed "Which Platform" section.

  • October 23rd, 2002 [timothy]: Swapped chapter03 and chapter04.

  • October 23rd, 2002 [timothy]: Chapter 02: Removed "Where to store the downloaded software" and "How to install the software" sections.

  • October 23rd, 2002 [timothy]: Upgraded to bison-1.75, sed-4.0. Moved m4 before bison to meet its dependency.

  • October 21st, 2002 [timothy]: Chapter 06 - Linux-2.4.19: Replaced mkdir /usr/include/asm and cp command with cp -HR.

  • October 21st, 2002 [timothy]: Added findutils-4.1-segfault.patch to fix a segfault in locate when it encounters a very long path name.

  • October 21st, 2002 [timothy]: Added libtool-1.4.2.patch to fix an incompatibility between Autoconf 2.53 and Libtool 1.4.x.

  • October 21st, 2002 [timothy]: Upgraded to automake-1.7.1, modutils-2.4.21, man-pages-1.53, kbd-1.08, util-linux-2.11w, autoconf-2.54, e2fsprogs-1.29, groff-1.18.1, psmisc-21.2, less-378, procps-3.0.4, make-3.80, ncurses-5.3.

  • October 20th, 2002 [timothy]: Uncompressed patches.

  • October 13th, 2002 [markh]: Chapter 05 - Bzip2: Added -s to CC argument to make it consistent.

  • October 6th, 2002 [timothy]: Switched to gcc-core and gcc-g++.

  • October 6th, 2002 [timothy]: Chapter 06 - Applied Bill Maltby's grammatic-fixes patch.


Mailing lists

The linuxfromscratch.org server is hosting a number of mailinglists that are used for the development of the LFS project. These lists include, among others, the main development and support lists.

For more information regarding which lists are available, how to subscribe to them, archive locations, etc. visit http://www.linuxfromscratch.org/mailinglists.


News server

All the mailing lists hosted at linuxfromscratch.org are also accessible via the NNTP server. All messages posted to a mailing list will be copied to the correspondent newsgroup, and vice versa.

The news server can be reached at news.linuxfromscratch.org.


FAQ

If you encounter any errors, have any questions, or if you find a typo in the book, then, please consult the FAQ (Frequently Asked Questions) page.

http://www.linuxfromscratch.org/faq/


Contact information

Please direct your emails to one of the LFS mailing lists. See Chapter 1 - Mailing lists for more information on the available mailing lists.

If you need to reach Gerard Beekmans personally, send an email to gerard@linuxfromscratch.org


Chapter 2. Important information


About $LFS

Please read the following paragraphs carefully. Throughout this book the variable LFS will be used frequently. $LFS must at all times be replaced with the directory where the partition that contains the LFS system is mounted. How to create and where to mount the partition will be explained in full detail in Chapter 3. For the moment let's assume that the LFS partition is mounted on /mnt/lfs.

When you are told to run a command like ./configure --prefix=$LFS/tools, you actually have to execute ./configure --prefix=/mnt/lfs/tools.

It's important that this is done no matter where it is read; be it in commands entered in a shell, or in a file edited or created.

A possible solution is to set the environment variable LFS. This way $LFS can be entered literally instead of replacing it with /mnt/lfs. This is accomplished by running:

export LFS=/mnt/lfs

Now, if you are told to run a command such as ./configure --prefix=$LFS/tools, then you may type it literally. Your shell will replace "$LFS" with "/mnt/lfs" when it processes the command line (that is, when you hit Enter after having typed the command).


About SBUs

Most people would like to know beforehand how long it approximately takes to compile and install each package. But "Linux from Scratch" is built on so many different systems, it is not possible to give actual times that are anywhere near accurate: the biggest package (Glibc) won't take more than twenty minutes on the fastest systems, but will take something like three days on the slowest -- no kidding. So instead of giving actual times, we've come up with the idea of using the Static Binutils Unit (abbreviated to SBU).

It works like this: the first package you compile in this book is the statically linked Binutils in Chapter 5, and the time it takes to compile this package is what we call the "Static Binutils Unit" or "SBU". All other compile times will be expressed relative to this time.

For example, the time it takes to build the static version of GCC is 3.9 SBU. This means that if on your system it took 10 minutes to compile and install the static Binutils, then you know it will take nearly 40 minutes to build the static GCC. Fortunately, most build times are much shorter than the one of Binutils.

Note that SBUs don't work well for SMP-based machines. But if you're so lucky as to have multiple processors, chances are that your system is so fast that you don't mind.


About the test suites

Most packages provide a test suite. Running the test suite for a newly built package is generally a good idea as it can provide a nice sanity check that everything compiled correctly. A test suite that passes its set of checks usually proves that the package is functioning mostly as the developer intended. It does not, however, guarantee that the package is totally bug free.

Some test suites are more important than others. For example, the test suites for the core toolchain packages -- GCC, Binutils, and Glibc (the C library) -- are of the utmost importance due to their central positioning in a properly functioning system. But be warned, the test suites for GCC and Glibc can take a very long period of time to complete, especially on slower hardware.

As you progress through the book and encounter the build commands to run the various test suites, we'll guide you on the relative importance of the test suite in question so that you can decide for yourself whether to run it or not.


How to ask for help

If you encounter a problem while using this book, and your problem is not listed in the FAQ (http://www.linuxfromscratch.org/faq), you will find that most of the people on Internet Relay Chat (IRC) and on the mailing lists are willing to help you. An overview of the LFS mailing lists can be found in Chapter 1 - Mailing lists. To assist us in diagnosing and solving your problem, include as much relevant information as possible in your request for help.


Things to mention

Apart from a brief explanation of the problem you're having, the essential things to include in your request are:

  • the version of the book you are using (being 5.0-pre1),

  • the host distribution and version you are using to create LFS from,

  • the package or section giving you problems,

  • the exact error message or symptom you are receiving,

  • whether you have deviated from the book at all.

(Note that saying that you've deviated from the book doesn't mean that we won't help you. After all, LFS is about choice. It'll just help us to see other possible causes of your problem.)


Configure problems

When something goes wrong during the stage where the configure script is run, look through the config.log file. This file may contain errors encountered during configure which weren't printed to the screen. Include those relevant lines if you decide to ask for help.


Compile problems

To help us find the cause of the problem, both screen output and the contents of various files are useful. The screen output from both the ./configure script and the make run can be useful. Don't blindly include the whole thing but on the other hand, don't include too little. As an example, here is some screen output from make:

gcc -DALIASPATH=\"/mnt/lfs/usr/share/locale:.\"
-DLOCALEDIR=\"/mnt/lfs/usr/share/locale\" -DLIBDIR=\"/mnt/lfs/usr/lib\"
-DINCLUDEDIR=\"/mnt/lfs/usr/include\" -DHAVE_CONFIG_H -I. -I.
-g -O2 -c getopt1.c
gcc -g -O2 -static -o make ar.o arscan.o commands.o dir.o expand.o file.o
function.o getopt.o implicit.o job.o main.o misc.o read.o remake.o rule.o
signame.o variable.o vpath.o default.o remote-stub.o version.o opt1.o
-lutil job.o: In function `load_too_high':
/lfs/tmp/make-3.79.1/job.c:1565: undefined reference to `getloadavg'
collect2: ld returned 1 exit status
make[2]: *** [make] Error 1
make[2]: Leaving directory `/lfs/tmp/make-3.79.1'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/lfs/tmp/make-3.79.1'
make: *** [all-recursive-am] Error 2

In this case, many people just include the bottom section where it says
make [2]: *** [make] Error 1
and onwards. This isn't enough for us to diagnose the problem because it only tells us that something went wrong, not what went wrong. The whole section, as in the example above, is what should be included to be helpful, because it includes the command that was executed and the command's error message(s).

An excellent article on asking for help on the Internet in general has been written by Eric S. Raymond. It is available online at http://catb.org/~esr/faqs/smart-questions.html. Read and follow the hints in that document and you are much more likely to get a response to start with and also to get the help you actually need.


Test suite problems

Many packages provide a test suite which, depending on the importance of the package, we may encourage you to run. Sometimes packages will generate false or expected failures. If you encounter these, you can check the LFS Wiki page at http://wiki.linuxfromscratch.org to see whether we have already investigated and noted them. If we already know about them, then usually there is no need to be concerned.

II. Part II - Preparing for the build


Chapter 3. Preparing a new partition


Introduction

In this chapter the partition which will host the LFS system is prepared. We will create the partition itself, make a file system on it, and mount it.


Creating a new partition

In order to build our new Linux system, we will need some space: an empty disk partition. If you don't have a free partition, and no room on any of your hard disks to make one, then you could build LFS on the same partition as the one on which your current distribution is installed. This procedure is not recommended for your first LFS install, but if you are short on disk space, and you feel brave, take a look at the hint at http://www.linuxfromscratch.org/hints/downloads/files/lfs_next_to_existing_systems.txt.

For a minimal system you will need a partition of around 1 GB. This is enough to store all the source tarballs and compile all the packages. But if you intend to use the LFS system as your primary Linux system, you will probably want to install additional software, and will need more space than this, probably around 2 or 3 GB.

As we almost never have enough RAM in our box, it is a good idea to use a small disk partition as swap space -- this space is used by the kernel to store seldom-used data to make room in memory for more urgent stuff. The swap partition for your LFS system can be the same one as for your host system, so you won't have to create another if your host system already uses a swap partition.

Start the cfdisk program with an argument naming the hard disk upon which the new partition must be created -- for example /dev/hda for the primary IDE disk. Create a Linux native partition and a swap partition, if needed. Please refer to the man page of cfdisk if you don't yet know how to use the program.

Remember the designation of your new partition -- something like hda5. This book will refer to it as the LFS partition. If you (now) also have a swap partition, remember its designation too. These names will later be needed for the /etc/fstab file.


Creating a file system on the new partition

Now the partition has been made, we can create a file system on it. Most widely used in the Linux world is the second extended file system (ext2), but with the high-capacity hard disks of today the so-called journaling file systems are becoming increasingly popular. Here we will create an ext2 file system, but build instructions for other file systems can be found at http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/filesystems.html.

To create an ext2 file system on the LFS partition run the following:

mke2fs /dev/xxx

Replace xxx with the name of the LFS partition (something like hda5).

If you created a (new) swap partition you need to initialize it as a swap partition too (also known as formatting, like you did above with mke2fs) by running:

mkswap /dev/yyy

Replace yyy with the name of the swap partition.


Mounting the new partition

Now that we've created a file system, we want to be able to access the partition. For that, we need to mount it, and have to choose a mount point. In this book we assume that the file system is mounted under /mnt/lfs, but it doesn't matter what directory you choose.

Choose a mount point and assign it to the LFS environment variable by running:

export LFS=/mnt/lfs

Now create the mount point and mount the LFS file system by running:

mkdir -p $LFS
mount /dev/xxx $LFS

Replace xxx with the designation of the LFS partition.

If you have decided to use multiple partitions for LFS (say one for / and another for /usr), mount them like this:

mkdir -p $LFS
mount /dev/xxx $LFS
mkdir $LFS/usr
mount /dev/yyy $LFS/usr

Of course, replace xxx and yyy with the appropriate partition names.

You should also ensure that this new partition is not mounted with permissions that are too restrictive (such as the nosuid, nodev or noatime options). You can run the mount command without any parameters to see with what options the LFS partition is mounted. If you see nosuid, nodev or noatime, you will need to remount it.

Now that we've made ourselves a place to work in, we're ready to download the packages.


Chapter 4. The materials: packages and patches


Introduction

Below is a list of packages you need to download for building a basic Linux system. The listed version numbers correspond to versions of the software that are known to work, and this book is based upon them. Unless you are an experienced LFS builder, we highly recommend not to try out newer versions, as the build commands for one version may not work with a newer version. Also, there is often a good reason for not using the latest version due to known problems that haven't been worked around yet.

All the URLs, when possible, refer to the project's page at Freshmeat.net. The Freshmeat pages will give you easy access to the official download sites as well as project websites, mailinglists, FAQs, Changelogs and more.

We can't guarantee that these download locations are always available to you. In case a download location has changed since this book was published, please try to google for the package. Should you remain unsuccessful with this you should consult the book's errata page at http://linuxfromscratch.org/lfs/print or try the alternative means of download listed at http://linuxfromscratch.org/lfs/packages.html


All the packages

Download or otherwise obtain the following packages:


Autoconf (2.57) - 792 KB:
http://freshmeat.net/projects/autoconf/

Automake (1.7.6) - 518 KB:
http://freshmeat.net/projects/automake/

Bash (2.05b) - 1,766 KB:
http://freshmeat.net/projects/gnubash/

Binutils (2.14) - 9,534 KB:
http://freshmeat.net/projects/binutils/

Bison (1.875) - 796 KB:
http://freshmeat.net/projects/bison/

Bzip2 (1.0.2) - 650 KB:
http://freshmeat.net/projects/bzip2/

Coreutils (5.0) - 1,831 KB:
http://freshmeat.net/projects/coreutils/

DejaGnu (1.4.3) - :
http://freshmeat.net/projects/dejagnu/

Diffutils (2.8.1) - 762 KB:
http://freshmeat.net/projects/diffutils/

E2fsprogs (1.34) - 2,827 KB:
http://freshmeat.net/projects/e2fsprogs/

Ed (0.2) - 182 KB:
http://freshmeat.net/projects/ed/

Expect (5.39.0) - 508 KB:
http://freshmeat.net/projects/expect/

File (4.04) - 177 KB:
http://freshmeat.net/projects/file/

Findutils (4.1.20) - 759 KB:
http://freshmeat.net/projects/findutils/

Flex (2.5.4a) - 372 KB:
ftp://ftp.gnu.org/gnu/non-gnu/flex/

Gawk (3.1.3) - 1,831 KB:
http://freshmeat.net/projects/gnuawk/

GCC (2.95.3) - 2520 KB:
http://freshmeat.net/projects/gcc/
GCC-core (3.3.1) - 13,140 KB:
http://freshmeat.net/projects/gcc/
GCC-g++ (3.3.1) - 2564 KB:
http://freshmeat.net/projects/gcc/

GCC-testsuite (3.3.1) - 1180 KB:
http://freshmeat.net/projects/gcc/

Gettext (0.12.1) - 3,637 KB:
http://freshmeat.net/projects/gettext/

Glibc (2.3.2) - 17,463 KB:
http://freshmeat.net/projects/glibc/
Glibc-linuxthreads (2.3.2) - 238 KB:
http://freshmeat.net/projects/glibc/

Grep (2.5.1) - 545 KB:
http://freshmeat.net/projects/grep/

Groff (1.19) - 2,198 KB:
http://freshmeat.net/projects/groff/

Grub (0.93) - 870 KB:
ftp://alpha.gnu.org/pub/gnu/grub/

Gzip (1.3.5) - 323 KB:
ftp://alpha.gnu.org/gnu/gzip/

Inetutils (1.4.2) - 746 KB:
http://freshmeat.net/projects/inetutils/

Kbd (1.08) - 801 KB:
http://freshmeat.net/projects/kbd/

Less (381) - 239 KB:
http://freshmeat.net/projects/less/

LFS-Bootscripts (1.11) - 25 KB:
http://downloads.linuxfromscratch.org/lfs-bootscripts-1.11.tar.bz2

Lfs-Utils (0.3) - 156 KB:
http://www.linuxfromscratch.org/~winkie/downloads/lfs-utils/

Libtool (1.5) - 1137 KB:
http://freshmeat.net/projects/libtool/

Linux (2.4.22) - 29,529 KB:
http://freshmeat.net/projects/linux/

M4 (1.4) - 310 KB:
http://freshmeat.net/projects/gnum4/

Make (3.80) - 899 KB:
http://freshmeat.net/projects/gnumake

MAKEDEV (1.7) - 8 KB:
http://downloads.linuxfromscratch.org/MAKEDEV-1.7.bz2

Man (1.5m2) - 222 KB:
http://freshmeat.net/projects/man/

Man-pages (1.60) - 633 KB:
http://freshmeat.net/projects/man-pages/

Modutils (2.4.25) - 214 KB:
http://freshmeat.net/projects/modutils/

Ncurses (5.3) - 2,019 KB:
http://freshmeat.net/projects/ncurses/

Net-tools (1.60) - 194 KB:
http://freshmeat.net/projects/net-tools/

Patch (2.5.4) - 183 KB:
http://freshmeat.net/projects/patch/

Perl (5.8.0) - 10,765 KB:
http://freshmeat.net/projects/perl/

Procinfo (18) - 24 KB:
http://freshmeat.net/projects/procinfo/

Procps (3.1.11) - 233 KB:
http://freshmeat.net/projects/procps/

Psmisc (21.3) - 253 KB:
http://freshmeat.net/projects/psmisc/

Sed (4.0.7) - 665 KB:
http://freshmeat.net/projects/sed/

Shadow (4.0.3) - 1030 KB:
http://freshmeat.net/projects/shadow/

Sysklogd (1.4.1) - 80 KB:
http://freshmeat.net/projects/sysklogd/

Sysvinit (2.85) - 89 KB:
http://freshmeat.net/projects/sysvinit/

Tar (1.13.25) - 1281 KB:
ftp://alpha.gnu.org/gnu/tar/

Tcl (8.4.4) - 3,370 KB:
http://freshmeat.net/projects/tcltk/

Texinfo (4.6) - 1,254 KB:
http://freshmeat.net/projects/texinfo/

Util-linux (2.12) - 1,777 KB:
http://freshmeat.net/projects/util-linux/

Vim (6.2) - 2,822 KB:
http://freshmeat.net/projects/vim/

Zlib (1.1.4) - 144 KB:
http://freshmeat.net/projects/zlib/

Total size of these packages: 105 MB


Needed patches

Besides all those packages, you'll also need several patches. These correct tiny mistakes in the packages that should be fixed by the maintainer, or just make some small modifications to bend things our way. You'll need the following:


Bash Patch (2.05b-2) - 7.6 KB:
http://downloads.linuxfromscratch.org/bash-2.05b-2.patch

Bison Attribute Patch:
http://downloads.linuxfromscratch.org/bison-1.875-attribute.patch

Coreutils Hostname Patch (5.0-hostname-2) - 1 KB:
http://downloads.linuxfromscratch.org/coreutils-5.0-hostname-2.patch
Coreutils Uname Patch (5.0-uname) - 1 KB:
http://downloads.linuxfromscratch.org/coreutils-5.0-uname.patch

Ed Patch (0.2) - 1 KB:
http://downloads.linuxfromscratch.org/ed-0.2.patch

Expect Patch (5.39.0) - 6.5 KB:
http://downloads.linuxfromscratch.org/expect-5.39.0.patch

Gawk Patch (3.1.3) - 1 KB:
http://downloads.linuxfromscratch.org/gawk-3.1.3.patch

GCC Patch (2.95.3-2) - 4 KB:
http://downloads.linuxfromscratch.org/gcc-2.95.3-2.patch

GCC-2 Return-type Patch:
http://downloads.linuxfromscratch.org/gcc-2.95.3-returntype-fix.patch

GCC No Fixincludes Patch:
http://downloads.linuxfromscratch.org/gcc-3.3.1-no_fixincludes-2.patch
GCC Specs Patch:
http://downloads.linuxfromscratch.org/gcc-3.3.1-specs-1.patch
GCC Suppress Libiberty Patch:
http://downloads.linuxfromscratch.org/gcc-3.3.1-suppress-libiberty.patch

Glibc Sscanf Patch:
http://downloads.linuxfromscratch.org/glibc-2.3.2-sscanf-1.patch

Grub Patch (0.93-gcc33-1) - 1 KB:
http://downloads.linuxfromscratch.org/grub-0.93-gcc33-1.patch

Kbd Patch (1.08) - 1 KB:
http://downloads.linuxfromscratch.org/kbd-1.08.patch

Man 80Cols Patch (1.5m2) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5m2-80cols.patch
Man Manpath Patch (1.5m2) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5m2-manpath.patch
Man Pager Patch (1.5m2) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5m2-pager.patch

Ncurses Etip Patch (5.3) - 1 KB:
http://downloads.linuxfromscratch.org/ncurses-5.3-etip-2.patch
Ncurses Vsscanf Patch (5.3) - 1 KB:
http://downloads.linuxfromscratch.org/ncurses-5.3-vsscanf.patch

Perl Libc Patch (5.8.0-libc-3) - 1 KB:
http://downloads.linuxfromscratch.org/perl-5.8.0-libc-3.patch

Procps Patch (3.1.11) - 1 KB:
http://downloads.linuxfromscratch.org/procps-3.1.11.patch

Shadow Patch (4.0.3-newgrp-fix) - 836 Bytes:
http://downloads.linuxfromscratch.org/shadow-4.0.3-newgrp-fix.patch 

Zlib Patch (1.1.4-vsnprintf) - 10 KB:
http://downloads.linuxfromscratch.org/zlib-1.1.4-vsnprintf.patch

In addition, there are a number of optional patches that have been created by the LFS community. Most of these solve slight problems, or enable some functionality that's not enabled by default. Please feel free to examine the patches database, located at http://www.linuxfromscratch.org/patches, and choose any additional patches you might wish to use.


Chapter 5. Preparing the LFS system


Introduction

In this chapter we will compile and install a minimal Linux system. This system will contain just enough tools to be able to start constructing the final LFS system in the next chapter.

The building of this minimal system is done in two steps: first we build a brand-new and host-independent toolchain (compiler, assembler, linker and libraries), and then use this to build all the other essential tools.

The files compiled in this chapter will be installed under the $LFS/tools directory, to keep them separate from the files installed in the next chapter. Since the packages compiled here are merely temporary, we don't want them to pollute the soon-to-be LFS system.

The key to learning what makes a Linux system work is to know what each package is used for, why the user or the system needs it. For this purpose a short summary of the content of each package is given before the actual installation instructions. For a short description of each program in a package, please refer to the corresponding section in Appendix A.

Several of the packages are patched before compilation, but only when the patch is needed to circumvent a problem. Often the patch is needed in both this and the next chapter, but sometimes in only one of them. So, don't worry when instructions for a downloaded patch seem to be missing.

During the installation of most packages you will see all kinds of compiler warnings scroll by on your screen. These are normal and can be safely ignored. They are just what they say they are: warnings -- mostly about improper, but not illegal, use of the C or C++ syntax. It's just that C standards have changed rather often and some packages still use the older standard, which is not really a problem.

Before continuing, make sure the LFS environment variable is set up properly (if you decided to make use of it) by executing the following:

echo $LFS

Make sure the output shows the path to your LFS partition's mount point, which is /mnt/lfs if you followed our example.


Why we use static linking

Most programs have to perform, beside their specific task, many rather common and trivial operations, such as allocating memory, searching directories, opening and closing files, reading and writing them, string handling, pattern matching, arithmetic, and so on. Instead of obliging each program to reinvent the wheel, the GNU system provides all these basic functions ready-made in libraries. The major library on any Linux system is glibc. To get an idea of what it contains, have a look at glibc/index.html somewhere on your host system.

There are two ways of linking the functions from a library to a program that uses them: statically or dynamically. When a program is linked statically, the code of the used functions is included in the executable, resulting in a rather bulky program. When a program is dynamically linked, what is included is a reference to the linker, the name of the library, and the name of the function, resulting in a much smaller executable. This executable has the disadvantage of being somewhat slower than a statically linked one, as the linking at run time takes a few moments.

Aside from this small drawback, dynamic linking has two major advantages over static linking. First, you need only one copy of the executable library code on your hard disk, instead of having many copies of the same code included into a whole bunch of programs -- thus saving disk space. Second, when several programs use the same library function at the same time, only one copy of the function's code is required in core -- thus saving memory space.

Nowadays saving a few megabytes of space may not seem like much, but many moons ago, when disks were measured in megabytes and core in kilobytes, such savings were essential. It meant being able to keep several programs in core at the same time and to contain an entire Unix system on just a few disk volumes.

A third but minor advantage of dynamic linking is that when a library function gets a bug fixed, or is otherwise improved, you only need to recompile this one library, instead of having to recompile all the programs that make use of the improved function.

In summary we can say that dynamic linking trades run time against memory space, disk space, and recompile time.

But if dynamic linking saves so much space, why then are we linking the first two packages in this chapter statically? The reason is to make them independent from the libraries on your host system. The advantage is that, if you are pressed for time, you could skip the second passes over GCC and Binutils, and just use the static versions to compile the rest of this chapter and the first few packages in the next. In the next chapter we will be chrooted to the LFS partition and once inside the chroot environment, the host system's Glibc won't be available, thus the programs from GCC and Binutils will need to be self-contained, i.e. statically linked. However, we strongly advise against skipping the second passes.


Creating the $LFS/tools directory

All programs compiled in this chapter will be installed under $LFS/tools to keep them separate from the programs compiled in the next chapter. The programs compiled here are only temporary tools and won't be a part of the final LFS system and by keeping them in a separate directory, we can later easily throw them away.

If later you wish to search through the binaries of your system to see what files they make use of or link against, then to make this searching easier you may want to choose a unique name. Instead of the simple "tools" you could use something like "tools-for-lfs".

Create the required directory by running the following:

mkdir $LFS/tools

The next step is to create a /tools symlink on your host system. It will point to the directory we just created on the LFS partition:

ln -s $LFS/tools /

This symlink enables us to compile our toolchain so that it always refers to /tools, meaning that the compiler, assembler and linker will work both in this chapter (when we are still using some tools from the host) and in the next (when we are chrooted to the LFS partition).


Adding the user lfs

When logged in as root, making a single mistake can damage or even wreck your system. Therefore we recommend that you build the packages in this chapter as an unprivileged user. You could of course use your own user name, but to make it easier to set up a clean work environment we'll create a new user lfs and use this one during the installation process. As root, issue the following commands to add the new user:

useradd -s /bin/bash -m lfs
passwd lfs

Now grant this new user lfs full access to $LFS/tools by giving it ownership of the directory:

chown lfs $LFS/tools

Next, login as user lfs. This can be done via a virtual console, through a display manager, or with the following substitute user command:

su - lfs

The "-" instructs su to start a new, clean shell.


Setting up the environment

While logged in as user lfs, issue the following commands to set up a good work environment:

cat > ~/.bash_profile << "EOF"
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:$PATH
export LFS LC_ALL PATH
EOF

source ~/.bash_profile

The set +h command turns off bash's hash function. Normally hashing is a useful feature: bash uses a hash table to remember the full pathnames of executable files to avoid searching the PATH time and time again to find the same executable. However, we'd like the new tools to be used as soon as they are installed. By switching off the hash function, our "interactive" commands (make, patch, sed, cp and so forth) will always use the newest available version during the build process.

Setting the user file-creation mask to 022 ensures that newly created files and directories are only writable for their owner, but readable and executable for anyone.

The LFS variable should of course be set to the mount point you chose.

The LC_ALL variable controls the localization of certain programs, making their messages follow the conventions of a specified country. If your host system uses a version of glibc older than 2.2.4, having LC_ALL set to something other than "POSIX" or "C" during this chapter may cause trouble if you exit the chroot environment and wish to return later. By setting LC_ALL to "POSIX" (or "C", the two are equivalent) we ensure that everything will work as expected in the chroot environment.

We prepend /tools/bin to the standard PATH so that, as we move along through this chapter, the tools we build will get used during the rest of the building process.

Now, after sourcing the just-created profile, we're all set to begin building the temporary tools that will support us in later chapters.


Installing Binutils-2.14 - Pass 1

Estimated build time:           1.0 SBU
Estimated required disk space:  160 MB

Contents of Binutils

(Last checked against version 2.12.1.)

Binutils is a collection of software development tools containing a linker, assembler and other tools to work with object files and archives.

Binutils installs the following files:


Program Files

addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip


Library Files

libbfd.[a,so] and libopcodes.[a,so]



Binutils Installation Dependencies

(Last checked against version 2.11.2.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, ln, ls, mkdir
             mv, rm, rmdir, sleep, sort, touch, tr, true, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Binutils

It is important that Binutils be the first package to get compiled, because both Glibc and GCC perform various tests on the available linker and assembler to determine which of their own features to enable.

Note: Even though Binutils is an important toolchain package, we are not going to run the testsuite at this early stage. First, the testsuite framework is not yet in place and second, the programs from this first pass will soon be overwritten by those installed in the second pass.

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building Binutils.

It is recommended by the Binutils installation documentation to build Binutils outside of the source directory in a dedicated directory:

mkdir ../binutils-build
cd ../binutils-build

Next, prepare Binutils to be compiled:

../binutils-2.14/configure \
    --prefix=/tools --disable-nls

The meaning of the configure switches:

  • --prefix=/tools: This tells the configure script to prepare to install the Binutils programs in the /tools directory.

  • --disable-nls: This disables internationalization (a word often shortened to i18n). We don't need this for our static programs and nls often causes problems when linking statically.

Continue with compiling the package:

make configure-host
make LDFLAGS="-all-static"

The meaning of the make option:

  • LDFLAGS="-all-static": This tells the linker that all the Binutils programs should be linked statically.

And install the package:

make install

Now prepare the linker for the "locking in" of Glibc later on:

make -C ld clean
make -C ld LIB_PATH=/tools/lib

Caution

Do not yet remove the Binutils build and source directories. You will need them again in their current state a bit further on in this chapter.


Installing GCC-3.3.1 - Pass 1

Estimated build time:           3.9 SBU
Estimated required disk space:  326 MB

Contents of GCC

(Last checked against version 3.1.)

The GCC package contains the GNU compiler collection, including the C and C++ compilers.

GCC installs the following files:


Program Files

c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0


Library Files

libgcc.a, libgcc_eh.a, libgcc_s.so, libiberty.a, libstdc++.[a,so], libsupc++.a



GCC Installation Dependencies

(Last checked against version 2.95.3.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib
Coreutils: basename, cat, chmod, cp, dirname, echo, expr, hostname, ln
             ls, mkdir, mv, rm, sleep, tail, touch, tr, true, uname
Diffutils: cmp
Find: find
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo



Installation of GCC

Unpack only the GCC-core tarball, as we won't be needing a C++ compiler for the moment.

Note: Even though GCC is an important toolchain package, we are not going to run the testsuite at this early stage. First, the testsuite framework is not yet in place and second, the programs from this first pass will soon be overwritten by those installed in the second pass.

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building GCC.

It is recommended by the GCC installation documentation to build GCC outside of the source directory in a dedicated directory:

mkdir ../gcc-build
cd ../gcc-build

Prepare GCC to be compiled:

../gcc-3.3.1/configure --prefix=/tools \
    --with-local-prefix=/tools \
    --disable-nls --enable-shared \
    --enable-languages=c

The meaning of the new configure options:

  • --with-local-prefix=/tools: The purpose of this switch is to remove /usr/local/include from gcc's include search path. This is not absolutely essential; however, we want to try to minimize the influence of the host system, thus making this a sensible thing to do.

  • --enable-shared: This switch may seem counter-intuitive at first. But using it allows the building of libgcc_s.so.1 and libgcc_eh.a, and having libgcc_eh.a available ensures that the configure script for Glibc (the next package we compile) produces the proper results. Note that the gcc binaries will still be linked statically, as this is controlled by the -static value of BOOT_LDFLAGS further on.

  • --enable-languages=c: This option ensures that only the C compiler is built. The option is only needed when you have downloaded and unpacked the full GCC tarball.

Continue with compiling the package:

make BOOT_LDFLAGS="-static" bootstrap

The meaning of the make parameters:

  • BOOT_LDFLAGS="-static": This tells GCC to link its programs statically.

  • bootstrap: This target doesn't just compile GCC, but compiles it several times. It uses the programs compiled in a first round to compile itself a second time, and then again a third time. It then compares these second and third compiles to make sure it can reproduce itself flawlessly, which most probably means that it was compiled correctly.

And install the package:

make install

As a finishing touch we'll create the /tools/bin/cc symlink. Many programs and scripts run cc instead of gcc, a thing meant to keep programs generic and therefore usable on all kinds of Unix systems. Not everybody has the GNU C compiler installed. Simply running cc leaves the system administrator free to decide what C compiler to install, as long as there's a symlink pointing to it:

ln -sf gcc /tools/bin/cc


Installing Linux-2.4.22 headers

Estimated build time:           0.1 SBU
Estimated required disk space:  142 MB

Contents of Linux

(Last checked against version 2.4.18.)

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components: serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.

Linux installs the following files:


Program Files

kernel and kernel headers



Linux Installation Dependencies

(Last checked against version 2.4.17.)

Bash: sh
Binutils: ar, as, ld, nm, objcopy
Coreutils: basename, cat, cp, date, expr, ln, md5sum, mkdir, mv,
             pwd, rm, sort, stty, tail, touch, uname, whoami, yes
Findutils: find, xargs
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed



Installation of the kernel headers

As some packages need to refer to the kernel header files, we're going to unpack the kernel archive now, set it up, and copy the required files to a place where gcc can later find them.

Prepare for the header installation with:

make mrproper

This ensures that the kernel tree is absolutely clean. The kernel team recommends that this command be issued prior to each kernel compilation. You shouldn't rely on the source tree being clean after untarring.

Create the include/linux/version.h file:

make include/linux/version.h

Create the platform-specific include/asm symlink:

make symlinks

Install the platform-specific header files:

mkdir /tools/include/asm
cp include/asm/* /tools/include/asm
cp -R include/asm-generic /tools/include

Install the cross-platform kernel header files:

cp -R include/linux /tools/include

There are a few kernel header files which make use of the autoconf.h header file. Since we do not yet configure the kernel, we need to create this file ourselves in order to avoid compilation failures. Create an empty autoconf.h file:

touch /tools/include/linux/autoconf.h


Installing Glibc-2.3.2

Estimated build time:           14.0 SBU
Estimated required disk space:  369 MB

Contents of Glibc

(Last checked against version 2.2.5.)

Glibc is the C library that provides the system calls and basic functions such as open, malloc, printf, etc. The C library is used by all dynamically linked programs.

Glibc installs the following files:


Program Files

catchsegv, gencat, getconf, getent, glibcbug, iconv, iconvconfig, ldconfig, ldd, lddlibc4, locale, localedef, mtrace, nscd, nscd_nischeck, pcprofiledump, pt_chown, rpcgen, rpcinfo, sln, sprof, tzselect, xtrace, zdump and zic


Library Files

ld.so, libBrokenLocale.[a,so], libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so], libc_nonshared.a, libcrypt.[a,so], libdl.[a,so], libg.a, libieee.a, libm.[a,so], libmcheck.a, libmemusage.so, libnsl.a, libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.[a,so], libresolv.[a,so], librpcsvc.a, librt.[a,so], libthread_db.so and libutil.[a,so]



Glibc Installation Dependencies

(Last checked against version 2.2.5.)

Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Coreutils: cat, chmod, cp, cut, date, expr, hostname, install, ln,
             mknod, mv, mkdir, rm, pwd, sort, touch, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Glibc installation

Before starting to install Glibc, you must cd into the glibc-2.3.2 directory and unpack Glibc-linuxthreads in that directory, not in /usr/src as you would normally do.

Note: We are going to run the testsuite for Glibc in this chapter. However, it's worth noting that the Glibc testsuite we run in this chapter is considered not as critical as the one we run in Chapter 6.

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting them when building Glibc.

Basically, compiling Glibc in any other way than the book suggests is putting the stability of your system at risk.

Though it is a harmless message, the install stage of Glibc will complain about the absence of /tools/etc/ld.so.conf. Fix this annoying little error with:

mkdir /tools/etc
touch /tools/etc/ld.so.conf

Also, Glibc has a subtle problem when compiled with GCC 3.3.1. Apply the following patch to fix this:

patch -Np1 -i ../glibc-2.3.2-sscanf-1.patch

The documentation that comes with Glibc recommends to build the package not in the source directory but in a separate, dedicated directory:

mkdir ../glibc-build
cd ../glibc-build

Next, prepare Glibc to be compiled:

../glibc-2.3.2/configure --prefix=/tools \
    --disable-profile --enable-add-ons \
    --with-headers=/tools/include \
    --with-binutils=/tools/bin \
    --without-gd

The meaning of the new configure options:

  • --disable-profile: This disables the building of the libraries with profiling information. Omit this option if you plan to do profiling.

  • --enable-add-ons: This enables any add-ons that were installed with Glibc, in our case Linuxthreads.

  • --with-binutils=/tools/bin and --with-headers=/tools/include: Strictly speaking these switches are not required. But they ensure nothing can go wrong with regard to what kernel headers and Binutils programs get used during the Glibc build.

  • --without-gd: This switch ensures that we don't build the memusagestat program, which strangely enough insists on linking against the host's libraries (libgd, libpng, libz, and so forth).

During this stage you will see the following warning:

configure: warning:
*** These auxiliary programs are missing or too old: msgfmt
*** some features will be disabled.
*** Check the INSTALL file for required versions.

The missing msgfmt program (from the Gettext package, which we'll install later) won't cause any problems. The msgfmt is used to generate the binary translation files that can make your system talk in a different language. Because these translation files have already been generated for you, there is no need for msgfmt. You'd only need the program if you change the translation source files (the *.po files in the po subdirectory), which would require you to regenerate the binary files.

Continue with compiling the package:

make
make check
make install

The glibc make check process is highly dependent on certain functions of your host operating system. The most common is a host that fails to mount a tmpfs filesystem at /dev/shm, which may cause glibc tests to fail.

The locales (used by Glibc to make your Linux system respond in a different language) weren't installed when you ran the previous command, so we have to do that ourselves now:

make localedata/install-locales

An alternative to running the previous command is to install only those locales which you need or want. This can be achieved by using the localedef command. Information on this can be found in the INSTALL file in the glibc-2.3.2 tree. However, there are a number of locales that are essential for the tests of future packages to pass correctly, in particular, the libstdc++ tests from GCC. The following instructions, in place of the install-locales command above, will install the minimum set of locales necessary for the tests to run successfully:

mkdir -p /tools/lib/locale
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i ja_JP -f EUC-JP ja_JP


"Locking in" Glibc

Now that the temporary C libraries have been installed, we want all the tools compiled in the rest of this chapter to be linked against these libraries. To accomplish this, we need to adjust the linker and the compiler's specs file.

First install the adjusted linker by running the following from within the binutils-build directory:

make -C ld install

The linker was adjusted a little while back, at the end of the first pass of Binutils. From this point onwards everything will link only against the libraries in /tools/lib.

Now that the adjusted linker is installed, you have to remove the Binutils build and source directories.

The next thing to do is to amend our GCC specs file so that it points to the new dynamic linker. A simple sed will accomplish this:

SPECFILE=/tools/lib/gcc-lib/*/*/specs
sed -e 's@/lib/ld.so.1@/tools/lib/ld.so.1@g' \
    -e 's@/lib/ld-linux.so.2@/tools/lib/ld-linux.so.2@g' \
    $SPECFILE > tempspecfile
mv tempspecfile $SPECFILE
unset SPECFILE

We recommend that you cut-and-paste the above rather than try and type it all in. Or you can edit the specs file by hand if you want to: just replace "/lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2" and "/lib/ld.so.1" with "/tools/lib/ld.so.1".

Lastly, there is a possibility that some include files from the host system have found their way into GCC's private include dir. This can happen because of GCC's "fixincludes" process which runs as part of the GCC build. We'll explain more about this further on in this chapter. For now, run the following commands to eliminate this possibility:

rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}

Caution

It is imperative at this point to stop and ensure that the basic functions (compiling and linking) of the new toolchain are working as expected. For this we are going to perform a simple sanity check:

echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'

If everything is working correctly, there should be no errors, and the output of the last command will be:

[Requesting program interpreter: /tools/lib/ld-linux.so.2]

If you did not receive the output as shown above, then something is seriously wrong. You will need to investigate and retrace your steps to find out where the problem is and correct it. There is no point in continuing until this is done. Most likely something went wrong with the specs file amendment above. Note especially that /tools/lib appears as the prefix of our dynamic linker. Of course, if you are working on a platform where the name of the dynamic linker is something other than ld-linux.so.2, then the output will be slightly different.

Once you are satisfied that all is well, clean up the test files:

rm dummy.c a.out

This completes the installation of the self-contained toolchain, and it can now be used to build the rest of the temporary tools.


Installing Tcl-8.4.4

Estimated build time:           0.6 SBU 
Estimated required disk space:  24 MB


Installation of Tcl

This package and the next two are only installed to be able to run the test suites for GCC and Binutils. Installing three packages just for testing purposes may seem like overkill, but it is very reassuring, if not essential, to know that our most important tools are working properly.

Prepare Tcl to be compiled:

cd unix
./configure --prefix=/tools

Build the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

TZ=UTC make -k test

Sometimes, package testsuites will give false failures. You can consult the LFS Wiki at http://wiki.linuxfromscratch.org to verify that these failures are normal. This applies to all tests throughout the book.

Install the package:

make install

Make a link:

ln -s tclsh8.4 /tools/bin/tclsh

Caution

Do not remove the tcl8.4.4 source directory yet, as the next package will need its internal headers.


Installing Expect-5.39.0

Estimated build time:           0.1 SBU 
Estimated required disk space:  24 MB


Installation of Expect

First apply a patch:

patch -Np1 -i ../expect-5.39.0.patch

This fixes a bug in Expect that can result in bogus failures during the GCC test suite run.

Now prepare Expect to be compiled:

./configure --prefix=/tools --with-tcl=/tools/lib --with-x=no

Build the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make test

And install:

make install

You can now remove the source directories of both Tcl and Expect.


Installing DejaGnu-1.4.3

Estimated build time:           0.1 SBU 
Estimated required disk space:  24 MB


Installation of DejaGnu

Prepare DejaGnu to be compiled:

./configure --prefix=/tools

Build and install the package:

make
make install


Installing GCC-3.3.1 - Pass 2

Estimated build time:           11.0 SBU
Estimated required disk space:  326 MB


Re-installation of GCC

The tools required to test GCC and Binutils are installed now (Expect, Tcl and DejaGnu). We can continue on rebuilding GCC and Binutils, link them against the new Glibc, and test them properly. One thing to note, however, is that these test suites are highly dependent on the features supported by your host distribution. Most notably, a host distribution which does not properly support the devpts filesystem will cause most of these tests to fail.

Note: It's worth noting that the GCC testsuite we run in this chapter is considered not as critical as the one we run in Chapter 6.

Unpack all three GCC tarballs in one and the same working directory. They will all unfold into a single gcc-3.3.1/ subdir.

First correct one problem and make an essential adjustment:

patch -Np1 -i ../gcc-3.3.1-no_fixincludes-2.patch
patch -Np1 -i ../gcc-3.3.1-specs-1.patch

The first patch disables the GCC "fixincludes" script. We mentioned this briefly earlier, but a slightly more in-depth explanation of the fixincludes process is warranted here. Under normal circumstances, the GCC fixincludes script scans your system for header files that need to be fixed. It might find that the Glibc header files on your host system need to be fixed, fix them and put them in the GCC private include directory. Then, later on in Chapter 6, after we've installed the newer Glibc, this private include directory would be searched before the system include directory, resulting in GCC finding the fixed headers from the host system, which would most likely not match the Glibc version actually used for the LFS system.

The last patch changes GCC's default location of the dynamic linker (ld). Patching now rather than adjusting the specs file after installation ensures that our new dynamic linker gets used during the actual build of GCC. That is, all the final (and temporary) binaries created during the build will link against the new Glibc.

Create a separate build directory again:

mkdir ../gcc-build
cd ../gcc-build

Before starting to build GCC, remember to unset any environment variables that override the default optimization flags.

Now prepare GCC to be compiled:

../gcc-3.3.1/configure --prefix=/tools \
    --with-local-prefix=/tools \
    --enable-clocale=gnu --enable-shared \
    --enable-threads=posix --enable-__cxa_atexit \
    --enable-languages=c,c++

Compile the package:

make

There is no need to use the bootstrap target now, as the compiler we're using to compile this GCC has been built from the exact same sources.

Test the results:

make -k check

The -k flag is used to make the test suite run through to completion and not stop at the first failure. The GCC test suite is very comprehensive and is almost guaranteed to generate a few failures. To get a summary of the test suite results, run this:

../gcc-3.3.1/contrib/test_summary | less

You can compare your results to those posted to the gcc-testresults mailing list for similar configurations to your own. For an example of how current GCC-3.3.1 should look on i686-pc-linux-gnu, see http://gcc.gnu.org/ml/gcc-testresults/2003-08/msg01612.html.

Note that the results contain:

* 1 XPASS (unexpected pass) for g++
* 1 FAIL for g++
* 2 FAIL for gcc
* 26 XPASS's for libstdc++

The unexpected pass for g++ is due to the use of --enable-__cxa_atexit. Apparently not all platforms supported by GCC have support for "__cxa_atexit" in their C libraries, so this test is not always expected to pass.

The 26 unexpected passes for libstdc++ are due to the use of --enable-clocale=gnu, which is the correct choice on Glibc-based systems of versions 2.2.5 and above. The underlying locale support in the GNU C library is superior to that of the otherwise selected "generic" model (which may be applicable if for instance you were using Newlibc, Sun-libc or whatever libc). The libstdc++ test suite is apparently expecting the "generic" model, hence those tests are not always expected to pass.

And finally install the package:

make install


Installing Binutils-2.14 - Pass 2

Estimated build time:           1.4 SBU
Estimated required disk space:  160 MB


Re-installation of Binutils

Note: It's worth noting that the Binutils testsuite we run in this chapter is considered not as critical as the one we run in Chapter 6.

First create a separate build directory again:

mkdir ../binutils-build
cd ../binutils-build

Now prepare Binutils to be compiled:

../binutils-2.14/configure --prefix=/tools \
    --enable-shared --with-lib-path=/tools/lib

Before starting to build Binutils, remember to unset any environment variables that override the default optimization flags.

Compile the package:

make 

Test the results (nothing should fail here):

make check

And install the package:

make install

Now prepare Binutils for the re-adjusting of the toolchain in the next chapter:

make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib

Caution

Do not yet remove the Binutils source and build directories. We'll need these directories again in the next chapter in the state they are in now.


Installing Gawk-3.1.3

Estimated build time:           0.2 SBU
Estimated required disk space:  17 MB

Contents of Gawk

(Last checked against version 3.1.1.)

Gawk is an awk implementation that is used to manipulate text files.

Gawk installs the following:


Program Files

awk, gawk, gawk-3.1.1, grcat, igawk, pgawk, pgawk-3.1.1, pwcat



Gawk Installation Dependencies

(No dependencies checked yet.)



Installation of Gawk

Prepare Gawk to be compiled:

./configure --prefix=/tools

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install it:

make install


Installing Coreutils-5.0

Estimated build time:           0.8 SBU
Estimated required disk space:  17 MB

Contents of Coreutils

The Coreutils package contains a whole series of basic shell utilities.

Coreutils installs the following:


Program Files

basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, head, hostid, hostname, id, install, join, kill, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, sleep, sort, split, stat, stty, su, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami, yes



Coreutils Installation Dependencies

Not yet checked but probably something like this:

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, chown, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo



Installation of Coreutils

Prepare Coreutils to be compiled:

./configure --prefix=/tools

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make RUN_EXPENSIVE_TESTS=yes check

And install the package:

make install


Installing Bzip2-1.0.2

Estimated build time:           0.1 SBU
Estimated required disk space:  6 MB

Contents of Bzip2

(Last checked against version 1.0.2.)

Bzip2 is a block-sorting file compressor which generally achieves a better compression than the traditional gzip does.

Bzip2 installs the following files:


Program Files

bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore


Library Files

libbz2.a, libbz2.so (link to libbz2.so.1.0), libbz2.so.1.0 (link to libbz2.so.1.0.2) and libbz2.so.1.0.2



Bzip2 Installation Dependencies

(Last checked against version 1.0.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cp, ln, rm
GCC: cc1, collect2, cpp0, gcc
Make: make



Installation of Bzip2

The Bzip2 package doesn't contain a configure script. Compile and install it with a straightforward:

make PREFIX=/tools install


Installing Gzip-1.3.5

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Gzip

(Last checked against version 1.2.4a.)

The gzip package contains programs to compress and decompress files using the Lempel-Ziv coding (LZ77).

Gzip installs the following:


Program Files

gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew



Gzip Installation Dependencies

(Last checked against version 1.2.4a.)

Bash: sh
Binutils: as, ld, nm
Coreutils: cat, chmod, cp, hostname, install, ln, mv, rm, tr
GCC: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Gzip

Prepare Gzip to be compiled:

./configure --prefix=/tools

Compile the package:

make

And install it:

make install


Installing Diffutils-2.8.1

Estimated build time:           0.1 SBU
Estimated required disk space:  10 MB

Contents of Diffutils

(Last checked against version 2.8.1.)

The programs from this package show you the differences between two files or directories. It's most common use is to create software patches.

Diffutils installs the following files:


Program Files

cmp, diff, diff3 and sdiff



Diffutils Installation Dependencies

(Last checked against version 2.7.)

Bash: sh
Binutils: ld, as
Coreutils: cat, chmod, cp,  date, hostname, install, mv, rm, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Diffutils

Prepare Diffutils to be compiled:

./configure --prefix=/tools

Compile the package:

make

And install it:

make install


Installing Findutils-4.1.20

Estimated build time:           0.2 SBU
Estimated required disk space:  8 MB

Contents of Findutils

(Last checked against version 4.1.)

The Findutils package contains programs to find files, either on-the-fly (by doing a live recursive search through directories and only showing files that match the specifications) or by searching through a database.

Findutils installs the following:


Program Files

bigram, code, find, frcode, locate, updatedb and xargs



Findutils Installation Dependencies

(Last checked against version 4.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, hostname, install, mv, rm, tr
Diffutils: cmp
Grep: egrep, grep
GCC: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed



Installing Findutils

Prepare Findutils to be compiled:

./configure --prefix=/tools

Compile the package:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Make-3.80

Estimated build time:           0.2 SBU
Estimated required disk space:  8 MB

Contents of Make

(Last checked against version 3.79.1.)

Make determines, automatically, which pieces of a large program need to be recompiled and issues the commands to recompile them.

Make installs the following:



Make Installation Dependencies

(Last checked against version 3.79.1.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chgrp, chmod, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Make

Prepare Make to be compiled:

./configure --prefix=/tools

Compile the program:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install it and its documentation:

make install


Installing Grep-2.5.1

Estimated build time:           0.1 SBU
Estimated required disk space:  5 MB

Contents of Grep

(Last checked against version 2.5.)

Grep is a program used to print lines from a file matching a specified pattern.

Grep installs the following:


Program Files

egrep (link to grep), fgrep (link to grep) and grep



Grep Installation Dependencies

(Last checked against version 2.4.2.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chmod, echo, expr, hostname, install,
             ls, mkdir, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Grep

Prepare Grep to be compiled:

./configure --prefix=/tools \
    --disable-perl-regexp --with-included-regex

The meaning of the configure switches:

  • --disable-perl-regexp: This makes sure that grep does not get linked against a PCRE library that may be present on the host, but would not be available once we enter the chroot environment.

  • --with-included-regex: This ensures that Grep uses its internal regular expression code. Without it, it will use the code from Glibc, which is known to be slightly buggy.

Compile the programs:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install them and their documentation:

make install


Installing Sed-4.0.7

Estimated build time:           0.2 SBU
Estimated required disk space:  2 MB

Contents of Sed

(Last checked against version 3.02.)

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).

Sed installs the following:



Sed Installation Dependencies

(Last checked against version 3.02.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, expr, hostname, install, ls, mv, rm, echo, sleep, tr
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Sed

Prepare Sed to be compiled:

./configure --prefix=/tools

Compile the program:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install it and its documentation:

make install


Installing Gettext-0.12.1

Estimated build time:           5.4 SBU
Estimated required disk space:  39 MB

Contents of Gettext

(Last checked against version 0.11.2.)

The Gettext package is used for internationalization and localization. Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the user's native language.

Gettext installs the following:


Program Files

config.charset, config.rpath, gettext, gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, ngettext, project-id, team-address, trigger, urlget, user-email and xgettext


Library Files

libgettextlib[a,so], libgettextsrc[a,so]



Gettext Installation Dependencies

(Last checked against version 0.10.40.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Bison: bison
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln,
             ls, mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Gettext

Prepare Gettext to be compiled:

./configure --prefix=/tools

Compile the programs:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install them and their documentation:

make install


Installing Ncurses-5.3

Estimated build time:           0.7 SBU
Estimated required disk space:  22 MB

Contents of Ncurses

(Last checked against version 5.2.)

The Ncurses package provides character and terminal handling libraries, including panels and menus.

Ncurses installs the following:


Program Files

captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput and tset.


Library Files

libcurses.[a,so] (link to libncurses.[a,so]), libform.[a,so], libform_g.a, libmenu.[a,so], libmenu_g.a, libncurses++.a, libncurses.[a,so], libncurses_g.a, libpanel.[a,so] and libpanel_g.a



Ncurses Installation Dependencies

(Last checked against version 5.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, expr, hostname, install,
             ln, mkdir, mv, rm, sort, tr, uname, wc
Diffutils: cmp
Gawk: gawk
GCC: c++, cc1, cc1plus, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed



Installation of Ncurses

Fix two minor things:

patch -Np1 -i ../ncurses-5.3-etip-2.patch
patch -Np1 -i ../ncurses-5.3-vsscanf.patch

The first patch corrects the etip.h header file, and the second patch prevents some compiler warnings being issued on the use of deprecated headers.

Now prepare Ncurses to be compiled:

./configure --prefix=/tools --with-shared \
    --without-debug --without-ada

The meaning of the configure options:

  • --without-ada: This tells Ncurses not to build its Ada bindings, even if an Ada compiler is installed on the host. This must be done because once we enter the chroot environment, Ada will no longer be available.

Compile the programs and libraries:

make 

Then install them and their documentation:

make install


Installing Patch-2.5.4

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of Patch

(Last checked against version 2.5.4.)

The patch program modifies a file according to a patch file. A patch file usually is a list, created by the diff program, that contains instructions on how an original file needs to be modified.

Patch installs the following:



Patch Installation Dependencies

(Last checked against version 2.5.4.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, echo, expr, hostname, install, mv, rm, tr, uname
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed



Installation of Patch

Prepare Patch to be compiled:

CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/tools

The preprocessor flag -D_GNU_SOURCE is only needed on the PowerPC platform. On other architectures you can leave it out.

Compile the program:

make 

Then install it and its documentation:

make install


Installing Tar-1.13.25

Estimated build time:           0.2 SBU
Estimated required disk space:  10 MB

Contents of Tar

(Last checked against version 1.13.)

Tar is an archiving program designed to store and extract files from an archive file known as a tar file.

Tar installs the following:


Program Files

rmt and tar



Tar Installation Dependencies

(Last checked against version 1.13.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, install, ls, mv, rm,
             sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Net-tools: hostname
Patch: patch
Sed: sed
Texinfo: install-info, makeinfo



Installation of Tar

Prepare Tar to be compiled:

./configure --prefix=/tools

Compile the programs:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install them and their documentation:

make install


Installing Texinfo-4.6

Estimated build time:           0.2 SBU
Estimated required disk space:  19 MB

Contents of Texinfo

(Last checked against version 4.2.)

The Texinfo package contains programs used for reading, writing and converting Info documents, which provide system documentation.

Texinfo installs the following:


Program Files

info, infokey, install-info, makeinfo, texi2dvi and texindex



Texinfo Installation Dependencies

(Last checked against version 4.0.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln, ls,
             mkdir, mv, rm, sleep, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: makeinfo



Installation of Texinfo

Prepare Texinfo to be compiled:

./configure --prefix=/tools

Compile the programs:

make 

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Then install them and their documentation:

make install


Installing Bash-2.05b

Estimated build time:           0.8 SBU 
Estimated required disk space:  24 MB

Contents of Bash

(Last checked against version 2.05a.)

bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. The bash program reads from standard input (the keyboard). A user types something and the program will evaluate what he has typed and do something with it, like running a program.

Bash installs the following files:


Program Files

bash, sh (link to bash) and bashbug



Bash Installation Dependencies

(Last checked against version 2.05a.)

Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, install,
             ln, ls, mkdir, mv, rm, sleep, tr, uname, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Ncurses: (libraries)
Sed: sed
Texinfo: install-info



Installation of Bash

Bash contains several known bugs. Fix these with the following patch:

patch -Np1 -i ../bash-2.05b-2.patch

Now prepare Bash for compilation:

./configure --prefix=/tools --with-curses

Compile the program:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make tests

Then install it and its documentation:

make install

And make a link for the programs that use sh for a shell:

ln -s bash /tools/bin/sh


Installing Util-linux-2.12

Estimated build time:           0.1 SBU
Estimated required disk space:  9 MB

Contents of Util-linux

(Last checked against version 2.11t.)

The Util-linux package contains a number of miscellaneous utility programs. Some of the more prominent utilities are used to mount, unmount, format, partition and manage disk drives, open tty ports and fetch kernel messages.

Util-linux installs the following:


Program Files

agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, fsck.cramfs, fsck.minix, getopt, hexdump, hwclock, ipcrm, ipcs, isosize, line, logger, look, losetup, mcookie, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap, more, mount, namei, parse.bash, parse.tcsh, pg, pivot_root, ramsize (link to rdev), raw, rdev, readprofile, rename, renice, rev, rootflags (link to rdev), script, setfdprm, setsid, setterm, sfdisk, swapoff (link to swapon), swapon, test.bash, test.tcsh, tunelp, ul, umount, vidmode (link to rdev), whereis and write



Util-linux Installation Dependencies

(Last checked against version 2.11n.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chgrp, chmod, cp, install, ln, mv, rm, uname, whoami
Diffutils: cmp
GCC: cc, cc1, collect2, cpp, cpp0
Gettext: msgfmt, xgettext
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed



Installation of Util-linux

Util-linux doesn't use the freshly installed headers and libraries from the /tools directory. This is fixed by altering the configure script:

cp configure configure.backup
sed "s@/usr/include@/tools/include@g" configure.backup > configure 

Prepare Util-linux for compilation:

./configure

Compile some support routines:

make -C lib

And, since you'll need only a couple of the utilities contained in this package, build just those:

make -C mount  mount umount
make -C text-utils  more

Now copy these programs to the temporary tools directory:

cp mount/{,u}mount text-utils/more /tools/bin


Installing Perl-5.8.0

Estimated build time:           2.7 SBU
Estimated required disk space:  52 MB

Contents of Perl

(Last checked against version 5.6.1.)

The Perl package contains perl, the Practical Extraction and Report Language. Perl combines some of the best features of C, sed, awk and sh into one powerful language.

Perl installs the following:


Program files and libraries

a2p, c2ph, dprofpp, find2perl, h2ph, h2xs, perl, perl5.6.1, perlbug, perlcc, perldoc, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, podchecker, podselect, pstruct, s2p, splain,attrs.so, B.so, ByteLoader.so, DProf.so, Dumper.so, DynaLoader.a, Fcntl.so, Glob.so, Hostname.so, IO.so, libperl.a, Opcode.so, Peek.so, POSIX.so, re.so, SDBM_File.so, Socket.so, Syslog.so and SysV.so



Perl Installation Dependencies

(Last checked against version 5.6.1.)

Bash: sh
Binutils: ar, as, ld, nm
Coreutils: basename, cat, chmod, comm, cp, date, echo, expr, hostname, ln,
             ls, mkdir, mv, pwd, rm, sort, split, touch, tr, uname, wc,
             whoami, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Perl

First adapt some hard-wired paths to the C library:

patch -Np1 -i ../perl-5.8.0-libc-3.patch

And make sure some static extensions get built:

chmod u+w hints/linux.sh
echo 'static_ext="IO re Fcntl"' >> hints/linux.sh

Now prepare Perl for compilation:

./configure.gnu --prefix=/tools

Compile only the required tools:

make perl utilities

Then copy these tools and their libraries:

cp perl pod/pod2man /tools/bin
mkdir -p /tools/lib/perl5/5.8.0
cp -R lib/* /tools/lib/perl5/5.8.0


Stripping

If your LFS partition is rather small, you will be glad to learn that you can throw away some unnecessary things. The executables and libraries you have built so far contain about 130 MB of unneeded debugging symbols. Remove those symbols like this:

strip --strip-unneeded /tools/{,s}bin/*
strip --strip-debug /tools/lib/*

The first of the above commands will skip some twenty files, reporting that it doesn't recognize their file format. Most of them are scripts instead of binaries.

Take care not to use --strip-unneeded on the libraries -- they would be destroyed and you would have to build Glibc all over again.

To save another couple of megabytes, you can throw away all the documentation:

rm -rf /tools/{,share/}{doc,info,man}

You will now need to have at least 700 MB of free space on your LFS filesystem to be able to build and install Glibc in the next phase.

III. Part III - Building the LFS system


Chapter 6. Installing basic system software


Introduction

In this chapter we enter the building site, and start constructing our LFS system in earnest. That is, we chroot into our temporary mini Linux system, create some auxiliary things, and then start installing all the packages, one by one.

The installation of all this software is pretty straightforward, and you will probably think it would be much shorter to give here the generic installation instructions and explain in full only the installation of those packages that require an alternate method. Although we agree with that, we nevertheless choose to give the full instructions for each and every package, simply to minimize the possibilities for mistakes.

If you plan to use compiler optimizations in this chapter, take a look at the optimization hint at http://www.linuxfromscratch.org/hints/downloads/files/optimization.txt. Compiler optimizations can make a program run faster, but they may also cause compilation difficulties. If a package refuses to compile when using optimization, try to compile it without optimization and see if the problem goes away.

The order in which packages are installed in this chapter has to be strictly followed, to ensure that no program gets a path referring to /tools hard-wired into it. For the same reason, do not compile packages in parallel. Compiling in parallel may save you some time (especially on dual-CPU machines), but it could result in a program containing a hard-wired path to /tools, which will cause the program to stop working when that directory is removed.


About debugging symbols

Most programs and libraries are, by default, compiled with debugging symbols included (with gcc option -g).

When debugging a program or library that was compiled with debugging information included, the debugger can give you not only memory addresses but also the names of the routines and variables.

But the inclusion of these debugging symbols enlarges a program or library significantly. To get an idea of the amount of space these symbols occupy, have a look at the following:

  • a bash binary with debugging symbols: 1200 KB

  • a bash binary without debugging symbols: 480 KB

  • glibc and gcc files (/lib and /usr/lib) with debugging symbols: 87 MB

  • glibc and gcc files without debugging symbols: 16 MB

Sizes may vary a little, depending on which compiler was used and which C library. But when comparing programs with and without debugging symbols, the difference will generally be a factor between 2 and 5.

As most people will probably never use a debugger on their system software, a lot of disk space can be regained by removing these symbols .

To remove debugging symbols from a binary (which must be an a.out or ELF binary), run strip --strip-debug filename. Wildcards can be used to treat multiple files (use something like strip --strip-debug $LFS/tools/bin/*).

For your convenience, Chapter 9 includes one simple command to strip all debugging symbols from all programs and libraries on your system. Additional information on optimization can be found in the hint at http://www.linuxfromscratch.org/hints/downloads/files/optimization.txt.


Entering the chroot environment

It is time to enter the chroot environment in order to begin installing the packages we need. Before you can chroot, however, you need to become root, since only root can execute the chroot command.

Become root and run the following command to enter the chroot environment:

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

set +h

The -i option given to the env command will clear all variables of the chroot environment. After that, only the HOME, TERM, PS1 and PATH variables are set again. The TERM=$TERM construct will set the TERM variable inside chroot to the same value as outside chroot; this variable is needed for programs like vim and less to operate properly. If you need other variables present, such as CFLAGS or CXXFLAGS, this is a good place to set them again.

Also note the use of the set +h directive. This tells bash to not use it's internal path hashing. Without this directive, bash will remember paths to binaries. Since as we go thru chapter 6, we want to use our newly compiled binaries as soon as they are installed, we turn off this function.

From this point on there's no need to use the LFS variable anymore, because everything you do will be restricted to the LFS file system -- since what the shell thinks is / is actually the value of $LFS, which was passed to the chroot command.

You have to make sure all the commands in the rest of this chapter and in the following chapters are run from within the chroot environment. If you ever leave this environment for any reason (rebooting for example), you must remember to again enter chroot and mount proc (discussed later) before continuing with the installations.

Note that the bash prompt will say "I have no name!" This is normal, as the /etc/passwd file has not been created yet.


Changing ownership

Right now the /tools directory is owned by the user lfs, a user that exists only on your host system. Although you will probably want to delete the /tools directory once you have finished your LFS system, you may want to keep it around, for example to build more LFS systems. But if you keep the /tools directory as it is, you end up with files owned by a user ID without a corresponding account. This is dangerous because a user account created later on could get this same user ID and would suddenly own the /tools directory and all the files therein, thus exposing these files to possible malicious manipulation.

To avoid this issue, you could add the lfs user to your new LFS system later on when creating the /etc/passwd file, taking care to assign it the same user and group IDs as on your host system. Alternatively, you can (and the book assumes you do) assign the contents of the /tools directory to user root by running the following command:

chown -R 0:0 /tools

The command uses "0:0" instead of "root:root", because chown is unable to resolve the name "root" until the password file has been created.


Creating directories

Let's now create some structure in our LFS file system. Let's create a directory tree. Issuing the following commands will create a more or less standard tree:

mkdir -p /{bin,boot,dev/{pts,shm},etc/opt,home,lib,mnt,proc} 
mkdir -p /{root,sbin,tmp,usr/local,var,opt}
for dirname in /usr /usr/local
    do
    mkdir $dirname/{bin,etc,include,lib,sbin,share,src}
    ln -s share/{man,doc,info} $dirname
    mkdir $dirname/share/{dict,doc,info,locale,man}
    mkdir $dirname/share/{nls,misc,terminfo,zoneinfo}
    mkdir $dirname/share/man/man{1,2,3,4,5,6,7,8}
done
mkdir /var/{lock,log,mail,run,spool}
mkdir -p /var/{tmp,opt,cache,lib/misc,local}
mkdir /opt/{bin,doc,include,info}
mkdir -p /opt/{lib,man/man{1,2,3,4,5,6,7,8}}

Directories are, by default, created with permission mode 755, but this isn't desirable for all directories. We will make two changes: one to the home directory of root, and another to the directories for temporary files.

chmod 0750 /root
chmod 1777 /tmp /var/tmp

The first mode change ensures that not just anybody can enter the /root directory -- the same as a normal user would do with his or her home directory. The second mode change makes sure that any user can write to the /tmp and /var/tmp directories, but cannot remove other users' files from them. The latter is prohibited by the so-called "sticky bit" -- the highest bit in the 1777 bit mask.


FHS compliance note

We have based our directory tree on the FHS standard (available at http://www.pathname.com/fhs/). Besides the above created tree this standard stipulates the existence of /usr/local/games and /usr/share/games, but we don't much like these for a base system. However, feel free to make your system FHS-compliant. As to the structure of the /usr/local/share subdirectory, the FHS isn't precise, so we created here the directories that we think are needed.


Mounting the proc and devpts file systems

In order for certain programs to function properly, the proc and devpts file systems must be available within the chroot environment. As a file system can be mounted as many times and in as many places as you like, it's not a problem that the these file systems are already mounted on your host system -- especially so because they are virtual file systems.

The proc file system is mounted under /proc by running the following command:

mount proc /proc -t proc

The devpts file system is mounted to /dev/pts by running:

mount devpts /dev/pts -t devpts

Should this command fail with an error to the effect of:

filesystem devpts not supported by kernel

It means that your host system does not support devpts. You have two options at this point. You can either not worry about it, in which case some of the tests we will run later will fail, or you can use the following command from a terminal not in chroot to put your host's pts system into your new LFS's filesystem:

mount --bind /dev/pts $LFS/dev/pts

You might get warning messages from the mount command, such as these:

warning: can't open /etc/fstab: No such file or directory
not enough memory

Ignore these, they're just due to the fact that the system isn't installed completely yet and some files are missing. The mount itself will be successful and that's all we care about at this point.

The last error (not enough memory) doesn't always show up. It depends on your system configuration (such as the host system's Glibc version that was used to compile the mount program with).

Remember, if for any reason you stop working on your LFS, and start again later, it's important to check that these filesystems are still mounted inside the chroot environment. Otherwise, some programs might end up compiled incorrectly.


Creating essential symlinks

Some programs hard-wire paths to programs which don't exist yet. In order to satisfy these programs, we create a number of symbolic links which will be replaced by real files throughout the course of this chapter when we're installing all the software.

ln -s /tools/bin/{bash,pwd,cat,stty,echo,sed} /bin
ln -s /tools/bin/{rm,mv,chmod,chgrp} /bin
ln -s /tools/bin/{perl,msgfmt,xgettext,msgmerge,install} /usr/bin
ln -s /tools/bin/{sort,gawk,cmp} /usr/bin
ln -s /tools/lib/libgcc_s.so.1 /usr/lib
ln -s bash /bin/sh
ln -s ../usr/bin/install /bin


Creating the passwd and group files

In order for root to be able to login and for the name "root" to be recognized, there need to be relevant entries in the /etc/passwd and /etc/group files. Also, to support one of the coreutils tests, we will also create the user and group nobody, which is almost universally present on Linux computers.

Create the /etc/passwd file by running the following command:

cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
nobody:x:1000:1000:nobody:/:/bin/bash
EOF

The actual password for root (the "x" here is just a placeholder) will be set later.

Create the /etc/group file by running the following command:

cat > /etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
nobody:x:1000:
EOF

The created groups aren't part of any standard -- they are the groups that the MAKEDEV script in the next section uses. Besides the group "root", the LSB (http://www.linuxbase.org) recommends only a group "bin", with a GID of 1, be present. All other group names and GIDs can be chosen freely by the user, as well-written packages don't depend on GID numbers but use the group's name.

Lastly, we re-login to the chroot environment. User name and group name resolution will start working immediately after the /etc/passwd and /etc/group files are created, because we installed a full glibc in Chapter 5. This will get rid of the "I have no name!" prompt.

exec /tools/bin/bash +h --login 


Creating devices (Makedev-1.7)

Estimated build time:           0.1 SBU
Estimated required disk space:  50 KB

Contents of MAKEDEV

(Last checked against version 1.5.)

The MAKEDEV script creates the static device nodes which usually reside in the /dev directory. Detailed information about device nodes may be found in the Documentation/devices.txt file under the Linux kernel source tree.

MAKEDEV installs the following:



MAKEDEV Installation Dependencies

(Last checked against version 1.5.)

Bash: sh
Coreutils: chmod, chown, cp, expr, id, ln, mknod, mv, rm
Grep: grep



Creating devices

Please note that unpacking the MAKEDEV-1.7.bz2 file doesn't create a directory for you to cd into, as the file contains one shell script.

Install the MAKEDEV script:

bzcat MAKEDEV-1.7.bz2 > /dev/MAKEDEV
chmod 754 /dev/MAKEDEV

Run the script to create the device files:

cd /dev
./MAKEDEV -v generic-nopty

If a device you need is missing, try running ./MAKEDEV -v <device>. Alternatively, you may create devices via the mknod program. Please refer to the man and info pages of mknod if you need more information.


Installing Linux-2.4.22 headers

Estimated build time:           0.1 SBU
Estimated required disk space:  142 MB

Contents of Linux

(Last checked against version 2.4.18.)

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components: serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.

Linux installs the following files:


Program Files

kernel and kernel headers



Linux Installation Dependencies

(Last checked against version 2.4.17.)

Bash: sh
Binutils: ar, as, ld, nm, objcopy
Coreutils: basename, cat, cp, date, expr, ln, md5sum, mkdir, mv,
             pwd, rm, sort, stty, tail, touch, uname, whoami, yes
Findutils: find, xargs
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed



Installation of the kernel headers

We won't be compiling a new kernel yet -- we'll do that when we have finished the installation of all the packages. But as some packages need the kernel header files, we're going to unpack the kernel archive now, set it up and copy the header files so they can be found by these packages.

It is important to note that the files in the kernel source directory are not owned by root. Whenever you unpack a package as user root (like we do here inside chroot), the files end up having the user and group IDs of whatever they were on the packager's computer. This is usually not a problem for any other package you install because you remove the source tree after the installation. But the Linux kernel source tree is often kept around for a long time, so there's a chance that whatever user ID the packager used will be assigned to somebody on your machine and then that person would have write access to the kernel source.

In light of this, you might want to run chown -R 0:0 on the linux-2.4.22 directory to ensure all files are owned by user root.

Prepare for header installation:

make mrproper

This ensures that the kernel tree is absolutely clean. The kernel team recommends that this command be issued prior to each kernel compilation. You shouldn't rely on the source tree being clean after untarring.

Create the include/linux/version.h file:

make include/linux/version.h

Create the platform-specific include/asm symlink:

make symlinks

Install the platform specific-header files:

cp -HR include/asm /usr/include
cp -R include/asm-generic /usr/include

Install the cross-platform kernel header files:

cp -R include/linux /usr/include

There are a few kernel header files which make use of the autoconf.h header file. Since we do not yet configure the kernel, we need to create this file ourselves in order to avoid compilation failures. Create an empty autoconf.h file:

touch /usr/include/linux/autoconf.h



Why we copy the kernel headers and don't symlink them

In the past it was common practice to symlink the /usr/include/{linux,asm} directories to /usr/src/linux/include/{linux,asm}. This was a bad practice, as the following extract from a post by Linus Torvalds to the Linux Kernel Mailing List points out:

I would suggest that people who compile new kernels should: 

 - not have a single symbolic link in sight (except the one that the 
   kernel build itself sets up, namely the "linux/include/asm" symlink 
   that is only used for the internal kernel compile itself) 

And yes, this is what I do. My /usr/src/linux still has the old 2.2.13 
header files, even though I haven't run a 2.2.13 kernel in a _loong_ 
time. But those headers were what glibc was compiled against, so those 
headers are what matches the library object files. 

And this is actually what has been the suggested environment for at 
least the last five years. I don't know why the symlink business keeps 
on living on, like a bad zombie. Pretty much every distribution still 
has that broken symlink, and people still remember that the linux 
sources should go into "/usr/src/linux" even though that hasn't been 
true in a _loong_ time.

The essential part is where Linus states that the header files should be the ones which glibc was compiled against. These are the headers that should be used when you later compile other packages, as they are the ones that match the object-code library files. By copying the headers, we ensure that they remain available if later you upgrade your kernel.

Note, by the way, that it is perfectly all right to have the kernel sources in /usr/src/linux, as long as you don't have the /usr/include/{linux,asm} symlinks.


Installing Man-pages-1.60

Estimated build time:           0.1 SBU
Estimated required disk space:  6 MB

Contents of Man-pages

(Last checked against version 1.54.)

The Man-pages package contains over 1200 manual pages. This documentation details the C and C++ functions, describes a few important device files and provides documents which would otherwise be missing from other packages.

Man-pages installs the following:


Support Files

Various manual pages.



Man-pages Installation Dependencies

(Last checked against version 1.47.)

Bash: sh
Coreutils: install
Make: make



Installation of Man-pages

Install Man-pages by running:

make install


Installing Glibc-2.3.2

Estimated build time:           14.0 SBU
Estimated required disk space:  369 MB

Contents of Glibc

(Last checked against version 2.2.5.)

Glibc is the C library that provides the system calls and basic functions such as open, malloc, printf, etc. The C library is used by all dynamically linked programs.

Glibc installs the following files:


Program Files

catchsegv, gencat, getconf, getent, glibcbug, iconv, iconvconfig, ldconfig, ldd, lddlibc4, locale, localedef, mtrace, nscd, nscd_nischeck, pcprofiledump, pt_chown, rpcgen, rpcinfo, sln, sprof, tzselect, xtrace, zdump and zic


Library Files

ld.so, libBrokenLocale.[a,so], libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so], libc_nonshared.a, libcrypt.[a,so], libdl.[a,so], libg.a, libieee.a, libm.[a,so], libmcheck.a, libmemusage.so, libnsl.a, libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.[a,so], libresolv.[a,so], librpcsvc.a, librt.[a,so], libthread_db.so and libutil.[a,so]



Glibc Installation Dependencies

(Last checked against version 2.2.5.)

Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Coreutils: cat, chmod, cp, cut, date, expr, hostname, install, ln,
             mknod, mv, mkdir, rm, pwd, sort, touch, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Glibc installation

The Glibc build system is very well self-contained and will install perfectly, even though our compiler specs file and linker are still pointing at /tools. We cannot adjust the specs and linker before the Glibc install, because the Glibc autoconf tests would then give bogus results and thus defeat our goal of achieving a clean build.

Note: The testsuite for Glibc in this chapter is considered critical. Do not skip it under any circumstances.

Before starting to build Glibc, remember to unpack the Glibc-linuxthreads again inside the glibc-2.3.2 directory, and to unset any environment variables that override the default optimization flags.

Then apply the same patch we used previously:

patch -Np1 -i ../glibc-2.3.2-sscanf-1.patch

The documentation that comes with Glibc recommends to build the package not in the source directory but in a separate, dedicated directory:

mkdir ../glibc-build
cd ../glibc-build

Now prepare Glibc for compilation:

../glibc-2.3.2/configure --prefix=/usr \
    --disable-profile --enable-add-ons \
    --libexecdir=/usr/bin --with-headers=/usr/include

The meaning of the configure options:

  • --disable-profile: This disables the building of the libraries with profiling information. Omit this option if you plan to do profiling.

  • --enable-add-ons: This enables any add-ons that we installed with Glibc, in our case Linuxthreads.

  • --libexecdir=/usr/bin: This will cause the pt_chown program to be installed in the /usr/bin directory.

  • --with-headers=/usr/include: This ensures that the kernel headers in /usr/include are used for this build. If you don't pass this switch then the headers from /tools/include are used which of course is not ideal (although they should be identical). Using the switch has the advantage that you will be informed immediately should you have forgotten to install the kernel headers into /usr/include.

Compile the package:

make

Test the results:

make check

And install the package:

make install

The locales that can make your system respond in a different language weren't installed by the above command. Do it with this:

make localedata/install-locales

An alternative to running the previous command is to install only those locales which you need or want. This can be achieved using the localedef command. Information on this can be found in the INSTALL file in the glibc-2.3.2 tree. However, there are a number of locales that are essential for the tests of future packages to pass correctly. The following instructions, in place of the install-locales command above, will install the minimum set of locales necessary for the tests to run successfully:

mkdir -p /usr/lib/locale
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i ja_JP -f EUC-JP ja_JP

Finally, build the linuxthreads man pages:

make -C ../glibc-2.3.2/linuxthreads/man

And install these pages:

make -C ../glibc-2.3.2/linuxthreads/man install



Configuring Glibc

We need to create the /etc/nsswitch.conf file, because, although Glibc provides defaults when this file is missing or corrupt, the Glibc defaults don't work well with networking. Also, our timezone needs to be set up.

Create a new file /etc/nsswitch.conf by running the following:

cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: db files

# End /etc/nsswitch.conf
EOF

To find out what timezone you're in, run the following script:

tzselect

When you've answered a few questions about your location, the script will output the name of your timezone, something like EST5EDT or Canada/Eastern. Then create the /etc/localtime file by running:

cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime 

Of course, instead of Canada/Eastern, fill in the name of the timezone that the tzselect script gave you.



Configuring Dynamic Loader

By default, the dynamic loader (/lib/ld-linux.so.2) searches through /lib and /usr/lib for dynamic libraries that are needed by programs when you run them. However, if there are libraries in directories other than /lib and /usr/lib, you need to add them to the /etc/ld.so.conf file for the dynamic loader to find them. Two directories that are commonly known to contain additional libraries are /usr/local/lib and /opt/lib, so we add those directories to the dynamic loader's search path.

Create a new file /etc/ld.so.conf by running the following:

cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf

/usr/local/lib
/opt/lib

# End /etc/ld.so.conf
EOF


Re-adjusting the toolchain

Now that the new C libraries have been installed, it's time to re-adjust our toolchain. We'll adjust it so that it will link any newly compiled program against the new C libraries. Basically, this is the reverse of what we did in the "Locking in" stage in the beginning of the previous chapter.

The first thing to do is to adjust the linker. For this we retained the source and build directories from the second pass over Binutils. Install the adjusted linker by running the following from within the binutils-build directory:

make -C ld install

From now on every compiled program will link only against the libraries in /usr/lib and /lib .

You can now remove the Binutils source and build directories.

The next thing to do is to amend our GCC specs file so that it points to the new dynamic linker. Just like earlier on, we use a sed to accomplish this:

SPECFILE=/tools/lib/gcc-lib/*/*/specs
sed -e 's@/tools/lib/ld.so.1@/lib/ld.so.1@g' \
    -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \
    $SPECFILE > newspecfile
mv newspecfile $SPECFILE
unset SPECFILE

Again, cutting and pasting the above is recommended. And just like before, it is a good idea to check the specs file to ensure the intended changes were actually made.

Caution

It is imperative at this point to stop and ensure that the basic functionality of the adjusted toolchain is working as expected. We are going to perform a simple sanity check:

echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /lib'

If everything is working correctly, the output of the last command will be:

[Requesting program interpreter: /lib/ld-linux.so.2]

If you did not receive the output as shown above then something is seriously wrong. You will need to investigate and retrace your steps to find out where the problem is and correct it. There is no point in continuing until this is done. Most likely, something went wrong with the specs file amendment above. Note especially that /lib now appears as the prefix of our dynamic linker. Of course, if you are working on a platform where the name of the dynamic linker is something other than ld-linux.so.2 then the output will be slightly different.

Once you are satisfied that all is well, clean up the test files:

rm dummy.c a.out


Installing Binutils-2.14

Estimated build time:           1.4 SBU
Estimated required disk space:  94 MB

Contents of Binutils

(Last checked against version 2.12.1.)

Binutils is a collection of software development tools containing a linker, assembler and other tools to work with object files and archives.

Binutils installs the following files:


Program Files

addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip


Library Files

libbfd.[a,so] and libopcodes.[a,so]



Binutils Installation Dependencies

(Last checked against version 2.11.2.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, ln, ls, mkdir
             mv, rm, rmdir, sleep, sort, touch, tr, true, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Binutils

Note: The testsuite for Binutils in this chapter is considered critical. Do not skip it under any circumstances.

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building Binutils.

It is recommended by the Binutils installation documentation to build Binutils outside of the source directory:

mkdir ../binutils-build
cd ../binutils-build

Now prepare Binutils for compilation:

../binutils-2.14/configure \
    --prefix=/usr --enable-shared

Compile the package:

make tooldir=/usr

Normally, the tooldir (the directory where the executables end up) is set to $(exec_prefix)/$(target_alias), which expands into, for example, /usr/i686-pc-linux-gnu. Since we only build for our own system, we don't need this target specific directory in /usr. That setup would be used if the system was used to cross-compile (for example compiling a package on an Intel machine that generates code that can be executed on PowerPC machines).

Test the results:

make check

Install the package:

make tooldir=/usr install

Install the libiberty header file that is needed by some packages:

cp ../binutils-2.14/include/libiberty.h /usr/include


Installing GCC-3.3.1

Estimated build time:           11.7 SBU
Estimated required disk space:  221 MB

Contents of GCC

(Last checked against version 3.1.)

The GCC package contains the GNU compiler collection, including the C and C++ compilers.

GCC installs the following files:


Program Files

c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0


Library Files

libgcc.a, libgcc_eh.a, libgcc_s.so, libiberty.a, libstdc++.[a,so], libsupc++.a



GCC Installation Dependencies

(Last checked against version 2.95.3.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib
Coreutils: basename, cat, chmod, cp, dirname, echo, expr, hostname, ln
             ls, mkdir, mv, rm, sleep, tail, touch, tr, true, uname
Diffutils: cmp
Find: find
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo



Installation of GCC

Note: The testsuite for GCC in this chapter is considered critical. Do not skip it under any circumstances.

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building GCC.

This time we will build both the C and the C++ compiler, so you'll have to unpack the GCC-core and the GCC-g++ tarball -- they will unfold into the same directory. You should likewise extract the GCC-testsuite package. The full GCC package contains even more compilers. Instructions for building these can be found at http://www.linuxfromscratch.org/blfs/view/cvs/general/gcc.html.

patch -Np1 -i ../gcc-3.3.1-no_fixincludes-2.patch
patch -Np1 -i ../gcc-3.3.1-suppress-libiberty.patch

The second patch here suppresses the installation of libiberty from GCC, as we will use the one provided by binutils instead.

GCC's installation documentation recommends to build the package in a dedicated directory separate from the source tree. Create this build directory and go there:

mkdir ../gcc-build
cd ../gcc-build

Now prepare GCC for compilation:

../gcc-3.3.1/configure --prefix=/usr \
    --enable-shared --enable-threads=posix \
    --enable-__cxa_atexit --enable-clocale=gnu \
    --enable-languages=c,c++

The meaning of the new configure options:

  • --enable-threads=posix: This enables C++ exception handling for multi-threaded code.

  • --enable-__cxa_atexit: This option will result in C++ shared libraries and C++ programs that are interoperable with other Linux distributions.

  • --enable-clocale=gnu: There is a risk that some people will build ABI incompatible C++ libraries if they didn't install all of the glibc localedata. Using --enable-clocale=gnu ensures that the "right thing" is done in all cases. If you don't wish to use this option, then at least build the de_DE locale. When GCC finds this specific locale, then the correct locale mode (gnu) is implemented.

Compile the package:

make

Test the results, but don't stop at errors (you'll remember the few known ones):

make -k check

And install the package:

make install

Some packages expect the C PreProcessor to be installed in the /lib directory. To honor those packages, create this symlink:

ln -s ../usr/bin/cpp /lib

Many packages use the name cc to call the C compiler. To satisfy those packages, create a symlink:

ln -s gcc /usr/bin/cc


Installing Coreutils-5.0

Estimated build time:           0.5 SBU
Estimated required disk space:  15 MB

Contents of Coreutils

The Coreutils package contains a whole series of basic shell utilities.

Coreutils installs the following:


Program Files

basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, head, hostid, hostname, id, install, join, kill, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, sleep, sort, split, stat, stty, su, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami, yes



Coreutils Installation Dependencies

Not yet checked but probably something like this:

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, chown, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo



Installation of Coreutils

Normally the functionality of uname is somewhat broken, in that the -p switch always returns "unknown". The following patch fixes this behaviour for Intel architectures:

patch -Np1 -i ../coreutils-5.0-uname.patch

We do not want Coreutils to install its version of the hostname program, because it is inferior to the version provided by Net-tools. Prevent its installation by applying a patch:

patch -Np1 -i ../coreutils-5.0-hostname-2.patch

Now prepare Coreutils for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following commands will do so:

make check-root
make RUN_EXPENSIVE_TESTS=yes check

Install the package:

make install

And move some programs to their proper locations:

mv /usr/bin/{basename,cat,chgrp,chmod,chown,cp,dd,df} /bin
mv /usr/bin/{dir,dircolors,du,date,echo,false,head} /bin
mv /usr/bin/{install,ln,ls,mkdir,mkfifo,mknod,mv,pwd} /bin
mv /usr/bin/{rm,rmdir,shred,sync,sleep,stty,su,test} /bin
mv /usr/bin/{touch,true,uname,vdir} /bin
mv /usr/bin/chroot /usr/sbin

Finally, create a few necessary symlinks:

ln -s test /bin/[
ln -s ../../bin/install /usr/bin


Installing Zlib-1.1.4

Estimated build time:           0.1 SBU
Estimated required disk space:  1 MB

Contents of Zlib

(Last checked against version 1.1.4.)

The Zlib package contains the zlib library, which is used by many programs for its compression and uncompression functions.

Zlib installs the following:


Library Files

libz[a,so]



Zlib Installation Dependencies

(No dependencies checked yet.)



Installation of Zlib

Zlib has a potential buffer overflow in its gzprintf() function, that, though difficult to take advantage of, should be taken care of. Do so by applying this patch:

patch -Np1 -i ../zlib-1.1.4-vsnprintf.patch

Now prepare Zlib for compilation:

./configure --prefix=/usr --shared

Note: Zlib is known to build its shared library incorrectly if a CFLAGS is specified in the environment. If you are using your own CFLAGS variables, ensure you add the -fPIC directive during this stage, and remove it afterwards.

Compile the package:

make

Install the shared libraries:

make install

Now also build the non-shared libraries:

make clean
./configure --prefix=/usr
make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make test

And install the package:

make install

The shared Zlib library should be installed in the /lib directory. That way, in the event that you must boot without the /usr directory, vital system programs will still have access to the library:

mv /usr/lib/libz.so.* /lib

The /usr/lib/libz.so symlink is linked to a file which no longer exists, because we moved it. Create a symbolic link to the new location of the library:

ln -sf ../../lib/libz.so.1 /usr/lib/libz.so

Zlib does not install its manual page. Issue the following command to install this documentation:

cp zlib.3 /usr/share/man/man3


Installing Lfs-Utils-0.3

Estimated build time:           0.1 SBU
Estimated required disk space:  610 KB

Contents of Lfs-Utils

(Last checked against version 0.2.2.)

The Lfs-Utils package contains some miscellaneous programs used by various packages, but are not large enough to warrant their own individual package.

Lfs-Utils installs the following:


Program Files

mktemp, tempfile, http-get, iana-net



Lfs-Utils Installation Dependencies

(No dependencies checked yet.)



Installation of Lfs-Utils

Compile the package:

make

And install it:

make install


Installing Findutils-4.1.20

Estimated build time:           0.2 SBU
Estimated required disk space:  3 MB

Contents of Findutils

(Last checked against version 4.1.)

The Findutils package contains programs to find files, either on-the-fly (by doing a live recursive search through directories and only showing files that match the specifications) or by searching through a database.

Findutils installs the following:


Program Files

bigram, code, find, frcode, locate, updatedb and xargs



Findutils Installation Dependencies

(Last checked against version 4.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, hostname, install, mv, rm, tr
Diffutils: cmp
Grep: egrep, grep
GCC: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed



Installing Findutils

Prepare Findutils for compilation:

./configure --prefix=/usr --libexecdir=/usr/bin

By default, the location of the updatedb database is in /usr/var. To make the location of /var/lib/misc/locatedb file FHS compliant, pass the --localstatedir=/var/lib/misc option to configure.

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Gawk-3.1.3

Estimated build time:           0.2 SBU
Estimated required disk space:  15 MB

Contents of Gawk

(Last checked against version 3.1.1.)

Gawk is an awk implementation that is used to manipulate text files.

Gawk installs the following:


Program Files

awk, gawk, gawk-3.1.1, grcat, igawk, pgawk, pgawk-3.1.1, pwcat



Gawk Installation Dependencies

(No dependencies checked yet.)



Installation of Gawk

Before installing the Gawk package you have to apply a patch, which fixes the following issues:

  • Gawk's default location for libexecdir is $prefix/libexecdir/awk. This location doesn't comply with FHS (which never mentions a directory called libexecdir).

  • The patch allows us to pass --libexecdir to the configure script (without gawk tacking on /awk to the end), so that we can use a more appropriate location for gawk's libexecdir (/usr/bin in the book).

  • The default data directory for gawk is $prefix/share/awk. A package specific directory should be named using the package and version (like gawk-3.1.3 instead of awk) because there may be more than one awk interpreter on a system (and more than one version of gawk). The patch changes this to $prefix/share/gawk-3.1.3 to be more correct.

  • The patch ensures that this directory ($prefix/share/gawk-3.1.3) is removed along with its contents on a make uninstall.

patch -Np1 -i ../gawk-3.1.3.patch

Now prepare Gawk for compilation:

./configure --prefix=/usr --libexecdir=/usr/bin

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Ncurses-5.3

Estimated build time:           0.7 SBU
Estimated required disk space:  22 MB

Contents of Ncurses

(Last checked against version 5.2.)

The Ncurses package provides character and terminal handling libraries, including panels and menus.

Ncurses installs the following:


Program Files

captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput and tset.


Library Files

libcurses.[a,so] (link to libncurses.[a,so]), libform.[a,so], libform_g.a, libmenu.[a,so], libmenu_g.a, libncurses++.a, libncurses.[a,so], libncurses_g.a, libpanel.[a,so] and libpanel_g.a



Ncurses Installation Dependencies

(Last checked against version 5.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, expr, hostname, install,
             ln, mkdir, mv, rm, sort, tr, uname, wc
Diffutils: cmp
Gawk: gawk
GCC: c++, cc1, cc1plus, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed



Installation of Ncurses

First fix two tiny bugs:

patch -Np1 -i ../ncurses-5.3-etip-2.patch
patch -Np1 -i ../ncurses-5.3-vsscanf.patch

The first patch corrects the etip.h header file, and the second patch prevents some compiler warnings on the use of deprecated headers.

Now prepare Ncurses for compilation:

./configure --prefix=/usr --with-shared \
    --without-debug

Compile the package:

make

Install the package:

make install

Give the Ncurses libraries execute permissions:

chmod 755 /usr/lib/*.5.3

And fix a library that shouldn't be executable:

chmod 644 /usr/lib/libncurses++.a

Move the libraries to the /lib directory, where they're expected to reside:

mv /usr/lib/libncurses.so.5* /lib

Since the libraries have been moved to /lib, a few symlinks are currently pointing towards non-existing files. Recreate those symlinks:

ln -sf ../../lib/libncurses.so.5 /usr/lib/libncurses.so
ln -sf libncurses.so /usr/lib/libcurses.so


Installing Vim-6.2

Estimated build time:           0.4 SBU
Estimated required disk space:  24 MB

Contents of Vim

(Last checked against version 6.1.)

The Vim package contains a configurable text editor built to enable efficient text editing.

Vim installs the following:


Program Files

efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor and xxd



Vim Installation Dependencies

(Last checked against version 6.0.)

Bash: sh
Binutils: as, ld, strip
Coreutils: cat, chmod, cp, echo, expr, ln, mkdir, mv, rm, touch, tr,
             uname, wc, whoami
Diffutils: cmp, diff
Find: find
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Net-tools: hostname
Sed: sed



Installation of Vim

Change the default locations of the vimrc and gvimrc files to /etc.

echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h

Now prepare Vim for compilation:

./configure --prefix=/usr

Compile the package:

make

And install the package:

make install

Vim can run in old-fashioned vi mode by creating a symlink, which may be created with the following command:

ln -s vim /usr/bin/vi

If you plan to install the X Window system on your LFS system, you might want to re-compile Vim after you have installed X. Vim comes with a nice GUI version of the editor which requires X and a few other libraries to be installed. For more information read the Vim documentation.



Configuring Vim

By default, vim runs in vi compatible mode. Some people might like this, but we have a high preference to run vim in vim mode (else we wouldn't have included vim in this book, but the original vi). Create the /root/.vimrc by running the following:

cat > /root/.vimrc << "EOF"
" Begin /root/.vimrc

set nocompatible
set bs=2

" End /root/.vimrc
EOF


Installing M4-1.4

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of M4

(Last checked against version 1.4.)

M4 is a macro processor. It copies input to output, expanding macros as it goes. Macros are either built-in or user-defined and can take any number of arguments. Besides just doing macro expansion, m4 has built-in functions for including named files, running Unix commands, doing integer arithmetic, manipulating text in various ways, recursion, etc. The m4 program can be used either as a front-end to a compiler or as a macro processor in its own right.

M4 installs the following:



M4 Installation Dependencies

(Last checked against version 1.4.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, cp, date, echo, hostname, install, mv, rm, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of M4

Prepare M4 for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Bison-1.875

Estimated build time:           0.6 SBU
Estimated required disk space:  6 MB

Contents of Bison

(Last checked against version 1.35.)

Bison is a parser generator, a replacement for yacc. Bison generates a program that analyzes the structure of a text file.

Bison installs the following:


Program Files

bison and yacc



Bison Installation Dependencies

(Last checked against version 1.31.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, dirname, echo, expr, head, hostname,
             install, ln, ls, mkdir, mv, rm, rmdir, sleep, tr, uname, uniq
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info



Installation of Bison

First we use a patch to bison, backported from CVS, which fixes a minor compilation problem with some packages:

patch -Np1 -i ../bison-1.875-attribute.patch

Prepare Bison for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Less-381

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Less

(Last checked against version 374.)

Less is a file pager, or text viewer. It displays the contents of a file, or stream, and has the ability to scroll. Less has a few features not included in the more pager, such as the ability to scroll backwards.

Less installs the following:


Program Files

less, lessecho and lesskey



Less Installation Dependencies

(Last checked against version 358.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, expr, hostname, install, mv, rm, touch, tr, uname
Diffutils: cmp
Grep: egrep, grep
GCC: cc1, collect2, cpp0, gcc
Ncurses: (libraries)
Make: make
Sed: sed



Installation of Less

Prepare Less for compilation:

./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc

Compile the package:

make

And install it:

make install


Installing Groff-1.19

Estimated build time:           0.4 SBU
Estimated required disk space:  18 MB

Contents of Groff

(Last checked against version 1.17.2.)

The Groff package includes several text processing programs for text formatting. Groff translates standard text and special commands into formatted output, such as what you see in a manual page.

Groff installs the following:


Program Files

addftinfo, afmtodit, eqn, geqn (link to eqn), grn, grodvi, groff, grog, grolbp, grolj4, grops, grotty, gtbl (link to tbl), hpftodit, indxbib, lkbib, lookbib, mmroff, neqn, nroff, pfbtops, pic, post-grohtml, pre-grohtml, refer, soelim, tbl, tfmtodit, troff and zsoelim (link to soelim)



Groff Installation Dependencies

(Last checked against version 1.17.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Coreutils: basename, cat, chmod, cp, date, echo, expr, hostname, install,
             ln, ls, mkdir, mv, rm, touch, tr, uname
Diffutils: cmp
Gawk: awk
GCC: cc1, cc1plus, collect2, cpp0, g++, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Groff

Groff expects the environment variable PAGE to contain the default paper size. For those in the United States, the command below is appropriate. If you live elsewhere, you may want to change PAGE=letter to PAGE=A4.

Prepare Groff for compilation:

PAGE=letter ./configure --prefix=/usr

Compile the package:

make

And install it:

make install

Some documentation programs, such as xman, will not work work properly without the following symlinks:

ln -s soelim /usr/bin/zsoelim
ln -s eqn /usr/bin/geqn
ln -s tbl /usr/bin/gtbl


Installing Sed-4.0.7

Estimated build time:           0.2 SBU
Estimated required disk space:  2 MB

Contents of Sed

(Last checked against version 3.02.)

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).

Sed installs the following:



Sed Installation Dependencies

(Last checked against version 3.02.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, expr, hostname, install, ls, mv, rm, echo, sleep, tr
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Sed

Prepare Sed for compilation:

./configure --prefix=/usr --bindir=/bin

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Flex-2.5.4a

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of Flex

(Last checked against version 2.5.4a.)

The Flex package is used to generate programs which recognize patterns in text.

Flex installs the following:


Program Files

flex, flex++ (link to flex) and lex



Flex Installation Dependencies

(Last checked against version 2.5.4a.)

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Coreutils: cat, chmod, cp, echo, hostname, install, ln, mv, rm, touch, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Flex

Prepare Flex for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make bigcheck

And install the package:

make install

There are some packages that expect to find the Lex library in /usr/lib. Create a symlink to account for this:

ln -s libfl.a /usr/lib/libl.a

A few programs don't know about flex yet and try to run its predecessor lex. To support those programs, create a shell script named lex that calls flex in Lex emulation mode:

cat > /usr/bin/lex << "EOF"
#!/bin/sh
# Begin /usr/bin/lex

exec /usr/bin/flex -l "$@"

# End /usr/bin/lex
EOF
chmod 755 /usr/bin/lex


Installing Gettext-0.12.1

Estimated build time:           5.4 SBU
Estimated required disk space:  39 MB

Contents of Gettext

(Last checked against version 0.11.2.)

The Gettext package is used for internationalization and localization. Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the user's native language.

Gettext installs the following:


Program Files

config.charset, config.rpath, gettext, gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, ngettext, project-id, team-address, trigger, urlget, user-email and xgettext


Library Files

libgettextlib[a,so], libgettextsrc[a,so]



Gettext Installation Dependencies

(Last checked against version 0.10.40.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Bison: bison
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln,
             ls, mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Gettext

Prepare Gettext for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Net-tools-1.60

Estimated build time:           0.1 SBU
Estimated required disk space:  5 MB

Contents of Net-tools

(Last checked against version 1.60.)

The Net-tools package contains a collection of programs which form the base of Linux networking.

Net-tools installs the following:


Program Files

arp, dnsdomainname (link to hostname), domainname (link to hostname), hostname, ifconfig, nameif, netstat, nisdomainname (link to hostname), plipconfig, rarp, route, slattach and ypdomainname (link to hostname)



Net-tools Installation Dependencies

(Last checked against version 1.60.)

Bash: bash, sh
Binutils: ar, as, ld
Coreutils: echo, install, ln, ls, mv, rm
GCC: cc, cc1, collect2, cpp0
Make: make



Installation of Net-tools

If you don't know what to answer to all the questions asked during the make config phase below, then just accept the defaults. This will be just fine in the majority of cases. What you're asked here is a bunch of questions about which network protocols you've enabled in your kernel. The default answers will enable the tools from this package to work with the most common protocols: TCP, PPP, and several others. You still need to actually enable these protocols in the kernel -- what you do here is merely telling the package to include support for those protocols in its programs, but it's up to the kernel to make the protocols available.

Prepare Net-tools for compilation with:

make config

If you intend to accept the default settings, you may skip the questions generated by make config by running yes "" | make config instead.

Compile the package:

make

And install it:

make update


Installing Inetutils-1.4.2

Estimated build time:           0.3 SBU
Estimated required disk space:  (to be determined)

Contents of Inetutils

(Last checked against version 1.4.2.)

The Inetutils package contains network clients and servers.

Inetutils installs the following:


Program Files

ftp, ping, rcp, rlogin, rsh, talk, telnet, tftp, whois, ftpd, inetd, rexecd, rlogind, rshd, talkd, telnetd, tftpd, uucpd



Inetutils Installation Dependencies

(No dependencies checked yet.)



Installation of Inetutils

Prepare Inetutils for compilation:

./configure --prefix=/usr --disable-syslogd \
    --libexecdir=/usr/sbin --disable-logger \
    --sysconfdir=/etc --localstatedir=/var \
    --disable-whois --disable-servers

The meaning of the configure options:

  • --disable-syslogd: This option prevents inetutils from installing the System Log Daemon, which is installed with the Sysklogd package.

  • --disable-logger: This option prevents inetutils from installing the logger program, which is used by scripts to pass messages to the System Log Daemon. We do not install it because Util-linux installs a better version later.

  • --sysconfdir=/etc: This option tells the binaries created by the package to look in /etc for their configuration files

  • --disable-whois: This option disables the building of the inetutils whois client, which is woefully out of date. Instructions for a better whois client are in the BLFS book.

  • --disable-servers: This disables the compilation of the various server utilities included as part of the Inetutils package. Many of these have known security vulnerabilities, and for most there are better replacements.

Compile the package:

make

Install it:

make install

And move the ping program to its proper place:

mv /usr/bin/ping /bin


Setting up Basic Networking

Here will be set up basic networking now that all the necessary software has been installed. There isn't all that much to do, really, just creating a basic /etc/hosts file, and downloading some high-quality network information files.

The first step is to create /etc/hosts. This file contains information allowing resolution of host names to IP addresses. Create a very basic one (we'll make a better one later) with the following command:

echo "127.0.0.1 $(hostname) localhost" > /etc/hosts

Now unpack the Lfs-Utils tarball again, as we're going to copy two necessary files from it. One is /etc/services, which is used to resolve service numbers to human-readable names, and the other is /etc/protocols, which does the same for protocol numbers. Copy them with the following command after you have entered the Lfs-Utils directory:

cp -f etc/{services,protocols} /etc


Installing Perl-5.8.0

Estimated build time:           2.7 SBU
Estimated required disk space:  52 MB

Contents of Perl

(Last checked against version 5.6.1.)

The Perl package contains perl, the Practical Extraction and Report Language. Perl combines some of the best features of C, sed, awk and sh into one powerful language.

Perl installs the following:


Program files and libraries

a2p, c2ph, dprofpp, find2perl, h2ph, h2xs, perl, perl5.6.1, perlbug, perlcc, perldoc, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, podchecker, podselect, pstruct, s2p, splain,attrs.so, B.so, ByteLoader.so, DProf.so, Dumper.so, DynaLoader.a, Fcntl.so, Glob.so, Hostname.so, IO.so, libperl.a, Opcode.so, Peek.so, POSIX.so, re.so, SDBM_File.so, Socket.so, Syslog.so and SysV.so



Perl Installation Dependencies

(Last checked against version 5.6.1.)

Bash: sh
Binutils: ar, as, ld, nm
Coreutils: basename, cat, chmod, comm, cp, date, echo, expr, hostname, ln,
             ls, mkdir, mv, pwd, rm, sort, split, touch, tr, uname, wc,
             whoami, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Perl

Prepare Perl for compilation:

./configure.gnu --prefix=/usr

If you want more control over the way Perl sets itself up to be built, you can run the interactive Configure script instead and modify the way Perl is built. If you think you can live with the (sensible) defaults Perl auto-detects, then just use the command listed above.

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make test

And install the package:

make install


Installing Texinfo-4.6

Estimated build time:           0.2 SBU
Estimated required disk space:  12 MB

Contents of Texinfo

(Last checked against version 4.2.)

The Texinfo package contains programs used for reading, writing and converting Info documents, which provide system documentation.

Texinfo installs the following:


Program Files

info, infokey, install-info, makeinfo, texi2dvi and texindex



Texinfo Installation Dependencies

(Last checked against version 4.0.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln, ls,
             mkdir, mv, rm, sleep, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: makeinfo



Installation of Texinfo

Prepare Texinfo for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Install the package:

make install

And install the components belonging in a TeX installation:

make TEXMF=/usr/share/texmf install-tex


Installing Autoconf-2.57

Estimated build time:           2.3 SBU
Estimated required disk space:  6 MB

Contents of Autoconf

(Last checked against version 2.53.)

Autoconf produces shell scripts which automatically configure source code.

Autoconf installs the following:


Program Files

autoconf, autoheader, autom4te, autoreconf, autoscan, autoupdate and ifnames



Autoconf Installation Dependencies

(Last checked against version 2.52.)

Bash: sh
Coreutils: cat, chmod, echo, expr, hostname, install,
             sleep, uname, ln, ls, mkdir, mv, rm, tr
Diffutils: cmp
Gawk: gawk
Grep: fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info



Installation of Autoconf

Prepare Autoconf for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Automake-1.7.6

Estimated build time:           4.1 SBU
Estimated required disk space:  6 MB

Contents of Automake

(Last checked against version 1.6.2.)

Automake generates Makefile.in files, intended for use with Autoconf.

Automake installs the following:


Program Files

acinstall, aclocal, aclocal-1.6, automake, automake-1.6, compile, config.guess, config.sub, depcomp, elisp-comp, install-sh, mdate-sh, missing, mkinstalldirs, py-compile, ylwrap



Automake Installation Dependencies

(Last checked against version 1.5.)

Bash: sh
Coreutils: cat, chmod, echo, expr, hostname, install, ls, mkdir,
             mv, rm, rmdir, sleep, tr
Diffutils: cmp
Grep: fgrep, grep
Make: make
Perl: perl
Sed: sed
Texinfo: install-info



Installation of Automake

Prepare Automake for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Install the package:

make install

And create a necessary symbolic link:

ln -s automake-1.7 /usr/share/automake


Installing Bash-2.05b

Estimated build time:           0.8 SBU
Estimated required disk space:  14 MB

Contents of Bash

(Last checked against version 2.05a.)

bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. The bash program reads from standard input (the keyboard). A user types something and the program will evaluate what he has typed and do something with it, like running a program.

Bash installs the following files:


Program Files

bash, sh (link to bash) and bashbug



Bash Installation Dependencies

(Last checked against version 2.05a.)

Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, install,
             ln, ls, mkdir, mv, rm, sleep, tr, uname, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Ncurses: (libraries)
Sed: sed
Texinfo: install-info



Installation of Bash

Bash has a number of bugs in it that cause it to not behave the way it is expected at times. Fix this behaviour with the following patch:

patch -Np1 -i ../bash-2.05b-2.patch

Prepare Bash for compilation:

./configure --prefix=/usr --bindir=/bin

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make tests

Install the package:

make install

And reload the newly compiled bash program:

exec /bin/bash +h --login


Installing File-4.04

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of File

(Last checked against version 3.39.)

File is a utility used to determine file types.

File installs the following:



File Installation Dependencies

(Last checked against version 3.37.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, echo, expr, hostname, install, ln, ls, mv, rm,
             sleep, touch, tr
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: makeinfo



Installation of File

Prepare File for compilation:

./configure --prefix=/usr --datadir=/usr/share/misc

Compile the package:

make

And install it:

make install


Installing Libtool-1.5

Estimated build time:           1.1 SBU
Estimated required disk space:  7 MB

Contents of Libtool

(Last checked against version 1.4.2.)

GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface.

Libtool installs the following:


Program Files

libtool and libtoolize


Library Files

libltdl.a, libltdl.so (link to libltdl.so.3.1.0), libltdl.so.3 (link to libltdl.so.3.1.0) and libltdl.so.3.1.0



Libtool Installation Dependencies

(Last checked against version 1.4.2.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Coreutils: cat, chmod, cp, echo, expr, hostname, install, ln, ls,
             mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info



Installation of Libtool

Prepare Libtool for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Bzip2-1.0.2

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of Bzip2

(Last checked against version 1.0.2.)

Bzip2 is a block-sorting file compressor which generally achieves a better compression than the traditional gzip does.

Bzip2 installs the following files:


Program Files

bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore


Library Files

libbz2.a, libbz2.so (link to libbz2.so.1.0), libbz2.so.1.0 (link to libbz2.so.1.0.2) and libbz2.so.1.0.2



Bzip2 Installation Dependencies

(Last checked against version 1.0.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cp, ln, rm
GCC: cc1, collect2, cpp0, gcc
Make: make



Installation of Bzip2

Prepare Bzip2 for compilation with:

make -f Makefile-libbz2_so
make clean

The -f flag will cause Bzip2 to be built using a different Makefile file, in this case the Makefile-libbz2_so file, which creates a dynamic libbz2.so library and links the bzip2 utilities against it.

Compile the package:

make

Install it:

make install

And install the shared bzip2 binary into the /bin directory, then make some necessary symbolic links, and clean up.

cp bzip2-shared /bin/bzip2
cp -a libbz2.so* /lib
ln -s ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
rm /usr/bin/{bunzip2,bzcat,bzip2}
mv /usr/bin/{bzip2recover,bzless,bzmore} /bin
ln -s bzip2 /bin/bunzip2
ln -s bzip2 /bin/bzcat


Installing Ed-0.2

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of Ed

(Last checked against version 0.2.)

GNU ed is an 8-bit clean, POSIX-compliant line editor.

Ed installs the following:


Program Files

ed and red (link to ed)



Ed Installation Dependencies

(Last checked against version 0.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, cp, hostname, install, ln, mv, rm, touch, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Ed

Note: Ed isn't something which many people use. It's installed here because it can be used by the patch program if you encounter an ed-based patch file. This happens rarely because diff-based patches are preferred these days.

Ed normally uses the mktemp function to create temporary files in /tmp, but this function contains a vulnerability (see the section on Temporary Files in http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html). The following patch makes Ed use mkstemp instead, which is the recommended way to create temporary files.

Apply the patch:

patch -Np1 -i ../ed-0.2.patch

Now prepare Ed for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Install the package:

make install

And move the programs to the /bin directory, so they can be used in the event that the /usr partition is unavailable.

mv /usr/bin/{ed,red} /bin


Installing Kbd-1.08

Estimated build time:           0.1 SBU
Estimated required disk space:  8 MB

Contents of Kbd

(Last checked against version 1.06.)

Kbd contains keytable files and keyboard utilities.

Kbd installs the following:


Program Files

chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, getunimap, kbd_mode, kbdrate, loadkeys, loadunimap, mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to psfxtable), psfstriptable (link to psfxtable), psfxtable, resizecons, setfont, setkeycodes, setleds, setlogcons, setmetamode, setvesablank, showfont, showkey, unicode_start, and unicode_stop



Kbd Installation Dependencies

(Last checked against version 1.06.)

Bash: sh
Binutils: as, ld, strip
Bison: bison
Coreutils: cp, install, ln, mv, rm, uname
Diffutils: cmp
Flex: flex
GCC: cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Grep: grep
Gzip: gunzip, gzip
Make: make
Patch: patch
Sed: sed



Installation of Kbd

By default some of Kbd's utilities (setlogcons, setvesablank and getunimap) are not installed . The patch enables the compilation of these utilities:

patch -Np1 -i ../kbd-1.08.patch

Now prepare Kbd for compilation:

./configure

Compile the package:

make

And install it:

make install


Installing Diffutils-2.8.1

Estimated build time:           0.1 SBU
Estimated required disk space:  6 MB

Contents of Diffutils

(Last checked against version 2.8.1.)

The programs from this package show you the differences between two files or directories. It's most common use is to create software patches.

Diffutils installs the following files:


Program Files

cmp, diff, diff3 and sdiff



Diffutils Installation Dependencies

(Last checked against version 2.7.)

Bash: sh
Binutils: ld, as
Coreutils: cat, chmod, cp,  date, hostname, install, mv, rm, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Diffutils

Prepare Diffutils for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing E2fsprogs-1.34

Estimated build time:           0.5 SBU
Estimated required disk space:  13 MB

Contents of E2fsprogs

(Last checked against version 1.27.)

E2fsprogs provides the filesystem utilities for use with the ext2 filesystem. It also supports the ext3 filesystem with journaling support.

E2fsprogs installs the following:


Program Files

badblocks, chattr, compile_et, debugfs, dumpe2fs, e2fsck, e2image, e2label, fsck, fsck.ext2, fsck.ext3, lsattr, mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mklost+found, resize2fs, tune2fs and uuidgen


Library Files

libcom_err.[a,so], libe2p.[a,so], libext2fs.[a,so], libss.[a,so], libuuid.[a,so]



E2fsprogs Installation Dependencies

(Last checked against version 1.25.)

Bash: sh
Binutils: ar, as, ld, ranlib, strip
Coreutils: basename, cat, chmod, cp, echo, expr, hostname,
             install, ln, mkdir, mv, rm, sync, tr, uname
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, grep
Gzip: gzip
Make: make
Sed: sed
Texinfo: makeinfo



Installation of E2fsprogs

It is recommended to build E2fsprogs outside of the source tree:

mkdir ../e2fsprogs-build
cd ../e2fsprogs-build

Prepare E2fsprogs for compilation:

../e2fsprogs-1.34/configure --prefix=/usr --with-root-prefix="" \
    --enable-elf-shlibs

The meaning of the configure options:

  • --with-root-prefix="": Certain programs (such as the e2fsck program) are considered essential programs. When, for example, /usr isn't mounted, these essential program have to be available. They belong in directories like /lib and /sbin. If this option isn't passed to E2fsprogs's configure, the programs are placed in the /usr directory, which is not what we want.

  • --enable-elf-shlibs: This creates the shared libraries which some programs in this package make use of.

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

Install most of the package:

make install

And install also the shared libraries:

make install-libs


Installing Grep-2.5.1

Estimated build time:           0.1 SBU
Estimated required disk space:  5 MB

Contents of Grep

(Last checked against version 2.5.)

Grep is a program used to print lines from a file matching a specified pattern.

Grep installs the following:


Program Files

egrep (link to grep), fgrep (link to grep) and grep



Grep Installation Dependencies

(Last checked against version 2.4.2.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chmod, echo, expr, hostname, install,
             ls, mkdir, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Grep

Prepare Grep for compilation:

./configure --prefix=/usr --bindir=/bin \
    --with-included-regex

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Grub-0.93

Estimated build time:           ? SBU
Estimated required disk space:  9 MB

Contents of Grub

(To be determined)



Grub Installation Dependencies

(To be determined)



Installation of Grub

Grub needs a patch applied that fixes a compile problem with GCC-3.3.1:

patch -Np1 -i ../grub-0.93-gcc33-1.patch

Prepare Grub for compilation:

./configure --prefix=/usr

Compile the package:

make

And install it:

make install
mkdir /boot/grub
cp /usr/share/grub/i386-pc/stage{1,2} /boot/grub

Replace i386-pc with whatever directory is appropriate for your hardware.

The i386-pc directory also contains a number of *stage1_5 files, different ones for different filesystems. Have a look at the ones available and copy the appropriate ones to the /boot/grub directory. Most people will copy the e2fs_stage1_5 and/or reiserfs_stage1_5 files.


Installing Gzip-1.3.5

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Gzip

(Last checked against version 1.2.4a.)

The gzip package contains programs to compress and decompress files using the Lempel-Ziv coding (LZ77).

Gzip installs the following:


Program Files

gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew



Gzip Installation Dependencies

(Last checked against version 1.2.4a.)

Bash: sh
Binutils: as, ld, nm
Coreutils: cat, chmod, cp, hostname, install, ln, mv, rm, tr
GCC: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Gzip

Prepare Gzip for compilation:

./configure --prefix=/usr

The gzexe program has the location of the gzip binary hardcoded into it. Because we later change the location of this binary, the following command will place the new location into the gzexe binary.

cp gzexe.in{,.backup}
sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in

Compile the package:

make

Install the package:

make install

And move the programs to the /bin directory:

mv /usr/bin/gzip /bin
rm /usr/bin/{gunzip,zcat}
ln -s gzip /bin/gunzip
ln -s gzip /bin/zcat
ln -s gunzip /bin/uncompress


Installing Man-1.5m2

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Man

(Last checked against version 1.5k.)

Man is a man pager.

Man installs the following:


Program Files

apropos, makewhatis, man, man2dvi, man2html and whatis



Man Installation Dependencies

(Last checked against version 1.5i.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, cp, echo, install, mkdir, rm
Gawk: awk
GCC: c11, collect2, cpp0, gcc
Grep: grep
Make: make
Sed: sed



Installation of Man

We'll make three adjustments to the sources of Man.

The first patch comments out the "MANPATH /usr/man" line in the man.conf file to prevent redundant results when using programs such as whatis:

patch -Np1 -i ../man-1.5m2-manpath.patch

The second patch adds the -R option to the PAGER variable so that escape sequences are handled properly:

patch -Np1 -i ../man-1.5m2-pager.patch

The third and last patch prevents a problem when man pages not formatted with more than 80 columns are used in conjunction with recent releases of groff:

patch -Np1 -i ../man-1.5m2-80cols.patch

The paths to some programs are hard-wired into Man's executables. Unfortunately, the configuration script picks the last location in PATH rather than the first place a program is found. By appending /usr/bin:/bin to PATH for the ./configure command, we ensure that Man doesn't use the programs in the /tools directory.

Now prepare Man for compilation:

PATH=$PATH:/usr/bin:/bin ./configure -default -confdir=/etc

Compile the package:

make

And install it:

make install

Note: If you wish to disable SGR escape sequences, you should edit the man.conf file and add the -c argument to nroff.

You may want to take a look at the man hint at http://www.linuxfromscratch.org/hints/downloads/files/man.txt, which deals with formatting and compression issues for man pages.


Installing Make-3.80

Estimated build time:           0.2 SBU
Estimated required disk space:  6 MB

Contents of Make

(Last checked against version 3.79.1.)

Make determines, automatically, which pieces of a large program need to be recompiled and issues the commands to recompile them.

Make installs the following:



Make Installation Dependencies

(Last checked against version 3.79.1.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chgrp, chmod, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo



Installation of Make

Prepare Make for compilation:

./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Modutils-2.4.25

Estimated build time:           0.1 SBU
Estimated required disk space:  3 MB

Contents of Modutils

(Last checked against version 2.4.16.)

The Modutils package contains programs that you can use to work with kernel modules.

Modutils installs the following:


Program Files

depmod, genksyms, insmod, insmod_ksymoops_clean, kallsyms (link to insmod), kernelversion, ksyms (link to insmod), lsmod (link to insmod), modinfo, modprobe (link to insmod) and rmmod (link to insmod)



Modutils Installation Dependencies

(Last checked against version 2.4.12.)

Bash: sh
Binutils: ar, as, ld, ranlib, strip
Bison: bison
Coreutils: basename, cat, chmod, expr, hostname, install, ln,
             mkdir, mv, rm, tr, uname
Diffutils: cmp
Flex: flex
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed



Installation of Modutils

Prepare Modutils for compilation:

./configure

Compile the package:

make

And install it:

make install


Installing Patch-2.5.4

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Patch

(Last checked against version 2.5.4.)

The patch program modifies a file according to a patch file. A patch file usually is a list, created by the diff program, that contains instructions on how an original file needs to be modified.

Patch installs the following:



Patch Installation Dependencies

(Last checked against version 2.5.4.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, echo, expr, hostname, install, mv, rm, tr, uname
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed



Installation of Patch

Prepare Patch for compilation:

CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Procinfo-18

Estimated build time:           0.1 SBU
Estimated required disk space:  168 KB

Contents of Procinfo

(Last checked against version 18.)

The procinfo program gathers system data, such as memory usage and IRQ numbers, from the /proc directory and formats this data in a meaningful way.

Procinfo installs the following:


Program Files

lsdev, procinfo and socklist



Procinfo Installation Dependencies

(Last checked against version 18.)

Binutils: as, ld
Coreutils: install, mkdir
GCC: cc1, collect2, cpp0, gcc
Make: make



Installation of Procinfo

Compile Procinfo:

make LDLIBS=-lncurses

The -lncurses switch overwrites the default switch, -ltermcap. This is done because libtermcap is declared obsolete in favor of libncurses.

And install the package:

make install


Installing Procps-3.1.11

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Procps

(Last checked against version 2.0.7.)

The Procps package provides programs to monitor and halt system processes. Procps gathers information about processes via the /proc directory.

Procps installs the following:


Program Files

free, kill, oldps, pgrep, pkill, ps, skill, snice, sysctl, tload, top, vmstat, w and watch


Library Files

libproc.so



Procps Installation Dependencies

(Last checked against version 2.0.7.)

Bash: sh
Binutils: as, ld, strip
Coreutils: basename, install, ln, mv, pwd, rm, sort, tr
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Make: make
Sed: sed



Installation of Procps

First fix a locale problem that can crash w under certain locale settings:

patch -Np1 -i ../procps-3.1.11.patch

Now compile Procps:

make

Install it:

make install

And remove a spurious library link:

rm /lib/libproc.so


Installing Psmisc-21.3

Estimated build time:           0.1 SBU
Estimated required disk space:  2 MB

Contents of Psmisc

(Last checked against version 21.)

The Psmisc package contains three programs which help manage the /proc directory.

Psmisc installs the following:


Program Files

fuser, killall and pstree



Psmisc Installation Dependencies

(Last checked against version 20.2.)

Bash: sh
Bison: bison
Binutils: as, ld
Coreutils: basename, cat, chmod, echo, expr, hostname, install,
             ls, mkdir, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Grep: egrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: makeinfo



Installation of Psmisc

Prepare Psmisc for compilation:

./configure --prefix=/usr --exec-prefix=/

The meaning of the new configure option:

  • --exec-prefix=/: This causes the binaries to be installed in /bin and not in /usr/bin. As the Psmisc programs are often used in bootscripts, they should be available also when the /usr filesystem isn't mounted.

Compile the package:

make

And install it:

make install

By default Psmisc's pidof program isn't installed. Generally, this isn't a problem because we later install the Sysvinit package, which provides a better pidof program. But if you're not going to use Sysvinit, you should complete the installation of Psmisc by creating the following symlink:

ln -s killall /bin/pidof


Installing Shadow-4.0.3

Estimated build time:           0.4 SBU
Estimated required disk space:  7 MB

Contents of Shadow

(Last checked against version 4.0.3.)

The Shadow package was created to strengthen the security of system passwords.

Shadow installs the following:


Program Files

chage, chfn, chpasswd, chsh, dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod, vigr (link to vipw) and vipw



Shadow Installation Dependencies

(Last checked against version 20001016.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib
Coreutils: basename, cat, chmod, cp, echo, expr, install, ln, ls,
             mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: ldconfig
Grep: egrep, grep
M4: m4
Make: make
Net-tools: hostname
Sed: sed
Texinfo: makeinfo



Installation of Shadow Password Suite

Before you install this package, you may want to have a look at the Shadow hint. It discusses how you can make your system more secure regarding passwords, such as how to enable the more secure MD5 passwords and how to get the most out of this Shadow package. The Shadow hint can be found at http://www.linuxfromscratch.org/hints/downloads/files/shadowpasswd_plus.txt.

The login, getty and init programs (and some others) maintain a number of logfiles to record who are and who were logged in to the system. These programs, however, don't create these logfiles when they don't exist, so if you want this logging to occur you will have to create the files yourself. To let the Shadow package (that is installed next) detect these files in their proper place, create them now, with their proper permissions:

Create these files with their proper permissions by running the following commands:

touch /var/run/utmp /var/log/{btmp,lastlog,wtmp}
chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}

The /var/run/utmp file lists the users that are currently logged in, the /var/log/wtmp file who were logged in and when. The /var/log/lastlog file shows for each user when he or she last logged in, and the /var/log/btmp lists the bad login attempts.

Shadow hard-wires the path to the passwd binary within the binary itself, but does this the wrong way. If before installing Shadow no passwd binary is present , the package wrongly assumes it is going to be located at /bin/passwd, but then installs it in /usr/bin/passwd. This will lead to weird errors about not finding /bin/passwd. To work around this bug, create a dummy passwd file, so that it gets hard-wired properly:

touch /usr/bin/passwd

The current shadow suite has a problem in the newgrp command which causes it to fail. The following patch (also appearing in Shadow's CVS code) fixes this problem.

patch -Np1 -i ../shadow-4.0.3-newgrp-fix.patch

Now prepare Shadow for compilation:

./configure --prefix=/usr --libdir=/usr/lib --enable-shared

Compile the package:

make

And install it:

make install

Shadow uses two files to configure authentication settings for the system. Install these two config files:

cp etc/{limits,login.access} /etc

In the old days /var/spool/mail was the location for the user mailboxes, but nowadays /var/mail is used. Change the default mailbox location in the relevant configuration file while copying it to its destination:

sed 's%/var/spool/mail%/var/mail%' \
    etc/login.defs.linux > /etc/login.defs

According to the man page of vipw, a vigr program should exist too. Since the installation procedure doesn't create this program, create a symlink manually:

ln -s vipw /usr/sbin/vigr

As the /bin/vipw symlink is redundant (and even pointing to a non-existent file), remove it:

rm /bin/vipw

Now move the sg program to its proper place:

mv /bin/sg /usr/bin

And move Shadow's dynamic libraries to a more appropriate location:

mv /usr/lib/lib{shadow,misc}.so.0* /lib

As some packages expect to find the just-moved libraries in /usr/lib, create the following symlinks:

ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so

Coreutils has already installed a groups program in /usr/bin. If you wish, you can remove the one installed by Shadow:

rm /bin/groups



Configuring Shadow Password Suite

This package contains utilities to modify users' passwords, add or delete users and groups, and the like. We're not going to explain what 'password shadowing' means. A full explanation can be found in the doc/HOWTO file within the unpacked shadow password suite's source tree. There's one thing to keep in mind if you decide to use shadow support: programs that need to verify passwords (for example xdm, ftp daemons, pop3 daemons) need to be 'shadow-compliant', that is they need to be able to work with shadowed passwords.

To enable shadowed passwords, run the following command:

/usr/sbin/pwconv

And to enable shadowed group passwords, run the following command:

/usr/sbin/grpconv


Installing Sysklogd-1.4.1

Estimated build time:           0.1 SBU
Estimated required disk space:  472 KB

Contents of Sysklogd

(Last checked against version 1.4.1.)

The Sysklogd package contains programs for recording system log messages, such as those reported by the kernel.

Sysklogd installs the following:


Program Files

klogd and syslogd



Sysklogd Installation Dependencies

(Last checked against version 1.4.1.)

Binutils: as, ld, strip
Coreutils: install
GCC: cc1, collect2, cpp0, gcc
Make: make



Installation of Sysklogd

Compile Sysklogd:

make

And install it:

make install



Configuring Sysklogd

Create a new file /etc/syslog.conf by running the following:

cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *

# End /etc/syslog.conf
EOF


Installing Sysvinit-2.85

Estimated build time:           0.1 SBU
Estimated required disk space:  1 MB

Contents of Sysvinit

(Last checked against version 2.84.)

The Sysvinit package contains programs to control the startup, running and shutdown of all other programs.

Sysvinit installs the following:


Program Files

halt, init, killall5, last, lastb (link to last), mesg, pidof (link to killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit (link to init), utmpdump and wall



Sysvinit Installation Dependencies

(Last checked against version 2.84.)

Bash: sh
Binutils: as, ld
Coreutils: chown, cp, install, ln, mknod, rm
GCC: cc, cc1, collect2, cpp0
Make: make
Sed: sed



Installation of Sysvinit

When run levels are changed (for example, when halting the system), init sends the TERM and KILL signals to the processes which it started. Init prints "Sending processes the TERM signal" to the screen. This seems to imply that init is sending these signals to all the currently running processes. To avoid this confusion, the init.c file can be modified, so that the sentence reads "Sending processes started by init the TERM signal".

Edit the halt message:

cp src/init.c{,.backup}
sed 's/Sending processes/Sending processes started by init/g' \
    src/init.c.backup > src/init.c

Compile Sysvinit:

make -C src

And install it:

make -C src install



Configuring Sysvinit

Create a new file /etc/inittab by running the following:

cat > /etc/inittab << "EOF"
# Begin /etc/inittab

id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc sysinit

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
EOF


Installing Tar-1.13.25

Estimated build time:           0.2 SBU
Estimated required disk space:  6 MB

Contents of Tar

(Last checked against version 1.13.)

Tar is an archiving program designed to store and extract files from an archive file known as a tar file.

Tar installs the following:


Program Files

rmt and tar



Tar Installation Dependencies

(Last checked against version 1.13.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, install, ls, mv, rm,
             sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Net-tools: hostname
Patch: patch
Sed: sed
Texinfo: install-info, makeinfo



Installation of Tar

Prepare Tar for compilation:

./configure --prefix=/usr --bindir=/bin \
    --libexecdir=/usr/bin

Compile the package:

make

This package has a testsuite available which can perform a number of checks to ensure it built correctly. Should you choose to run it, the following command will do so:

make check

And install the package:

make install


Installing Util-linux-2.12

Estimated build time:           0.2 SBU
Estimated required disk space:  10 MB

Contents of Util-linux

(Last checked against version 2.11t.)

The Util-linux package contains a number of miscellaneous utility programs. Some of the more prominent utilities are used to mount, unmount, format, partition and manage disk drives, open tty ports and fetch kernel messages.

Util-linux installs the following:


Program Files

agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, fsck.cramfs, fsck.minix, getopt, hexdump, hwclock, ipcrm, ipcs, isosize, line, logger, look, losetup, mcookie, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap, more, mount, namei, parse.bash, parse.tcsh, pg, pivot_root, ramsize (link to rdev), raw, rdev, readprofile, rename, renice, rev, rootflags (link to rdev), script, setfdprm, setsid, setterm, sfdisk, swapoff (link to swapon), swapon, test.bash, test.tcsh, tunelp, ul, umount, vidmode (link to rdev), whereis and write



Util-linux Installation Dependencies

(Last checked against version 2.11n.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chgrp, chmod, cp, install, ln, mv, rm, uname, whoami
Diffutils: cmp
GCC: cc, cc1, collect2, cpp, cpp0
Gettext: msgfmt, xgettext
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed



FHS compliance notes

The FHS recommends that we use /var/lib/hwclock, instead of the usual /etc, as the location for the adjtime file. To make the hwclock program FHS-compliant, run the following:

cp hwclock/hwclock.c{,.backup}
sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \
    hwclock/hwclock.c.backup > hwclock/hwclock.c
mkdir -p /var/lib/hwclock


Installation of Util-linux

Prepare Util-linux for compilation:

./configure

Compile the package:

make HAVE_SLN=yes

The meaning of the make parameter:

  • HAVE_SLN=yes: This prevents the sln program (a statically linked ln, already installed by Glibc) from being built again.

And install the package:

make HAVE_SLN=yes install


Installing GCC-2.95.3

Estimated build time:           2.0 SBU
Estimated required disk space:  221 MB


Installation of GCC

This package is known to behave badly when you have changed its default optimization flags (including the -march and -mcpu options). Therefore, if you have defined any environment variables that override default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or modifying them when building GCC.

This is an older release of GCC which we are going to install for the purpose of compiling the Linux kernel in Chapter 8. This version is recommended by the kernel developers when you need absolute stability. Later versions of GCC have not received as much testing for Linux kernel compilation. Using a later version is likely to work, however, we recommend adhering to the kernel developer's advice and using the version here to compile your kernel.

We'll install this older release of GCC into the non-standard prefix of /opt so as to avoid interfering with the system GCC already installed in /usr .

patch -Np1 -i ../gcc-2.95.3-2.patch
patch -Np1 -i ../gcc-2.95.3-returntype-fix.patch
echo timestamp > gcc/cstamp-h.in
mkdir ../gcc-2-build
cd ../gcc-2-build
../gcc-2.95.3/configure --prefix=/opt/gcc-2.95.3 \
    --enable-shared --enable-languages=c \
    --enable-threads=posix
make bootstrap
make install


Revised chroot command

From now on when you exit the chroot environment and wish to re-enter it, you should run the following modified chroot command.

Additionally, now that all software has been installed there is no need to use anything from the /tools directory anymore, so it may be deleted. However, since the Tcl, Expect, and DejaGnu packages only exist here, you may want to reinstall them after removing that directory.

chroot $LFS /usr/bin/env -i \
    HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin \
    /bin/bash --login


Installing LFS-Bootscripts-1.11

Estimated build time:           0.1 SBU
Estimated required disk space:  252 KB

Contents of LFS-bootscripts

(Last checked against version 1.11.)

The LFS-Bootscripts package contains SysV init style shell scripts. These scripts do various tasks such as check filesystem integrity during boot, load keymaps, setup networks and halt processes at shutdown.

LFS-bootscripts installs the following:


Scripts

checkfs, cleanfs, functions, halt, ifdown, ifup, loadkeys, localnet, mountfs, mountproc, network, rc, reboot, sendsignals, setclock, swap, sysklogd and template



LFS-Bootscripts Installation Dependencies

(Last checked against version 1.11.)

Coreutils: chown, cp



Installation of LFS-Bootscripts

We will be using SysV style init scripts. We have chosen this style because it is widely used and we feel comfortable with it. If you would prefer to try something else, Marc Heerdink has written a hint about BSD style init scripts, to be found at http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt. And if you'd like something more radical, search the LFS mailing lists for depinit.

If you decide to use BSD style, or some other style scripts, you can skip Chapter 7 when you arrive at it and move on to Chapter 8.

Install the boot scripts:

cp -a rc.d sysconfig /etc

Give root ownership of the scripts:

chown -R root:root /etc/rc.d /etc/sysconfig


Configuring system components

Now that all software is installed, all that we need to do is perform a few configuration tasks.


Configuring your keyboard

Few things are more annoying than using Linux while a wrong keymap for your keyboard is loaded. If you have a standard US keyboard, however, you can skip this section, as the US keymap is the default as long as you don't change it.

To change the default keymap, create the /usr/share/kbd/keymaps/defkeymap.map.gz symlink by running the following command:

ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz

Of course, replace path/to/keymap with the path and name of your keyboard's map file. For example, if you have a Dutch keyboard, you would use i386/qwerty/nl.map.gz.

Another way to set your keyboard's layout is to compile the keymap into the kernel. This ensures that your keyboard will always work as expected, even when you boot into maintenance mode (by passing `init=/bin/sh' to the kernel), as then the bootscript that normally sets up your keymap isn't run.

Run the following command to patch the current default keymap into the kernel source. You will have to repeat this command whenever you unpack a new kernel:

loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \
    /usr/src/linux-2.4.22/drivers/char/defkeymap.c


Setting the root password

Choose a password for user root and set it by running the following command:

passwd root


Chapter 7. Setting up system boot scripts


Introduction

This chapter will set up the bootscripts that you installed in chapter 6. Most of these scripts will work without needing to modify them, but a few do require additional configuration files set up as they deal with hardware dependent information.


How does the booting process with these scripts work?

Linux uses a special booting facility named SysVinit. It's based on a concept of runlevels. It can be widely different from one system to another, so it can't be assumed that because things worked in <insert distro name> they should work like that in LFS too. LFS has its own way of doing things, but it respects generally accepted standards.

SysVinit (which we'll call init from now on) works using a runlevels scheme. There are 7 (from 0 to 6) runlevels (actually, there are more runlevels but they are for special cases and generally not used. The init man page describes those details), and each one of those corresponds to the things the computer is supposed to do when it starts up. The default runlevel is 3. Here are the descriptions of the different runlevels as they are often implemented:

0: halt the computer
1: single-user mode
2: multi-user mode without networking
3: multi-user mode with networking
4: reserved for customization, otherwise does the same as 3
5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm)
6: reboot the computer

The command used to change runlevels is init <runlevel> where <runlevel> is the target runlevel. For example, to reboot the computer, a user would issue the init 6 command. The reboot command is just an alias, as is the halt command an alias to init 0.

There are a number of directories under /etc/rc.d that look like like rc?.d where ? is the number of the runlevel and rcsysinit.d which contain a number of symbolic links. Some begin with a K, the others begin with an S, and all of them have two numbers following the initial letter. The K means to stop (kill) a service, and the S means to start a service. The numbers determine the order in which the scripts are run, from 00 to 99; the lower the number the sooner it gets executed. When init switches to another runlevel, the appropriate services get killed and others get started.

The real scripts are in /etc/rc.d/init.d. They do all the work, and the symlinks all point to them. Killing links and starting links point to the same script in /etc/rc.d/init.d. That's because the scripts can be called with different parameters like start, stop, restart, reload, status. When a K link is encountered, the appropriate script is run with the stop argument. When a S link is encountered, the appropriate script is run with the start argument.

There is one exception. Links that start with an S in the rc0.d and rc6.d directories will not cause anything to be started. They will be called with the parameter stop to stop something. The logic behind it is that when you are going to reboot or halt the system, you don't want to start anything, only stop the system.

These are descriptions of what the arguments make the scripts do:

  • start: The service is started.

  • stop: The service is stopped.

  • restart: The service is stopped and then started again.

  • reload: The configuration of the service is updated. This is used after the configuration file of a service was modified, when the service doesn't need to be restarted.

  • status: Tells if the service is running and with which PIDs.

Feel free to modify the way the boot process works (after all, it's your own LFS system). The files given here are just an example of how it can be done in a nice way (well, what we consider nice -- you may hate it).


Configuring the setclock script

This setclock script reads the time from your hardware clock (also known as BIOS or CMOS clock) and either converts that time to localtime using the /etc/localtime file (if the hardware clock is set to GMT) or not (if the hardware clock is already set to localtime). There is no way to auto-detect whether the hardware clock is set to GMT or not, so we need to configure that here ourselves.

Change the value of the UTC variable below to a 0 (zero) if your hardware clock is not set to GMT time.

Create a new file /etc/sysconfig/clock by running the following:

cat > /etc/sysconfig/clock << "EOF"
# Begin /etc/sysconfig/clock

UTC=1

# End /etc/sysconfig/clock
EOF

Now, you may want to take a look at a very good hint explaining how we deal with time on LFS at http://www.linuxfromscratch.org/hints/downloads/files/time.txt. It explains issues such as time zones, UTC, and the TZ environment variable.


Do I need the loadkeys script?

If you decided to compile your keymap file directly into the kernel back at the end of Chapter 6, then you strictly speaking don't need to run this loadkeys script, since the kernel has already set up the keymap for you. You can still run it if you want, it isn't going to hurt you. It could even be beneficial to keep it in case you run a lot of different kernels and don't remember or want to compile the keymap into every kernel you lay your hands on.

If you decided you don't need to, or don't want to use the loadkeys script, remove the /etc/rc.d/rcsysinit.d/S70loadkeys symlink.


Configuring the sysklogd script

The sysklogd script invokes the syslogd program with the -m 0 option. This option turns off the periodic timestamp mark that syslogd writes to the log files every 20 minutes by default. If you want to turn on this periodic timestamp mark, edit the sysklogd script and make the changes accordingly. See man syslogd for more information.


Configuring the localnet script

Part of the localnet script is setting up the system's hostname. This needs to be configured in the /etc/sysconfig/network.

Create the /etc/sysconfig/network file and enter a hostname by running:

echo "HOSTNAME=lfs" > /etc/sysconfig/network

"lfs" needs to be replaced with the name the computer is to be called. You should not enter the FQDN (Fully Qualified Domain Name) here. That information will be put in the /etc/hosts file later on.


Creating the /etc/hosts file

If a network card is to be configured, you have to decide on the IP-address, FQDN and possible aliases for use in the /etc/hosts file. The syntax is:

<IP address> myhost.mydomain.org aliases

You should made sure that the IP-address is in the private network IP-address range. Valid ranges are:

	Class Networks
	A     10.0.0.0
	B     172.16.0.0 through 172.31.0.0
	C     192.168.0.0 through 192.168.255.0

A valid IP address could be 192.168.1.1. A valid FQDN for this IP could be www.linuxfromscratch.org.

If you aren't going to use a network card, you still need to come up with a FQDN. This is necessary for certain programs to operate correctly.

If a network card is not going to be configured, create the /etc/hosts file by running:

cat > /etc/hosts << "EOF"
# Begin /etc/hosts (no network card version)

127.0.0.1 <value of HOSTNAME>.mydomain.com <value of HOSTNAME> localhost

# End /etc/hosts (no network card version)
EOF

If a network card is to be configured, create the /etc/hosts file by running:

cat > /etc/hosts << "EOF"
# Begin /etc/hosts (network card version)

127.0.0.1 localhost.localdomain localhost
192.168.1.1 <value of HOSTNAME>.mydomain.org <value of HOSTNAME>

# End /etc/hosts (network card version)
EOF

Of course, the 192.168.1.1 and <value of HOSTNAME>.mydomain.org have to be changed to your liking (or requirements if assigned an IP-address by a network/system administrator and this machine is planned to be connected to an existing network).


Configuring the network script

This section only applies if you're going to configure a network card.

If you don't have any network cards, you are most likely not going to create any configuration files relating to network cards. If that is the case, you must remove the network symlinks from all the runlevel directories (/etc/rc.d/rc*.d)


Configuring default gateway

If you're on a network you may need to set up the default gateway for this machine. This is done by adding the proper values to the /etc/sysconfig/network file by running the following:

cat >> /etc/sysconfig/network << "EOF"
GATEWAY=192.168.1.2
GATEWAY_IF=eth0
EOF

The values for GATEWAY and GATEWAY_IF need to be changed to match your network setup. GATEWAY contains the IP address of the default gateway, and GATEWAY_IF contains the network interface through which the default gateway can be reached.


Creating network interface configuration files

Which interfaces are brought up and down by the network script depends on the files in the /etc/sysconfig/network-devices directory. This directory should contain files in the form of ifconfig.xyz, where xyz is a network interface name (such as eth0 or eth0:1)

If you decide to rename or move this /etc/sysconfig/network-devices directory, make sure you update the /etc/sysconfig/rc file as well and update the network_devices by providing it with the new path.

Now, new files are created in that directory containing the following. The following command creates a sample ifconfig.eth0 file:

cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"
ONBOOT=yes
IP=192.168.1.1
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
EOF

Of course, the values of those variables have to be changed in every file to match the proper setup. If the ONBOOT variable is set to yes, the network script will bring it up during the booting of the system. If set to anything else but yes, it will be ignored by the network script and thus not brought up.


Chapter 8. Making the LFS system bootable


Introduction

This chapter will make LFS bootable. This chapter deals with creating a new fstab file, building a new kernel for the new LFS system and installing the Grub bootloader so that the LFS system can be selected for booting at startup.


Creating the /etc/fstab file

In order for certain programs to be able to determine where certain partitions are supposed to be mounted by default, the /etc/fstab file is used. Create a new file /etc/fstab containing the following:

cat > /etc/fstab << "EOF"
# Begin /etc/fstab

# filesystem   mount-point fs-type    options     dump    fsck-order

/dev/*LFS*     /           *fs-type*  defaults    1       1
/dev/*swap*    swap        swap       pri=1       0       0
proc           /proc       proc       defaults    0       0
shm            /dev/shm    tmpfs      defaults    0       0

# End /etc/fstab
EOF

*LFS*, *swap* and *fs-type* have to be replaced with the appropriate values (/dev/hda2, /dev/hda5 and reiserfs for example).

When adding a reiserfs partition, the 1 1 at the end of the line should be replaced with 0 0.

A tmpfs mount is added at /dev/shm to comply with Posix shared memory requirements. For more information, see the file Documentation/filesystems/tmpfs.txt in the kernel source tree.

For more information on the various fields which are in the fstab file, see man 5 fstab.

There are other lines which you may consider adding to your fstab file. One example is the line which you must have if you are using devpts:

devpts         /dev/pts    devpts     gid=4,mode=620 0    0

Another example is a line to use if you intend to use USB devices:

usbfs       /proc/bus/usb usbfs defaults    0       0

Both of these options will only work if you have the relevant support compiled into your kernel.


Installing Linux-2.4.22

Estimated build time:           All default options: 4.20 SBU
Estimated required disk space:  All default options: 181 MB

Contents of Linux

(Last checked against version 2.4.18.)

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components: serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.

Linux installs the following files:


Program Files

kernel and kernel headers



Linux Installation Dependencies

(Last checked against version 2.4.17.)

Bash: sh
Binutils: ar, as, ld, nm, objcopy
Coreutils: basename, cat, cp, date, expr, ln, md5sum, mkdir, mv,
             pwd, rm, sort, stty, tail, touch, uname, whoami, yes
Findutils: find, xargs
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed



Installation of the kernel

Building the kernel involves a few steps: configuration, compilation, and installation. If you don't like the way this book configures the kernel, view the README file in the kernel source tree for alternative methods.

Prepare for compilation by running the following command:

make mrproper

This ensures that the kernel tree is absolutely clean. The kernel team recommends that this command be issued prior to each kernel compilation. You shouldn't rely on the source tree being clean after untarring.

Configure the kernel via a menu-driven interface:

make menuconfig

make oldconfig may be more appropriate in some situations. See the README file for more information.

If you wish, you may skip kernel configuration by simply copying the kernel config file, .config, from your host system to the $LFS/usr/src/linux-2.4.22 directory.

It's important to note that to be compliant with POSIX shared memory requirements, we must enable the tmpfs filesystem option, and mount a tmpfs filesystem at /dev/shm.

Verify dependencies and create dependency information files:

make CC=/opt/gcc-2.95.3/bin/gcc dep

Compile the kernel image:

make CC=/opt/gcc-2.95.3/bin/gcc bzImage

Compile the drivers which have been configured as modules:

make CC=/opt/gcc-2.95.3/bin/gcc modules

If you intend to use kernel modules, you will need an /etc/modules.conf file. Information pertaining to modules and to kernel configuration in general may be found in the kernel documentation, which is stored stored in /usr/src/linux-2.4.22/Documentation. The modules.conf man page and the kernel HOWTO at http://www.tldp.org/HOWTO/Kernel-HOWTO.html may also be of interest to you.

Install the modules:

make CC=/opt/gcc-2.95.3/bin/gcc modules_install

As nothing is complete without documentation, build the manual pages that come with the kernel:

make mandocs

And install these pages:

cp -a Documentation/man /usr/share/man/man9

Kernel compilation has finished, but some of the files created still reside in the source tree. To complete the installation, two files should to be copied to the /boot directory.

The path to the kernel file may vary depending on the platform you're using. Issue the following command to install the kernel:

cp arch/i386/boot/bzImage /boot/lfskernel

System.map is a symbol file for the kernel. It maps the function entrypoints of every function in the kernel API, as well as the addresses of the kernel data structures for the running kernel. Issue the following command to install the map file:

cp System.map /boot


Making the LFS system bootable

Now that we have our shiny new Linux-From-Scratch system completed, we need to ensure we can boot it. To do this, we will run the grub program.

grub

Grub uses its own naming structure for drives, in the form of (hdn,m), where n is the hard drive number, and m is the partition number, both of which start from zero. So, partition hda1 would be (hd0,0) to Grub, and hdb2 would be (hd1,1). Also, Grub doesn't pay attention to CD-ROM drives at all, so if, for example, you have a CD on hdb, and a second hard drive on hdc, partitions on that second hard drive would still be (hd1,m).

So, using the information above, select the appropriate designator for your root partition. For the purposes of this, we will assume (hd0,3) for your root partition. First, we tell grub where to find its files:

root (hd0,3)
setup (hd0)
quit

This tells Grub to look for its files on hda4 (hd0,3), and install itself into the MBR (Master Boot Record) of hda.

Also, we need to create the menu.lst file, which Grub uses to designate its boot menu:

cat > /boot/grub/menu.lst << "EOF"
# Begin /boot/grub/menu.lst

# Default to first menu entry
default 0

# Allow 30 seconds before booting default
timeout 30

# Use prettier colors
color green/black light-green/black

# Default Entry for LFS
title LFS 5.0
root (hd0,3)
kernel /boot/lfskernel root=/dev/hda4 ro
EOF

You might also want to add in an entry for your host distribution. It might look similar to this:

cat >> /boot/grub/menu.lst << "EOF"
# Redhat Linux
title Redhat
root (hd0,2)
kernel /boot/kernel-2.4.20 root=/dev/hda3 ro
initrd /boot/initrd-2.4.20
EOF

Also, if you happen to dual-boot Windows, the following entry should allow booting it:

cat >> /boot/grub/menu.lst << "EOF"
# Windows
title Windows
rootnoverify (hd0,0)
chainloader +1
EOF

You can find more info regarding Grub on its web site, located at: http://www.gnu.org/software/grub, as well as in the LFS Grub HOWTO located at: http://www.linuxfromscratch.org/hints/downloads/files/grub-howto.txt.


Chapter 9. The End


The End

Well done! You have finished installing your LFS system. It may have been a long process, but we hope it was worth it. We wish you a lot of fun with your new shiny custom built Linux system.

Now would be a good time to strip all debug symbols from the binaries on your LFS system. If you are not a programmer and don't plan on debugging your software, then you will be happy to know that you can reclaim a few tens of megs by removing debug symbols. This process causes no inconvenience other than not being able to debug the software fully anymore, which is not an issue if you don't know how to debug.

Disclaimer: 98% of the people who use the command mentioned below don't experience any problems. But do make a backup of your LFS system before you run this command. There's a slight chance it may backfire on you and render your system unusable (mostly by destroying your kernel modules and dynamic & shared libraries). This is caused more often by typos than by a problem with the command used.

Having said that, the --strip-debug option we use to strip is quite harmless under normal circumstances. It doesn't strip anything vital from the files. It also is quite safe to use --strip-all on regular programs (don't use that on libraries - they will be destroyed), but it's not as safe, and the space you gain is not all that much. But if you're tight on disk space every little bit helps, so decide for yourself. Please refer to the strip man page for other strip options you can use. The general idea is to not run strip on libraries (other than --strip-debug), just to be on the safe side.

find $LFS/{,usr/,usr/local/}{bin,sbin,lib} -type f \
   -exec /usr/bin/strip --strip-debug '{}' ';'

It may be a good idea to create the $LFS/etc/lfs file. By having this file it is very easy for you (and for us if you are going to ask for help with something at some point) to find out which LFS version you have installed on your system. Create the $LFS/etc/lfs file by running the following command:

echo 5.0-pre1 > $LFS/etc/lfs


Get Counted

Want to be counted as an LFS user now that you have finished the book? Head over to http://linuxfromscratch.org/cgi-bin/lfscounter.cgi and register as an LFS user by entering your name and the first LFS version you have used.

Let's reboot into LFS now...


Rebooting the system

Now that all of the software has been installed, it's time to reboot the computer. Before we reboot, let's unmount $LFS/proc and the LFS partition itself by running:

umount $LFS/proc
umount $LFS

If you decided to create multiple partitions, you need to umount the other partitions before you umount $LFS, like this:

umount $LFS/proc
umount $LFS/usr
umount $LFS/home
umount $LFS

And you can reboot your system by running something like:

/sbin/shutdown -r now

At the Grub menu make sure that you tell it to boot lfs and not the default entry which will boot your host system again.

After you have rebooted, your LFS system is ready for use and you can start adding your own software.


What now?

We thank you for reading the LFS Book and hope that you've found this book useful and worth your time.

Now that you have finished installing your LFS system, you may be wondering "What now?". In order to answer that question, we have composed a list of resources for you.

  • Beyond Linux From Scratch

    The Beyond Linux From Scratch book covers installation procedures for a wide range of software beyond the scope of the LFS Book. The BLFS project can be found at http://www.linuxfromscratch.org/blfs/.

  • LFS Hints

    The LFS Hints are a collection of small, educational documents submitted by volunteers in the LFS community. The Hints are available at http://www.linuxfromscratch.org/hints/list.html.

  • Mailing lists

    There are several LFS mailing lists you may subscribe to if you are in need of help. See Chapter 1 - Mailing lists for more information.

  • The Linux Documentation Project

    The goal of the Linux Documentation Project is to collaborate in all of the issues of Linux documentation. The LDP features a large collection of HOWTOs, Guides and man pages; it may be found at http://www.tldp.org/.


Appendix A. Package descriptions and dependencies


Introduction

In this appendix the following aspects of every package installed in this book are described:

  • the official download location for the package,

  • what the package contains,

  • what each program from the package does,

  • what the package needs to be compiled.

Most information about these packages (especially the descriptions of them) come from the man pages of those packages. We do not include the entire man page, but just some key elements to make it possible to understand what a program does. To get information on all details of a program, please refer to its man page or info page.

Certain packages are documented in more depth than others, because we just happen to know more about certain packages than about others. If you think anything should be added to the following descriptions, please don't hesitate to email the mailing lists. We intend that the list should contain an in-depth description of every package installed, but we can't do it without help.

Please note that currently only what a package does is described and not why it needs to be installed. This may be added later.

Also listed are all of the installation dependencies for all the packages that are installed in this book. The listings will include which programs from which packages are needed to successfully compile the package to be installed.

These are not running dependencies, meaning they don't tell you what programs are needed to use that packages programs. Just the ones needed to compile it.

The dependency list can be, from time to time, outdated in regards to the currently used package version. Checking dependencies takes quite a bit of work, so they may lag behind a bit on the package update. But often with minor package updates, the installation dependencies hardly change, so they'll be current in most cases. When we upgrade to a major new release, we'll make sure the dependencies are checked too.


Autoconf

For installation instructions see the Section called Installing Autoconf-2.57 in Chapter 6.


Contents of Autoconf

(Last checked against version 2.53.)

Autoconf produces shell scripts which automatically configure source code.

Autoconf installs the following:


Program Files

autoconf, autoheader, autom4te, autoreconf, autoscan, autoupdate and ifnames



Descriptions

(Last checked against version 2.53.)


Program file descriptions

autoconf

autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of Unix-like systems. The configuration scripts produced by autoconf are independent of autoconf when they are run, so their users do not need to have autoconf.


autoheader

The autoheader program can create a template file of C #define statements for configure to use.


autom4te

autom4te runs GNU M4 on files.


autoreconf

If there are a lot of autoconf-generated configure scripts, the autoreconf program can save some work. It runs autoconf and autoheader (where appropriate) repeatedly to remake the autoconf configure scripts and configuration header templates in the directory tree rooted at the current directory.


autoscan

The autoscan program can help to create a configure.in file for a software package. autoscan examines the source files in a directory tree. If a directory is not specified on the command line, then the current working directory is used. The source files are searched for common portability problems and a configure.scan file is created to serve as the preliminary configure.in for that package.


autoupdate

The autoupdate program updates a configure.in file that calls autoconf macros by their old names to use the current macro names.


ifnames

ifnames can help when writing a configure.in for a software package. It prints the identifiers that the package already uses in C preprocessor conditionals. If a package has already been set up to have some portability, this program can help to determine what configure needs to check. It may fill in some gaps in a configure.in file generated by autoscan.



Autoconf Installation Dependencies

(Last checked against version 2.52.)

Bash: sh
Coreutils: cat, chmod, echo, expr, hostname, install,
             sleep, uname, ln, ls, mkdir, mv, rm, tr
Diffutils: cmp
Gawk: gawk
Grep: fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info


Automake

For installation instructions see the Section called Installing Automake-1.7.6 in Chapter 6.


Contents of Automake

(Last checked against version 1.6.2.)

Automake generates Makefile.in files, intended for use with Autoconf.

Automake installs the following:


Program Files

acinstall, aclocal, aclocal-1.6, automake, automake-1.6, compile, config.guess, config.sub, depcomp, elisp-comp, install-sh, mdate-sh, missing, mkinstalldirs, py-compile, ylwrap



Descriptions

(Last checked against version 1.6.2.)


Program file descriptions

acinstall

acinstall is a script which installs aclocal-style M4 files.


aclocal, aclocal-1.6

automake includes a number of autoconf macros which can be used in packages, some of which are needed by automake in certain situations. These macros must be defined in the aclocal.m4-file or they will not be seen by autoconf.

The aclocal program will automatically generate aclocal.m4 files based on the contents of configure.in. This provides a convenient way to get automake-provided macros without having to search around. Also, the aclocal mechanism is extensible for use by other packages.


automake, automake-1.6

To create all the Makefile.in files for a package, run the automake program in the top level directory, with no arguments. automake will automatically find each appropriate Makefile.am (by scanning configure.in) and generate the corresponding Makefile.in.


compile

compile is script which acts as a wrapper for compilers.


config.guess

config.guess is a script which attempts to guess a canonical system name.


config.sub

config.sub is a configuration validation subroutine script.


depcomp

depcomp is a script which compiles a program while generating dependencies as side-effects.


elisp-comp

elisp-comp is a script which byte-compiles .el files.


install-sh

install-sh is a script which installs a program, script, or a datafile.


mdate-sh

mdate-sh is a script which prints the modification time of a file or directory.


missing

missing is a script which acts as a common stub for a few missing GNU programs during an installation.


mkinstalldirs

mkinstalldirs is a script which makes a directory hierarchy.


py-compile

py-compile is a script which compiles a Python program.


ylwrap

ylwrap is a script which acts as a wrapper for lex/yacc invocations.



Automake Installation Dependencies

(Last checked against version 1.5.)

Bash: sh
Coreutils: cat, chmod, echo, expr, hostname, install, ls, mkdir,
             mv, rm, rmdir, sleep, tr
Diffutils: cmp
Grep: fgrep, grep
Make: make
Perl: perl
Sed: sed
Texinfo: install-info


Bash

For installation instructions see the Section called Installing Bash-2.05b in Chapter 6.


Contents of Bash

(Last checked against version 2.05a.)

bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. The bash program reads from standard input (the keyboard). A user types something and the program will evaluate what he has typed and do something with it, like running a program.

Bash installs the following files:


Program Files

bash, sh (link to bash) and bashbug



Descriptions

(Last checked against version 2.05a.)


Program file descriptions

bash

bash is the Bourne-Again SHell, which is a widely used command interpreter on Unix systems. The bash program reads from standard input (the keyboard). A user types something and the program will evaluate what he has typed and do something with it, like running a program.


bashbug

bashbug is a shell script to help the user compose and mail bug reports concerning bash in a standard format.


sh

sh is a symlink to the bash program. When invoked as sh, bash tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well.



Bash Installation Dependencies

(Last checked against version 2.05a.)

Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, install,
             ln, ls, mkdir, mv, rm, sleep, tr, uname, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Ncurses: (libraries)
Sed: sed
Texinfo: install-info


Binutils

For installation instructions see the Section called Installing Binutils-2.14 in Chapter 6.


Contents of Binutils

(Last checked against version 2.12.1.)

Binutils is a collection of software development tools containing a linker, assembler and other tools to work with object files and archives.

Binutils installs the following files:


Program Files

addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip


Library Files

libbfd.[a,so] and libopcodes.[a,so]



Descriptions

(Last checked against version 2.12.1.)


Program file descriptions

addr2line

addr2line translates program addresses into file names and line numbers. Given an address and an executable, it uses the debugging information in the executable to figure out which file name and line number are associated with a given address.


ar

The ar program creates, modifies, and extracts from archives. An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive).


as

as is primarily intended to assemble the output of the GNU C compiler, gcc, for use by the linker ld.


gprof

gprof displays call graph profile data.


ld

ld combines a number of object and archive files, relocates their data and ties up symbol references. Often the last step in building a new compiled program to run is a call to ld.


nm

nm lists the symbols from object files.


objcopy

objcopy utility copies the contents of an object file to another. objcopy uses the GNU BFD Library to read and write the object files. It can write the destination object file in a format different from that of the source object file.


objdump

objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work.


ranlib

ranlib generates an index to the contents of an archive, and stores it in the archive. The index lists each symbol defined by an archive member that is a relocatable object file.


readelf

readelf displays information about elf type binaries.


size

size lists the section sizes --and the total size-- for each of the object files in its argument list. By default, one line of output is generated for each object file or each module in an archive.


strings

For each file given, strings prints the printable character sequences that are at least 4 characters long (or the number specified with an option to the program) and are followed by an unprintable character. By default, it only prints the strings from the initialized and loaded sections of object files. For other types of files, it prints the strings from the whole file.

strings is mainly useful for determining the contents of non-text files.


strip

strip discards all or specific symbols from object files. The list of object files may include archives. At least one object file must be given. strip modifies the files named in its argument, rather than writing modified copies under different names.


Library file descriptions

libbfd

libbfd is the Binary File Descriptor library.


libopcodes

libopcodes is a native library for dealing with opcodes and is used in the course of building utilities such as objdump. Opcodes are actually "readable text" versions of instructions for the processor.



Binutils Installation Dependencies

(Last checked against version 2.11.2.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Coreutils: basename, cat, chmod, cp, echo, expr, hostname, ln, ls, mkdir
             mv, rm, rmdir, sleep, sort, touch, tr, true, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info, makeinfo


Bison

For installation instructions see the Section called Installing Bison-1.875 in Chapter 6.


Contents of Bison

(Last checked against version 1.35.)

Bison is a parser generator, a replacement for yacc. Bison generates a program that analyzes the structure of a text file.

Bison installs the following:


Program Files

bison and yacc



Descriptions

(Last checked against version 1.35.)


Program file descriptions

bison

bison is a parser generator, a replacement for yacc. yacc stands for Yet Another Compiler Compiler. What is bison then? It is a program that generates a program that analyzes the structure of a text file. Instead of writing the actual program a user specifies how things should be connected and with those rules a program is constructed that analyzes the text file. There are a lot of examples where structure is needed and one of them is the calculator.

Given the string :

        1 + 2 * 3

A human can easily come to the result 7. Why? Because of the structure. Our brain knows how to interpret the string. The computer doesn't know that and bison is a tool to help it understand by presenting the string in the following way to the compiler:

            +
           / \
          *   1
         / \
        2   3

Starting at the bottom of a tree and coming across the numbers 2 and 3 which are joined by the multiplication symbol, the computer multiplies 2 and 3. The result of that multiplication is remembered and the next thing that the computer sees is the result of 2*3 and the number 1 which are joined by the add symbol. Adding 1 to the previous result makes 7. In calculating, the most complex calculations can be broken down in this tree format and the computer just starts at the bottom and works its way up to the top and comes with the correct answer. Of course, bison isn't only used for calculators alone.


yacc

This bash script calls bison using the -y option. This is for compatibility purposes for programs which use yacc instead of bison.



Bison Installation Dependencies

(Last checked against version 1.31.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, dirname, echo, expr, head, hostname,
             install, ln, ls, mkdir, mv, rm, rmdir, sleep, tr, uname, uniq
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info


Bzip2

For installation instructions see the Section called Installing Bzip2-1.0.2 in Chapter 6.


Contents of Bzip2

(Last checked against version 1.0.2.)

Bzip2 is a block-sorting file compressor which generally achieves a better compression than the traditional gzip does.

Bzip2 installs the following files:


Program Files

bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore


Library Files

libbz2.a, libbz2.so (link to libbz2.so.1.0), libbz2.so.1.0 (link to libbz2.so.1.0.2) and libbz2.so.1.0.2



Descriptions

(Last checked against version 1.0.2.)


Program file descriptions

bunzip2

bunzip2 decompresses files that are compressed with bzip2.


bzcat

bzcat (or bzip2 -dc) decompresses all specified files to the standard output.


bzcmp, bzdiff

bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files.


bzegrep, bzfgrep, bzgrep

bzegrep, bzfgrep, and bzgrep invoke either egrep, fgrep, or grep (respectively) on bzip2-compressed files.


bzip2

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors (such as the traditional gzip utility) and approaches the performance of the PPM family of statistical compressors.


bzip2recover

bzip2recover recovers data from damaged bzip2 files.


bzless

bzless is a filter which allows examination of compressed or plain text files, one screenful at a time on a soft-copy terminal, like less.


bzmore

bzmore is a filter which allows examination of compressed or plain text files, one screenful at a time on a soft-copy terminal, like more.


Library file descriptions

libbz2

libbz2 is the library for implementing lossless, block-sorting data compression, using the Burrows-Wheeler algorithm.



Bzip2 Installation Dependencies

(Last checked against version 1.0.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cp, ln, rm
GCC: cc1, collect2, cpp0, gcc
Make: make


Coreutils

For installation instructions see the Section called Installing Coreutils-5.0 in Chapter 6.


Contents of Coreutils

The Coreutils package contains a whole series of basic shell utilities.

Coreutils installs the following:


Program Files

basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, head, hostid, hostname, id, install, join, kill, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, sleep, sort, split, stat, stty, su, sum, sync, tac, tail, tee, test, touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami, yes



Descriptions

Program file descriptions

basename

basename strips directory and suffixes from filenames.


cat

cat concatenates file(s) or standard input to standard output.


chgrp

chgrp changes the group ownership of each given file to the named group, which can be either a group name or a numeric group ID.


chmod

chmod changes the permissions of each given file according to mode, which can be either a symbolic representation of changes to make or an octal number representing the bit pattern for the new permissions.


chown

chown changes the user and/or group ownership of each given file.


chroot

chroot runs a command or interactive shell with special root directory.


cksum

cksum prints CRC checksum and byte counts of each specified file.


comm

comm compares two sorted files line by line.


cp

cp copies files from one place to another.


csplit

csplit outputs pieces of a file separated by (a) pattern(s) to files xx01, xx02, ..., and outputs byte counts of each piece to standard output.


cut

cut prints selected parts of lines from specified files to standard output.


date

date displays the current time in a specified format, or sets the system date.


dd

dd copies a file (from the standard input to the standard output, by default) with a user-selectable blocksize, while optionally performing conversions on it.


df

df displays the amount of disk space available on the filesystem containing each file name argument. If no file name is given, the space available on all currently mounted filesystems is shown.


dir, ls and vdir

dir and vdir are versions of ls with different default output formats. These programs list each given file or directory name. Directory contents are sorted alphabetically. For ls, files are, by default, listed in columns sorted vertically if the standard output is a terminal; otherwise they are listed one per line. For dir, files are, by default, listed in columns sorted vertically. For vdir, files are, by default, listed in long format.


dircolors

dircolors outputs commands to set the LS_COLOR environment variable. The LS_COLOR variable is use to change the default color scheme used by ls and related utilities.


dirname

dirname strips non-directory suffixes from file name.


du

du displays the amount of disk space used by each file or directory listed on the command-line and by each of their subdirectories.


echo

echo displays a line of text.


env

env runs a program in a modified environment.


expand

expand converts tabs in files to spaces, writing to standard output.


expr

expr evaluates expressions.


factor

factor prints the prime factors of all specified integer numbers.


false

false always exits with a status code indicating failure.


fmt

fmt reformats each paragraph in the specified file(s), writing to standard output.


fold

fold wraps input lines in each specified file (standard input by default), writing to standard output.


groups

groups prints a user's group memberships.


head

head prints the first xx (10 by default) lines of each specified file to standard output.


hostid

hostid prints the numeric identifier (in hexadecimal) for the current host.


hostname

hostname reports or sets the name of the current host.


id

id prints the effective user and group IDs of the current user or a given user.


install

install copies files and sets their permission modes and, if possible, their owner and group.


join

join joins lines of two files on a common field.


kill

kill terminates the given process.


ln

ln makes hard or soft (symbolic) links between files.


logname

logname prints the current user's login name.


md5sum

md5sum prints or checks MD5 checksums.


mkdir

mkdir creates directories with a given name.


mkfifo

mkfifo creates a FIFO with each given name.


mknod

mknod creates a FIFO, character special file or block special file with the given file name.


mv

mv moves files from one directory to another or renames files, depending on the arguments given to mv.


nice

nice runs a program with modified scheduling priority.


nl

nl writes each specified file to standard output, with line numbers added.


nohup

nohup runs a command immune to hangups, with output to a log file.


od

od writes an unambiguous representation, octal bytes by default, of a specified file to standard output.


paste

paste writes lines consisting of the sequentially corresponding lines from each specified file, separated by TABs, to standard output.


pathchk

pathchk checks whether file names are valid or portable.


pinky

pinky is a lightweight finger utility which retrieves information about a certain user.


pr

pr paginates or columnates files for printing.


printenv

printenv prints all or part of the environment.


printf

printf formats and prints data (the same as the C printf function).


ptx

ptx produces a permuted index of file contents.


pwd

pwd prints the name of the current/working directory.


rm

rm removes files or directories.


rmdir

rmdir removes directories, if they are empty.


seq

seq prints numbers in a certain range with a certain increment.


sha1sum

sha1sum prints or checks 160-bit SHA1checksums.


shred

shred deletes a file securely, overwriting it first so that its contents can't be recovered.


sleep

sleep delays for a specified amount of time.


sort

sort writes sorted concatenation of files to standard output.


split

split outputs fixed-size pieces of an input file to PREFIXaa, PREFIXab, ...


stty

stty changes and prints terminal line settings.


su

su runs a shell with substitute user and group IDs.


sum

sum prints checksum and block counts for each specified file.


sync

sync forces changed blocks to disk and updates the super block.


tac

tac writes each specified file to standard output, last line first.


tail

tail print the last xx (10 by default) lines of each specified file to standard output.


tee

tee reads from standard input and writes to standard output and files.


test

test checks file types and compares values.


touch

touch changes the access and modification times of each given file to the current time. Files that do not exist are created empty.


tr

tr translates, squeezes, and/or deletes characters from standard input, writing to standard output.


true

true always exits with a status code indicating success.


tsort

tsort writes totally ordered lists consistent with the partial ordering in specified files.


tty

tty prints the file name of the terminal connected to standard input.


uname

uname prints system information.


unexpand

unexpand converts spaces in each file to tabs, writing to standard output.


uniq

uniq removes duplicate lines from a sorted file.


uptime

uptime tells how long the system has been running.


users

users prints the user names of users currently logged in to the current host.


wc

wc prints line, word and byte counts for each specified file and a total line, if more than one file is specified.


who

who shows who is logged on.


whoami

whoami prints the user name associated with the current effective user ID.


yes

yes outputs 'y' or a given string repeatedly, until killed.



Coreutils Installation Dependencies

Not yet checked but probably something like this:

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, chown, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo


Diffutils

For installation instructions see the Section called Installing Diffutils-2.8.1 in Chapter 6.


Contents of Diffutils

(Last checked against version 2.8.1.)

The programs from this package show you the differences between two files or directories. It's most common use is to create software patches.

Diffutils installs the following files:


Program Files

cmp, diff, diff3 and sdiff



Descriptions

(Last checked against version 2.8.1.)


Program file descriptions

cmp and diff

cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.


diff3

The difference between diff and diff3 is that diff compares 2 files, diff3 compares 3 files.


sdiff

sdiff merges two files and interactively outputs the results.



Diffutils Installation Dependencies

(Last checked against version 2.7.)

Bash: sh
Binutils: ld, as
Coreutils: cat, chmod, cp,  date, hostname, install, mv, rm, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


E2fsprogs

For installation instructions see the Section called Installing E2fsprogs-1.34 in Chapter 6.


Contents of E2fsprogs

(Last checked against version 1.27.)

E2fsprogs provides the filesystem utilities for use with the ext2 filesystem. It also supports the ext3 filesystem with journaling support.

E2fsprogs installs the following:


Program Files

badblocks, chattr, compile_et, debugfs, dumpe2fs, e2fsck, e2image, e2label, fsck, fsck.ext2, fsck.ext3, lsattr, mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mklost+found, resize2fs, tune2fs and uuidgen


Library Files

libcom_err.[a,so], libe2p.[a,so], libext2fs.[a,so], libss.[a,so], libuuid.[a,so]



Descriptions

(Last checked against version 1.27.)


Program file descriptions

badblocks

badblocks is used to search for bad blocks on a device (usually a disk partition).


chattr

chattr changes the file attributes on a Linux second extended file system.


compile_et

compile_et is used to convert a table, listing error-code names and associated messages, into a C source file that is suitable for use with the com_err library.


debugfs

The debugfs program is a file system debugger. It can be used to examine and change the state of an ext2 file system.


dumpe2fs

dumpe2fs prints the super block and blocks group information for the filesystem present on a specified device.


e2fsck and fsck.ext2

e2fsck and fsck.ext2 are used to check, and optionally repair, Linux second extended filesystems.


e2image

e2image is used to save critical ext2 filesystem data to a file.


e2label

e2label will display or change the filesystem label on the ext2 filesystem located on the specified device.


fsck

fsck is used to check, and optionally repair, a Linux file system.


fsck.ext3

fsck.ext3 is used to check, and optionally repair, a Linux ext3 filesystems.


lsattr

lsattr lists the file attributes on a second extended file system.


mk_cmds

The mk_cmds utility takes a command table file as input and produces a C source file as output, which is intended to be used with the subsystem library, libss.


mke2fs and mkfs.ext2

mke2fs is used to create a Linux second extended file system on a device (usually a disk partition). mkfs.ext2 does the same as mke2fs.


mkfs.ext3

mkfs.ext3 is used to create an ext3 filesystem.


mklost+found

mklost+found is used to create a lost+found directory in the current working directory on a Linux second extended file system. mklost+found pre-allocates disk blocks to the directory to make it usable by e2fsck.


resize2fs

resize2fs is used to resize ext2 file systems.


tune2fs

tune2fs adjusts tunable filesystem parameters on a Linux second extended filesystem.


uuidgen

The uuidgen program creates a new universally unique identifier (UUID) using the libuuid library. The new UUID can reasonably be considered unique among all UUIDs created, on the local system and on other systems, in the past and in the future.


Library file descriptions

libcom_err

The common error display routine.


libe2p

libe2p is used by dumpe2fs, chattr, and lsattr.


libext2fs

The ext2fs library is designed to allow user-level programs to manipulate an ext2 filesystem.


libss

libss is used by debugfs.


libuuid

The libuuid library is used to generate unique identifiers for objects that may be accessible beyond the local system.



E2fsprogs Installation Dependencies

(Last checked against version 1.25.)

Bash: sh
Binutils: ar, as, ld, ranlib, strip
Coreutils: basename, cat, chmod, cp, echo, expr, hostname,
             install, ln, mkdir, mv, rm, sync, tr, uname
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, grep
Gzip: gzip
Make: make
Sed: sed
Texinfo: makeinfo


Ed

For installation instructions see the Section called Installing Ed-0.2 in Chapter 6.


Contents of Ed

(Last checked against version 0.2.)

GNU ed is an 8-bit clean, POSIX-compliant line editor.

Ed installs the following:


Program Files

ed and red (link to ed)



Descriptions

(Last checked against version 0.2.)


Program file description

ed

ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.


red

red is a restricted ed: it can only edit files in the current directory and cannot execute shell commands.



Ed Installation Dependencies

(Last checked against version 0.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, cp, hostname, install, ln, mv, rm, touch, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


File

For installation instructions see the Section called Installing File-4.04 in Chapter 6.


Contents of File

(Last checked against version 3.39.)

File is a utility used to determine file types.

File installs the following:



Descriptions

(Last checked against version 3.39.)


Program file descriptions

file

file tests each specified file in an attempt to classify it. There are three sets of tests, performed in this order: filesystem tests, magic number tests and language tests. The first test that succeeds causes the file type to be printed.



File Installation Dependencies

(Last checked against version 3.37.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, echo, expr, hostname, install, ln, ls, mv, rm,
             sleep, touch, tr
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: makeinfo


Findutils

For installation instructions see the Section called Installing Findutils-4.1.20 in Chapter 6.


Contents of Findutils

(Last checked against version 4.1.)

The Findutils package contains programs to find files, either on-the-fly (by doing a live recursive search through directories and only showing files that match the specifications) or by searching through a database.

Findutils installs the following:


Program Files

bigram, code, find, frcode, locate, updatedb and xargs



Descriptions

(Last checked against version 4.1.)


Program file descriptions

bigram

bigram is used together with code to produce older-style locate databases. To learn more about these last three programs, read the locatedb.5 manual page.


code

code is the ancestor of frcode. It was used in older-style locate databases.


find

The find program searches for files in a directory hierarchy which match a certain criteria. If no criteria is given, it lists all files in the current directory and its subdirectories.


frcode

frcode is called by updatedb to compress the list of file names using front-compression, which reduces the database size by a factor of 4 to 5.


locate

locate scans a database which contains all files and directories on a filesystem. This program lists the files and directories in this database matching a certain criteria. If a user is looking for a file this program will scan the database and tell him exactly where the files he requested are located. This only makes sense if the locate database is fairly up-to-date, else it will provide out-of-date information.


updatedb

The updatedb program updates the locate database. It scans the entire file system (including other file systems that are currently mounted unless it is told not to do so) and puts every directory and file it finds into the database that's used by the locate program, which retrieves this information. It's good practice to update this database once a day to have it up-to-date whenever it is needed.


xargs

The xargs command applies a command to a list of files. If there is a need to perform the same command on multiple files, a list can be created that names all those files (one per line) and xargs can perform that command on those files.



Findutils Installation Dependencies

(Last checked against version 4.1.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, hostname, install, mv, rm, tr
Diffutils: cmp
Grep: egrep, grep
GCC: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed


Flex

For installation instructions see the Section called Installing Flex-2.5.4a in Chapter 6.


Contents of Flex

(Last checked against version 2.5.4a.)

The Flex package is used to generate programs which recognize patterns in text.

Flex installs the following:


Program Files

flex, flex++ (link to flex) and lex



Descriptions

(Last checked against version 2.5.4a.)


Program file descriptions

flex

flex is a tool for generating programs which recognize patterns in text. Pattern recognition is very useful in many applications. A user sets up rules about what to look for and flex will make a program that looks for those patterns. The reason people use flex is that it is much easier to set up rules for what to look for than to write the actual program which finds the text.


flex++

flex++ invokes a version of flex which is used exclusively for C++ scanners.


lex

We create a bash script called lex which calls flex using the -l option. This is for compatibility purposes for programs which use lex instead of flex.


Library file descriptions

libfl

libfl is the flex library.



Flex Installation Dependencies

(Last checked against version 2.5.4a.)

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Coreutils: cat, chmod, cp, echo, hostname, install, ln, mv, rm, touch, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


Gawk

For installation instructions see the Section called Installing Gawk-3.1.3 in Chapter 6.


Contents of Gawk

(Last checked against version 3.1.1.)

Gawk is an awk implementation that is used to manipulate text files.

Gawk installs the following:


Program Files

awk, gawk, gawk-3.1.1, grcat, igawk, pgawk, pgawk-3.1.1, pwcat



Descriptions

(Last checked against version 3.1.1.)


Program file descriptions

awk

awk is a symbolic link to gawk.


gawk, gawk-3.1.1

gawk is the GNU implementation of awk, a pattern scanning and processing language.


grcat

grcat concatenates the group database, /etc/group.


igawk

igawk is a shell script which gives gawk the ability to include files.


pgawk, pgawk-3.1.1

pgawk is the profiling version of gawk.


pwcat

pwcat concatenates the password database, /etc/passwd.



Gawk Installation Dependencies

(No dependencies checked yet.)


GCC

For installation instructions see the Section called Installing GCC-3.3.1 in Chapter 6.


Contents of GCC

(Last checked against version 3.1.)

The GCC package contains the GNU compiler collection, including the C and C++ compilers.

GCC installs the following files:


Program Files

c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0


Library Files

libgcc.a, libgcc_eh.a, libgcc_s.so, libiberty.a, libstdc++.[a,so], libsupc++.a



Descriptions

(Last checked against version 3.1.)


Program file descriptions

cc, cc1, cc1plus, gcc

These are the C compiler. A compiler translates source code in text format to a format that a computer understands. After a source code file is compiled into an object file, a linker will create an executable file from one or more of these compiler generated object files.


c++, cc1plus, g++

These are the C++ compiler, the equivalent of cc and gcc etc.


c++filt

The C++ language provides function overloading, which means that it is possible to write many functions with the same name (providing each takes parameters of different types). All C++ function names are encoded into a low-level assembly label (this process is known as mangling). The c++filt program does the inverse mapping: it decodes (demangles) low-level names into user-level names so that the linker can keep these overloaded functions from clashing.


collect2

collect2 assists with the compilation of constructors.


cpp, cpp0

cpp pre-processes a source file, such as including the contents of header files into the source file. Simply add a line, such as #include <filename>, to your source file. The preprocessor will insert the contents of the included file into the source file.


gccbug

gccbug is a shell script which is used to simplify the creation of bug reports.


gcov

gcov analyzes programs to help create more efficient, faster running code through optimization.


tradcpp0

No description is currently available.


Library file descriptions

libgcc, libgcc_eh, libgcc_s

Run-time support files for gcc.


libiberty

libiberty is a collection of subroutines used by various GNU programs including getopt, obstack, strerror, strtol and strtoul.


libstdc++

libstdc++ is the C++ library. It is used by C++ programs and contains functions that are frequently used in C++ programs. This way the programmer doesn't have to write certain functions (such as writing a string of text to the screen) from scratch every time he creates a program.


libsupc++

libsupc++ provides support for the c++ programming language. Among other things, libsupc++ contains routines for exception handling.



GCC Installation Dependencies

(Last checked against version 2.95.3.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib
Coreutils: basename, cat, chmod, cp, dirname, echo, expr, hostname, ln
             ls, mkdir, mv, rm, sleep, tail, touch, tr, true, uname
Diffutils: cmp
Find: find
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Tar: tar
Texinfo: install-info, makeinfo


Gettext

For installation instructions see the Section called Installing Gettext-0.12.1 in Chapter 6.


Contents of Gettext

(Last checked against version 0.11.2.)

The Gettext package is used for internationalization and localization. Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the user's native language.

Gettext installs the following:


Program Files

config.charset, config.rpath, gettext, gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, ngettext, project-id, team-address, trigger, urlget, user-email and xgettext


Library Files

libgettextlib[a,so], libgettextsrc[a,so]



Descriptions

(Last checked against version 0.11.2.)


Program file descriptions

config.charset

The config.charset script outputs a system-dependent table of character encoding aliases.


config.rpath

The config.rpath script outputs a system-dependent set of variables, describing how to set the run time search path of shared libraries in an executable.


gettext

The gettext package is used for internationalization (also known as i18n) and for localization (also known as l10n). Programs can be compiled with Native Language Support (NLS) which enable them to output messages in the user's native language rather than in the default English language.


gettextize

The gettextize program copies all standard gettext files into a directory. It's used to make a package with gettext translations.


hostname

The hostname program displays a network hostname in various forms.


msgattrib

The msgattrib program filters the messages of a translation catalog according to their attributes and manipulates the attributes.


msgcat

The msgcat program finds messages which are common in several raw translations.


msgcmp

The msgcmp program compares two raw translation files.


msgcomm

The msgcomm program searches messages which appear in several .po files. It's used to compare how things are translated.


msgconv

The msgconv program converts a translation catalog to a different character encoding.


msgen

The msgen program creates an English translation catalog.


msgexec

The msgexec program applies a command to all translations of a translation catalog.


msgfilter

The msgfilter program applies a filter to all translations of a translation catalog.


msgfmt

The msgfmt program compiles raw translation into machine code. It's used to create the final program/package translation file.


msggrep

The msggrep program extracts all messages of a translation catalog that match a given pattern or belong to some given source files.


msginit

The msginit program creates a new PO file, initializing the meta information with values from the user's environment.


msgmerge

The msgmerge program combines two raw translations into one file. It's used to update the raw translation with the source extract.


msgunfmt

The msgunfmt program decompiles translation files into raw translation text. It can only be used if the compiled versions are available.


msguniq

The msguniq program unifies duplicate translations in a translation catalog.


ngettext

The ngettext program displays native language translations of a textual message whose grammatical form depends on a number.


project-id

The project-id script prints a package's identification package version or package.


team-address

The team-address script prints the team's address to stdout and outputs additional instructions.


trigger

The trigger script tests whether the current package is a GNOME or KDE package.


urlget

The urlget program gets the contents of a URL.


user-email

The user-email script prints the user's email address, with confirmation from the user.


xgettext

The xgettext program extracts the message lines from the programmers' C files. It's used to make the first translation template.


Library file descriptions

libgettextlib

No description is currently available.


libgettextsrc

No description is currently available.



Gettext Installation Dependencies

(Last checked against version 0.10.40.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Bison: bison
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln,
             ls, mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo


Glibc

For installation instructions see the Section called Installing Glibc-2.3.2 in Chapter 6.


Official Download Location

Glibc (2.3.2): 
ftp://ftp.gnu.org/gnu/glibc/

Glibc-linuxthreads (2.3.2): 
ftp://ftp.gnu.org/gnu/glibc/

Glibc Root/Perl Patch (2.3.1):
http://downloads.linuxfromscratch.org/

Glibc Libnss Patch (2.3.1):
http://downloads.linuxfromscratch.org/


Contents of Glibc

(Last checked against version 2.2.5.)

Glibc is the C library that provides the system calls and basic functions such as open, malloc, printf, etc. The C library is used by all dynamically linked programs.

Glibc installs the following files:


Program Files

catchsegv, gencat, getconf, getent, glibcbug, iconv, iconvconfig, ldconfig, ldd, lddlibc4, locale, localedef, mtrace, nscd, nscd_nischeck, pcprofiledump, pt_chown, rpcgen, rpcinfo, sln, sprof, tzselect, xtrace, zdump and zic


Library Files

ld.so, libBrokenLocale.[a,so], libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,so], libc_nonshared.a, libcrypt.[a,so], libdl.[a,so], libg.a, libieee.a, libm.[a,so], libmcheck.a, libmemusage.so, libnsl.a, libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.[a,so], libresolv.[a,so], librpcsvc.a, librt.[a,so], libthread_db.so and libutil.[a,so]



Descriptions

(Last checked against version 2.2.5.)


Program file descriptions

catchsegv

catchsegv can be used to create a stack trace when a program terminates with a segmentation fault.


gencat

gencat generates message catalogues.


getconf

getconf displays the system configuration values for filesystem specific variables.


getent

getent gets entries from an administrative database.


glibcbug

glibcbug creates a bug report about glibc and and mails it to the bug email address.


iconv

iconv performs character set conversion.


iconvconfig

iconvconfig creates fastloading iconv module configuration file.


ldconfig

ldconfig configures the dynamic linker run time bindings.


ldd

ldd prints the shared libraries required by each program or shared library specified on the command line.


lddlibc4

lddlibc4 assists ldd with object files.


locale

locale is a Perl program which tells the compiler to enable (or disable) the use of POSIX locales for built-in operations.


localedef

localedef compiles locale specifications.


mtrace

(No description available yet.)


nscd

nscd is a daemon that provides a cache for the most common name service requests.


nscd_nischeck

nscd_nischeck checks whether or not secure mode is necessary for NIS+ lookup.


pcprofiledump

pcprofiledump dumps information generated by PC profiling.


pt_chown

pt_chown sets the owner, group and access permission of the slave pseudo terminal corresponding to the master pseudo terminal passed on file descriptor `3'. This is the helper program for the `grantpt' function. It is not intended to be run directly from the command line.


rpcgen

rpcgen generates C code to implement the RPC protocol.


rpcinfo

rpcinfo makes an RPC call to an RPC server.


sln

sln symbolically links dest to source. It is statically linked, needing no dynamic linking at all. Thus sln is useful to make symbolic links to dynamic libraries if the dynamic linking system for some reason is nonfunctional.


sprof

sprof reads and displays shared object profiling data.


tzselect

tzselect asks the user for information about the current location and outputs the resulting time zone description to standard output.


xtrace

xtrace traces execution of program by printing the currently executed function.


zdump

zdump is the time zone dumper.


zic

zic is the time zone compiler.


Library file descriptions

ld.so

ld.so is the helper program for shared library executables.


libBrokenLocale

Used by software, such as Mozilla, to solve broken locales.


libSegFault

libSegFault is a segmentation fault signal handler. It tries to catch segfaults.


libanl

libanl is an asynchronous name lookup library.


libbsd-compat

libbsd-compat provides the portability needed in order to run certain programs in Linux.


libc, libc_nonshared

These files constitute the main C library. The C library is a collection of commonly used functions in programs. This way a programmer doesn't need to create his own functions for every single task. The most common things like writing a string to the screen are already present and at the disposal of the programmer.

The C library (actually almost every library) comes in two flavors: a dynamic and a static one. In short, when a program uses a static C library, the code from the C library is copied into the executable file. When a program uses a dynamic library, the executable will not contain the code from the C library, but instead a routine that loads the functions from the library at the time the program is run. This means a significant decrease in the file size of a program. The documentation that comes with the C library describes this in more detail, as it is too complicated to explain here in one or two lines.


libcrypt

libcrypt is the cryptography library.


libdl

libdl is the dynamic linking interface library.


libg

libg is a runtime library for g++.


libieee

libieee is the IEEE floating point library.


libm

libm is the mathematical library.


libmcheck

libmcheck contains code run at boot.


libmemusage

libmemusage is used by memusage to help collect information about the memory usage of a program.


libnsl

libnsl is the network services library.


libnss_compat, libnss_dns, libnss_files, libnss_hesiod, libnss_nis, libnss_nisplus

The basic idea is to put the implementation of the different services offered to access the databases in separate modules. This has some advantages:

  • contributors can add new services without adding them to GNU C library,

  • the modules can be updated separately,

  • the C library image is smaller.


libpcprofile

Code used by the kernel to track CPU time spent in functions, source code lines, and instructions.


libpthread

The POSIX threads library.


libresolv

Functions in this library provide for creating, sending, and interpreting packets to the Internet domain name servers.


librpcsvc

Functions in this library provide miscellaneous RPC services.


librt

Functions in this library provide most of the interfaces specified by the POSIX.1b Realtime Extension.


libthread_db

Functions is this library are useful for building debuggers for multi-threaded programs.


libutil

Contains code for "standard" functions used in many different Unix utilities.



Glibc Installation Dependencies

(Last checked against version 2.2.5.)

Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Coreutils: cat, chmod, cp, cut, date, expr, hostname, install, ln,
             mknod, mv, mkdir, rm, pwd, sort, touch, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Sed: sed
Texinfo: install-info, makeinfo


Grep

For installation instructions see the Section called Installing Grep-2.5.1 in Chapter 6.


Contents of Grep

(Last checked against version 2.5.)

Grep is a program used to print lines from a file matching a specified pattern.

Grep installs the following:


Program Files

egrep (link to grep), fgrep (link to grep) and grep



Descriptions

(Last checked against version 2.5.)


Program file descriptions

egrep

egrep prints lines from files matching an extended regular expression pattern.


fgrep

fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.


grep

grep prints lines from files matching a basic regular expression pattern.



Grep Installation Dependencies

(Last checked against version 2.4.2.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chmod, echo, expr, hostname, install,
             ls, mkdir, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo


Groff

For installation instructions see the Section called Installing Groff-1.19 in Chapter 6.


Contents of Groff

(Last checked against version 1.17.2.)

The Groff package includes several text processing programs for text formatting. Groff translates standard text and special commands into formatted output, such as what you see in a manual page.

Groff installs the following:


Program Files

addftinfo, afmtodit, eqn, geqn (link to eqn), grn, grodvi, groff, grog, grolbp, grolj4, grops, grotty, gtbl (link to tbl), hpftodit, indxbib, lkbib, lookbib, mmroff, neqn, nroff, pfbtops, pic, post-grohtml, pre-grohtml, refer, soelim, tbl, tfmtodit, troff and zsoelim (link to soelim)



Descriptions

(Last checked against version 1.17.2.)


Program file descriptions

addftinfo

addftinfo reads a troff font file and adds some additional font-metric information that is used by the groff system.


afmtodit

afmtodit creates a font file for use with groff and grops.


eqn

eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff.


geqn

geqn is the GNU implementation of eqn.


grn

grn is a groff preprocessor for gremlin files.


grodvi

grodvi is a driver for groff that produces TeX dvi format.


groff

groff is a front-end to the groff document formatting system. Normally it runs the troff program and a post-processor appropriate for the selected device.


grog

grog reads files and guesses which of the groff options -e, -man, -me, -mm, -ms, -p, -s, and -t are required for printing files, and prints the groff command including those options on the standard output.


grolbp

grolbp is a groff driver for Canon CAPSL printers (LBP-4 and LBP-8 series laser printers).


grolj4

grolj4 is a driver for groff that produces output in PCL5 format suitable for an HP Laserjet 4 printer.


grops

grops translates the output of GNU troff to Postscript.


grotty

grotty translates the output of GNU troff into a form suitable for typewriter-like devices.


gtbl

gtbl is the GNU implementation of tbl.


hpftodit

hpftodit creates a font file for use with groff -Tlj4 from an HP tagged font metric file.


indxbib

indxbib makes an inverted index for the bibliographic databases a specified file for use with refer, lookbib, and lkbib.


lkbib

lkbib searches bibliographic databases for references that contain specified keys and prints any references found on the standard output.


lookbib

lookbib prints a prompt on the standard error (unless the standard input is not a terminal), reads from the standard input a line containing a set of keywords, searches the bibliographic databases in a specified file for references containing those keywords, prints any references found on the standard output and repeats this process until the end of input.


mmroff

mmroff is a simple preprocessor for groff.


neqn

The neqn script formats equations for ascii output.


nroff

The nroff script emulates the nroff command using groff.


pfbtops

pfbtops translates a Postscript font in .pfb format to ASCII.


pic

pic compiles descriptions of pictures embedded within troff or TeX input files into commands that are understood by TeX or troff.


pre-grohtml and post-grohtml

pre- and post-grohtml translate the output of GNU troff to html.


refer

refer copies the contents of a file to the standard output, except that lines between .[ and .] are interpreted as citations, and lines between .R1 and .R2 are interpreted as commands about how citations are to be processed.


soelim

soelim reads files and replaces lines of the form .so file by the contents of file.


tbl

tbl compiles descriptions of tables embedded within troff input files into commands that are understood by troff.


tfmtodit

tfmtodit creates a font file for use with groff -Tdvi.


troff

troff is highly compatible with Unix troff. Usually it should be invoked using the groff command, which will also run preprocessors and post-processors in the appropriate order and with the appropriate options.


zsoelim

zsoelim is the GNU implementation of soelim.



Groff Installation Dependencies

(Last checked against version 1.17.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Coreutils: basename, cat, chmod, cp, date, echo, expr, hostname, install,
             ln, ls, mkdir, mv, rm, touch, tr, uname
Diffutils: cmp
Gawk: awk
GCC: cc1, cc1plus, collect2, cpp0, g++, gcc
Grep: egrep, grep
Make: make
Sed: sed


Gzip

For installation instructions see the Section called Installing Gzip-1.3.5 in Chapter 6.


Contents of Gzip

(Last checked against version 1.2.4a.)

The gzip package contains programs to compress and decompress files using the Lempel-Ziv coding (LZ77).

Gzip installs the following:


Program Files

gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew



Descriptions

(Last checked against version 1.2.4a.)


Program file descriptions

gunzip, uncompress

gunzip and uncompress decompress files which are compressed with gzip.


gzexe

gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).


gzip

gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).


zcat

zcat uncompresses, and writes to standard output, either a list of files on the command line or a file being read from standard input.


zcmp

zcmp invokes the cmp program on compressed files.


zdiff

zdiff invokes the diff program on compressed files.


zforce

zforce forces a .gz extension on all gzip files so that gzip will not compress them twice. This can be useful for files with names truncated after a file transfer.


zgrep

zgrep invokes the grep program on compressed files.


zmore

zmore is a filter which allows examination of compressed or plain text files, one screen at a time on a soft-copy terminal (similar to the more program).


znew

znew re-compresses files from .Z (compress) format to .gz (gzip) format.



Gzip Installation Dependencies

(Last checked against version 1.2.4a.)

Bash: sh
Binutils: as, ld, nm
Coreutils: cat, chmod, cp, hostname, install, ln, mv, rm, tr
GCC: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


Inetutils

For installation instructions see the Section called Installing Inetutils-1.4.2 in Chapter 6.



Contents of Inetutils

(Last checked against version 1.4.2.)

The Inetutils package contains network clients and servers.

Inetutils installs the following:


Program Files

ftp, ping, rcp, rlogin, rsh, talk, telnet, tftp, whois, ftpd, inetd, rexecd, rlogind, rshd, talkd, telnetd, tftpd, uucpd



Descriptions

(Last checked against version 1.4.2.)


Program file descriptions

ftp

ARPANET file transfer program.


ping

send ICMP_ECHO_REQUEST packets to network hosts.


rcp

remote file copy.


rlogin

remote login.


rsh

remote shell.


talk

talk to another user.


telnet

user interface to the TELNET protocol.


tftp

trivial file transfer program.


whois

client for whois directory service.


ftpd

DARPA Internet File Transfer Protocol server.


inetd

internet super-service.


rexecd

remote execution server.


rlogind

remote login server.


rshd

remote shell server.


talkd

remote user communication server.


telnetd

DARPA TELNET protocol server.


tftpd

Internet Trivial File Transfer Protocol server.


uucpd

No description available.



Inetutils Installation Dependencies

(No dependencies checked yet.)


Kbd

For installation instructions see the Section called Installing Kbd-1.08 in Chapter 6.


Contents of Kbd

(Last checked against version 1.06.)

Kbd contains keytable files and keyboard utilities.

Kbd installs the following:


Program Files

chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, getunimap, kbd_mode, kbdrate, loadkeys, loadunimap, mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to psfxtable), psfstriptable (link to psfxtable), psfxtable, resizecons, setfont, setkeycodes, setleds, setlogcons, setmetamode, setvesablank, showfont, showkey, unicode_start, and unicode_stop



Descriptions

(Last checked against version 1.06.)


Program file descriptions

chvt

chvt changes foreground virtual terminal.


deallocvt

deallocvt deallocates unused virtual terminals.


dumpkeys

dumpkeys dumps keyboard translation tables.


fgconsole

fgconsole prints the number of the active virtual terminal.


getkeycodes

getkeycodes prints the kernel scancode-to-keycode mapping table.


getunimap

getunimap prints the currently used unimap.


kbd_mode

kbd_mode reports or sets the keyboard mode.


kbdrate

kbdrate sets the keyboard repeat and delay rates.


loadkeys

loadkeys loads keyboard translation tables.


loadunimap

loadunimap loads the kernel unicode-to-font mapping table.


mapscrn

mapscrn loads a user defined output character mapping table into the console driver. Note that it is obsolete and that its features are built into setfont.


openvt

openvt starts a program on a new virtual terminal (VT).


psfaddtable, psfgettable, psfstriptable, psfxtable

These are a set of tools for handling Unicode character tables for console fonts.


resizecons

resizecons changes the kernel idea of the console size.


setfont

This lets you change the EGA/VGA fonts in console.


setkeycodes

setkeycodes loads kernel scancode-to-keycode mapping table entries.


setleds

setleds sets the keyboard LEDs. Many people find it useful to have numlock enabled by default and, by using this program, you can achieve this.


setlogcons

setlogcons sends kernel messages to the console.


setmetamode

setmetamode defines the keyboard meta key handling.


setvesablank

This lets you fiddle with the built-in hardware screensaver (not toasters, only a blank screen).


showfont

showfont displays data about a font. The information shown includes font information, font properties, character metrics and character bitmaps.


showkey

showkey examines the scancodes and keycodes sent by the keyboard.


unicode_start

unicode_start puts the console in Unicode mode.


unicode_stop

unicode_stop reverts keyboard and console from unicode mode.



Kbd Installation Dependencies

(Last checked against version 1.06.)

Bash: sh
Binutils: as, ld, strip
Bison: bison
Coreutils: cp, install, ln, mv, rm, uname
Diffutils: cmp
Flex: flex
GCC: cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Grep: grep
Gzip: gunzip, gzip
Make: make
Patch: patch
Sed: sed


Less

For installation instructions see the Section called Installing Less-381 in Chapter 6.


Contents of Less

(Last checked against version 374.)

Less is a file pager, or text viewer. It displays the contents of a file, or stream, and has the ability to scroll. Less has a few features not included in the more pager, such as the ability to scroll backwards.

Less installs the following:


Program Files

less, lessecho and lesskey



Descriptions

(Last checked against version 374.)


Program file descriptions

less

The less program is a file pager (or text viewer). It displays the contents of a file and has the ability to scroll. Less is an improvement on the common pager called "more". Less has the ability to scroll backwards through files as well and it doesn't need to read the entire file when it starts, which makes it faster when reading large files.


lessecho

lessecho is needed to expand metacharacters, such as * and ?, in filenames on Unix systems.


lesskey

lesskey is used to specify key bindings for less.



Less Installation Dependencies

(Last checked against version 358.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, expr, hostname, install, mv, rm, touch, tr, uname
Diffutils: cmp
Grep: egrep, grep
GCC: cc1, collect2, cpp0, gcc
Ncurses: (libraries)
Make: make
Sed: sed


LFS-Bootscripts

For installation instructions see the Section called Installing LFS-Bootscripts-1.11 in Chapter 6.


Contents of LFS-bootscripts

(Last checked against version 1.11.)

The LFS-Bootscripts package contains SysV init style shell scripts. These scripts do various tasks such as check filesystem integrity during boot, load keymaps, setup networks and halt processes at shutdown.

LFS-bootscripts installs the following:


Scripts

checkfs, cleanfs, functions, halt, ifdown, ifup, loadkeys, localnet, mountfs, mountproc, network, rc, reboot, sendsignals, setclock, swap, sysklogd and template



Descriptions

(Last checked against version 1.11.)


Program file descriptions

checkfs

The checkfs script checks the file systems just before they are mounted (with the exception of journal and network based file systems).


cleanfs

The cleanfs script removes files that shouldn't be preserved between reboots, such as /var/run/* and /var/lock/*. It re-creates /var/run/utmp and removes the possibly present /etc/nologin, /fastboot and /forcefsck files.


functions

The functions script contains functions shared among different scripts such as error checking, status checking, etc.


halt

The halt script halts the system.


ifdown, ifup

The ifdown and ifup scripts assist the network script with network devices.


loadkeys

The loadkeys script loads the keymap table you specified as proper for your keyboard layout.


localnet

The localnet script sets up the system's hostname and local loopback device.


mountfs

The mountfs script mounts all file systems that aren't marked noauto or aren't network based.


mountproc

The mountproc script is used to mount the proc filesystem.


network

The network script sets up network interfaces, such as network cards, and sets up the default gateway where applicable.


rc

The rc script is the master runlevel control script. It is responsible for running all the other scripts one-by-one in a specific sequence.


reboot

The reboot scripts reboots the system.


sendsignals

The sendsignals script makes sure every process is terminated before the system reboots or halts.


setclock

The setclock scripts resets the kernel clock to localtime in case the hardware clock isn't set to GMT time.


swap

The swap scripts enables and disables swap files and partitions.


sysklogd

The sysklogd script starts and stops the system and kernel log daemons.


template

The template script is a template you can use to create your own bootscripts for your other daemons.



LFS-Bootscripts Installation Dependencies

(Last checked against version 1.11.)

Coreutils: chown, cp


Lfs-Utils

For installation instructions see the Section called Installing Lfs-Utils-0.3 in Chapter 6.



Contents of Lfs-Utils

(Last checked against version 0.2.2.)

The Lfs-Utils package contains some miscellaneous programs used by various packages, but are not large enough to warrant their own individual package.

Lfs-Utils installs the following:


Program Files

mktemp, tempfile, http-get, iana-net



Descriptions

(Last checked against version 0.2.2.)


Program file descriptions

mktemp

mktemp creates temporary files in a secure manner for use in scripts.


tempfile

tempfile creates temporary files in a less secure manner than mktemp. It is installed for backwards-compatibility.


http-get

http-get is a script that takes advantage of a little known feature of Bash called "net redirection". It is used to download from websites without using any third-party programs.


iana-net

iana-net uses the http-get to simplify the process of procuring IANA's services and protocols configuration files.



Lfs-Utils Installation Dependencies

(No dependencies checked yet.)


Libtool

For installation instructions see the Section called Installing Libtool-1.5 in Chapter 6.


Contents of Libtool

(Last checked against version 1.4.2.)

GNU libtool is a generic library support script. Libtool hides the complexity of using shared libraries behind a consistent, portable interface.

Libtool installs the following:


Program Files

libtool and libtoolize


Library Files

libltdl.a, libltdl.so (link to libltdl.so.3.1.0), libltdl.so.3 (link to libltdl.so.3.1.0) and libltdl.so.3.1.0



Descriptions

(Last checked against version 1.4.2.)


Program file descriptions

libtool

libtool provides generalized library-building support services.


libtoolize

libtoolize provides a standard way to add libtool support to a package.


Library file descriptions

libltdl, libltdl.so.3, libltdl.so.3.1.0

A small library that aims at hiding, from programmers, the various difficulties of dlopening libraries.



Libtool Installation Dependencies

(Last checked against version 1.4.2.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Coreutils: cat, chmod, cp, echo, expr, hostname, install, ln, ls,
             mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: install-info


Linux (the kernel)

For installation instructions see the Section called Installing Linux-2.4.22 in Chapter 8.


Contents of Linux

(Last checked against version 2.4.18.)

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components: serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.

Linux installs the following files:


Program Files

kernel and kernel headers



Descriptions

(Last checked against version 2.4.18.)


Program file descriptions

linux kernel

The Linux kernel is at the core of every Linux system. It's what makes Linux tick. When a computer is turned on and boots a Linux system, the very first piece of Linux software that gets loaded is the kernel. The kernel initializes the system's hardware components: serial ports, parallel ports, sound cards, network cards, IDE controllers, SCSI controllers and a lot more. In a nutshell the kernel makes the hardware available so that the software can run.


linux kernel headers

These are the files we copy to /usr/include/{linux,asm} in Chapter 6. They should match those which glibc was compiled against and therefore should not be replaced when upgrading the kernel. They are essential for compiling many programs.



Linux Installation Dependencies

(Last checked against version 2.4.17.)

Bash: sh
Binutils: ar, as, ld, nm, objcopy
Coreutils: basename, cat, cp, date, expr, ln, md5sum, mkdir, mv,
             pwd, rm, sort, stty, tail, touch, uname, whoami, yes
Findutils: find, xargs
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed


M4

For installation instructions see the Section called Installing M4-1.4 in Chapter 6.


Contents of M4

(Last checked against version 1.4.)

M4 is a macro processor. It copies input to output, expanding macros as it goes. Macros are either built-in or user-defined and can take any number of arguments. Besides just doing macro expansion, m4 has built-in functions for including named files, running Unix commands, doing integer arithmetic, manipulating text in various ways, recursion, etc. The m4 program can be used either as a front-end to a compiler or as a macro processor in its own right.

M4 installs the following:



Descriptions

(Last checked against version 1.4.)


Program file descriptions

m4

m4 is a macro processor. It copies input to output, expanding macros as it goes. Macros are either built-in or user-defined and can take any number of arguments. Besides just doing macro expansion, m4 has built-in functions for including named files, running Unix commands, doing integer arithmetic, manipulating text in various ways, recursion, etc. The m4 program can be used either as a front-end to a compiler or as a macro processor in its own right.



M4 Installation Dependencies

(Last checked against version 1.4.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, cp, date, echo, hostname, install, mv, rm, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


Make

For installation instructions see the Section called Installing Make-3.80 in Chapter 6.


Contents of Make

(Last checked against version 3.79.1.)

Make determines, automatically, which pieces of a large program need to be recompiled and issues the commands to recompile them.

Make installs the following:



Descriptions

(Last checked against version 3.79.1.)


Program file descriptions

make

make determines, automatically, which pieces of a large program need to be recompiled and issues the commands to recompile them.



Make Installation Dependencies

(Last checked against version 3.79.1.)

Bash: sh
Binutils: as, ld
Coreutils: basename, cat, chgrp, chmod, echo, expr, hostname,
             install, ls, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo


MAKEDEV

For installation instructions see the Section called Creating devices (Makedev-1.7) in Chapter 6.


Contents of MAKEDEV

(Last checked against version 1.5.)

The MAKEDEV script creates the static device nodes which usually reside in the /dev directory. Detailed information about device nodes may be found in the Documentation/devices.txt file under the Linux kernel source tree.

MAKEDEV installs the following:



Descriptions

(Last checked against version 1.5.)


Program file descriptions

MAKEDEV

MAKEDEV is a script that creates the necessary static device nodes usually residing in the /dev directory. Detailed information on device nodes can be found in the Linux kernel source tree in Documentation/devices.txt.



MAKEDEV Installation Dependencies

(Last checked against version 1.5.)

Bash: sh
Coreutils: chmod, chown, cp, expr, id, ln, mknod, mv, rm
Grep: grep


Man

For installation instructions see the Section called Installing Man-1.5m2 in Chapter 6.


Contents of Man

(Last checked against version 1.5k.)

Man is a man pager.

Man installs the following:


Program Files

apropos, makewhatis, man, man2dvi, man2html and whatis



Description

(Last checked against version 1.5k.)


Program file descriptions

apropos

apropos searches for keywords in a set of database files, containing short descriptions of system commands, and displays the result on the standard output.


makewhatis

makewhatis reads all the manual pages contained in given sections of manpath or the pre-formatted pages contained in the given sections of catpath. For each page, it writes a line in the whatis database. Each line consists of the name of the page and a short description, separated by a dash. The description is extracted using the content of the NAME section of the manual page.


man

man formats and displays the on-line manual pages.


man2dvi

man2dvi converts a manual page into dvi format.


man2html

man2html converts a manual page into html.


whatis

whatis searches for keywords in a set of database files, containing short descriptions of system commands, and displays the result on the standard output. Only complete word matches are displayed.



Man Installation Dependencies

(Last checked against version 1.5i.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, cp, echo, install, mkdir, rm
Gawk: awk
GCC: c11, collect2, cpp0, gcc
Grep: grep
Make: make
Sed: sed


Man-pages

For installation instructions see the Section called Installing Man-pages-1.60 in Chapter 6.


Contents of Man-pages

(Last checked against version 1.54.)

The Man-pages package contains over 1200 manual pages. This documentation details the C and C++ functions, describes a few important device files and provides documents which would otherwise be missing from other packages.

Man-pages installs the following:


Support Files

Various manual pages.



Descriptions

(Last checked against version 1.54.)


Program file descriptions

manual pages

Examples of provided manual pages are the manual pages describing all the C and C++ functions, a few important /dev/ files and more.



Man-pages Installation Dependencies

(Last checked against version 1.47.)

Bash: sh
Coreutils: install
Make: make


Modutils

For installation instructions see the Section called Installing Modutils-2.4.25 in Chapter 6.


Contents of Modutils

(Last checked against version 2.4.16.)

The Modutils package contains programs that you can use to work with kernel modules.

Modutils installs the following:


Program Files

depmod, genksyms, insmod, insmod_ksymoops_clean, kallsyms (link to insmod), kernelversion, ksyms (link to insmod), lsmod (link to insmod), modinfo, modprobe (link to insmod) and rmmod (link to insmod)



Descriptions

(Last checked against version 2.4.16.)


Program file descriptions

depmod

depmod handles dependency descriptions for loadable kernel modules.


genksyms

genksyms reads (on standard input) the output from gcc -E source.c and generates a file containing version information.


insmod

insmod installs a loadable module in the running kernel.


insmod_ksymoops_clean

insmod_ksymoops_clean deletes saved ksyms and modules not accessed in 2 days.


kallsyms

kallsyms extracts all kernel symbols for debugging.


kernelversion

kernelversion reports the major version of the running kernel.


ksyms

ksyms displays exported kernel symbols.


lsmod

lsmod shows information about all loaded modules.


modinfo

modinfo examines an object file associated with a kernel module and displays any information that it can glean.


modprobe

modprobe uses a Makefile-like dependency file, created by depmod, to automatically load the relevant module(s) from the set of modules available in predefined directory trees.


rmmod

rmmod unloads loadable modules from the running kernel.



Modutils Installation Dependencies

(Last checked against version 2.4.12.)

Bash: sh
Binutils: ar, as, ld, ranlib, strip
Bison: bison
Coreutils: basename, cat, chmod, expr, hostname, install, ln,
             mkdir, mv, rm, tr, uname
Diffutils: cmp
Flex: flex
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


Ncurses

For installation instructions see the Section called Installing Ncurses-5.3 in Chapter 6.


Contents of Ncurses

(Last checked against version 5.2.)

The Ncurses package provides character and terminal handling libraries, including panels and menus.

Ncurses installs the following:


Program Files

captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput and tset.


Library Files

libcurses.[a,so] (link to libncurses.[a,so]), libform.[a,so], libform_g.a, libmenu.[a,so], libmenu_g.a, libncurses++.a, libncurses.[a,so], libncurses_g.a, libpanel.[a,so] and libpanel_g.a



Descriptions

(Last checked against version 5.2.)


Program file descriptions

captoinfo

captoinfo converts a termcap description into a terminfo description.


clear

clear clears the screen if this is possible. It looks in the environment for the terminal type and then in the terminfo database to figure out how to clear the screen.


infocmp

infocmp can be used to compare a binary terminfo entry with other terminfo entries, rewrite a terminfo description to take advantage of the use= terminfo field, or print out a terminfo description from the binary file (term) in a variety of formats (the opposite of what tic does).


infotocap

info to cap converts a terminfo description into a termcap description.


reset

reset sets cooked and echo modes, turns off cbreak and raw modes, turns on new-line translation and resets any unset special characters to their default values before doing terminal initialization the same way as tset.


tack

tack is the terminfo action checker.


tic

tic is the terminfo entry-description compiler. The program translates a terminfo file from source format into the binary format for use with the ncurses library routines. Terminfo files contain information about the capabilities of a terminal.


toe

toe lists all available terminal types by primary name with descriptions.


tput

tput uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell, to initialize or reset the terminal, or return the long name of the requested terminal type.


tset

tset initializes terminals so they can be used, but it's not widely used anymore. It's provided for 4.4BSD compatibility.


Library file descriptions

libcurses, libncurses++, libncurses, libncurses_g

These libraries are the base of the system and are used to display text (often in a fancy way) on the screen. An example where ncurses is used is in the kernel's "make menuconfig" process.


libform, libform_g

libform is used to implement forms in ncurses.


libmenu, libmenu_g

libmenu is used to implement menus in ncurses.


libpanel, libpanel_g

libpanel is used to implement panels in ncurses.



Ncurses Installation Dependencies

(Last checked against version 5.2.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, cp, date, echo, expr, hostname, install,
             ln, mkdir, mv, rm, sort, tr, uname, wc
Diffutils: cmp
Gawk: gawk
GCC: c++, cc1, cc1plus, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed


Net-tools

For installation instructions see the Section called Installing Net-tools-1.60 in Chapter 6.


Contents of Net-tools

(Last checked against version 1.60.)

The Net-tools package contains a collection of programs which form the base of Linux networking.

Net-tools installs the following:


Program Files

arp, dnsdomainname (link to hostname), domainname (link to hostname), hostname, ifconfig, nameif, netstat, nisdomainname (link to hostname), plipconfig, rarp, route, slattach and ypdomainname (link to hostname)



Descriptions

(Last checked against version 1.60.)


Program file descriptions

arp

arp is used to manipulate the kernel's ARP cache, usually to add or delete an entry, or to dump the ARP cache.


dnsdomainname

dnsdomainname shows the system's DNS domain name.


domainname

domainname shows or sets the system's NIS/YP domain name.


hostname

hostname prints or sets the name of the current host system.


ifconfig

The ifconfig command is the general command used to configure network interfaces.


nameif

nameif names network interfaces based on MAC addresses.


netstat

netstat is a multi-purpose tool used to print the network connections, routing tables, interface statistics, masquerade connections and multicast memberships.


nisdomainname

nisdomainname shows or sets system's NIS/YP domain name.


plipconfig

plipconfig is used to fine-tune the PLIP device parameters, hopefully making it faster.


rarp

Akin to the arp program, the rarp program manipulates the system's RARP table.


route

route is the general utility which is used to manipulate the IP routing table.


slattach

slattach attaches a network interface to a serial line, i.e.. puts a normal terminal line into one of several "network" modes.


ypdomainname

ypdomainname shows or sets the system's NIS/YP domain name.



Net-tools Installation Dependencies

(Last checked against version 1.60.)

Bash: bash, sh
Binutils: ar, as, ld
Coreutils: echo, install, ln, ls, mv, rm
GCC: cc, cc1, collect2, cpp0
Make: make


Patch

For installation instructions see the Section called Installing Patch-2.5.4 in Chapter 6.


Contents of Patch

(Last checked against version 2.5.4.)

The patch program modifies a file according to a patch file. A patch file usually is a list, created by the diff program, that contains instructions on how an original file needs to be modified.

Patch installs the following:



Descriptions

(Last checked against version 2.5.4.)


Program files descriptions

patch

The patch program modifies a file according to a patch file. A patch file usually is a list, created by the diff program, that contains instructions on how an original file needs to be modified. Patch is used a lot for source code patches since it saves time and space. Imagine a package that is 1 MB in size. The next version of that package only has changes in two files of the first version. It can be shipped as an entirely new package of 1 MB or just as a patch file of 1 KB, which will update the first version to make it identical to the second version. So if the first version was downloaded already, a patch file avoids a second large download.



Patch Installation Dependencies

(Last checked against version 2.5.4.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chmod, echo, expr, hostname, install, mv, rm, tr, uname
Diffutils: cmp
GCC: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed


Perl

For installation instructions see the Section called Installing Perl-5.8.0 in Chapter 6.


Contents of Perl

(Last checked against version 5.6.1.)

The Perl package contains perl, the Practical Extraction and Report Language. Perl combines some of the best features of C, sed, awk and sh into one powerful language.

Perl installs the following:


Program files and libraries

a2p, c2ph, dprofpp, find2perl, h2ph, h2xs, perl, perl5.6.1, perlbug, perlcc, perldoc, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, podchecker, podselect, pstruct, s2p, splain,attrs.so, B.so, ByteLoader.so, DProf.so, Dumper.so, DynaLoader.a, Fcntl.so, Glob.so, Hostname.so, IO.so, libperl.a, Opcode.so, Peek.so, POSIX.so, re.so, SDBM_File.so, Socket.so, Syslog.so and SysV.so



Descriptions

(Last checked against version 5.6.1.)


Program file descriptions

a2p

a2p is an awk to perl translator.


c2ph

c2ph dumps C structures as generated from "cc -g -S" stabs.


dprofpp

dprofpp displays perl profile data.


find2perl

find2perl translates find command lines to Perl code.


h2ph

h2ph converts .h C header files to .ph Perl header files.


h2xs

h2xs converts .h C header files to Perl extensions.


perl, perl5.6.1

perl is the Practical Extraction and Report Language. It combines some of the best features of C, sed, awk and sh into one powerful language.


perlbug

perlbug helps to generate bug reports about perl or the modules that come with it, and mail them.


perlcc

perlcc generates executables from Perl programs.


perldoc

perldoc looks up a piece of documentation in .pod format that is embedded in the perl installation tree or in a perl script and displays it via "pod2man | nroff -man | $PAGER".


pl2pm

pl2pm is a tool to aid in the conversion of Perl4-style .pl library files to Perl5-style library modules.


pod2html

pod2html converts files from pod format to HTML format.


pod2latex

pod2latex converts files from pod format to LaTeX format.


pod2man

pod2man converts pod data to formatted *roff input.


pod2text

pod2text converts pod data to formatted ASCII text.


pod2usage

pod2usage prints usage messages from embedded pod docs in files.


podchecker

podchecker checks the syntax of pod format documentation files.


podselect

podselect prints selected sections of pod documentation on standard output.


pstruct

pstruct dumps C structures as generated from "cc -g -S" stabs.


s2p

s2p is a sed to perl translator.


splain

splain is a program to force verbose warning diagnostics in perl.


Library file descriptions

attrs

No description is currently available.


B

No description is currently available.


ByteLoader

No description is currently available.


DProf

No description is currently available.


Dumper

No description is currently available.


DynaLoader

No description is currently available.


Fcntl

No description is currently available.


Glob

No description is currently available.


Hostname

No description is currently available.


IO

No description is currently available.


libperl

No description is currently available.


Opcode

No description is currently available.


Peek

No description is currently available.


POSIX

No description is currently available.


re

No description is currently available.


SDBM_File

No description is currently available.


Socket

No description is currently available.


Syslog

No description is currently available.


SysV

No description is currently available.



Perl Installation Dependencies

(Last checked against version 5.6.1.)

Bash: sh
Binutils: ar, as, ld, nm
Coreutils: basename, cat, chmod, comm, cp, date, echo, expr, hostname, ln,
             ls, mkdir, mv, pwd, rm, sort, split, touch, tr, uname, wc,
             whoami, uniq
Diffutils: cmp
Gawk: awk
GCC: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed


Procinfo

For installation instructions see the Section called Installing Procinfo-18 in Chapter 6.


Contents of Procinfo

(Last checked against version 18.)

The procinfo program gathers system data, such as memory usage and IRQ numbers, from the /proc directory and formats this data in a meaningful way.

Procinfo installs the following:


Program Files

lsdev, procinfo and socklist



Descriptions

(Last checked against version 18.)


Program file descriptions

lsdev

lsdev gathers information about your computer's installed hardware from the interrupts, ioports and dma files in the /proc directory, thus giving you a quick overview of which hardware uses what I/O addresses and what IRQ and DMA channels.


procinfo

procinfo gathers some system data from the /proc directory and prints it nicely formatted on the standard output device.


socklist

is a Perl script that gives you a list of all open sockets, enumerating types, port, inode, uid, pid, fd and the program to which it belongs.



Procinfo Installation Dependencies

(Last checked against version 18.)

Binutils: as, ld
Coreutils: install, mkdir
GCC: cc1, collect2, cpp0, gcc
Make: make


Procps

For installation instructions see the Section called Installing Procps-3.1.11 in Chapter 6.


Contents of Procps

(Last checked against version 2.0.7.)

The Procps package provides programs to monitor and halt system processes. Procps gathers information about processes via the /proc directory.

Procps installs the following:


Program Files

free, kill, oldps, pgrep, pkill, ps, skill, snice, sysctl, tload, top, vmstat, w and watch


Library Files

libproc.so



Descriptions

(Last checked against version 2.0.7.)


Program file descriptions

free

free displays the total amount of free and used physical and swap memory in the system, as well as the shared memory and buffers used by the kernel.


kill

kills sends signals to processes.


oldps and ps

ps gives a snapshot of the current processes.


pgrep

pgrep looks up processes based on name and other attributes.


pkill

pkill signals processes based on name and other attributes.


skill

skill sends signals to process matching a criteria.


snice

snice changes the scheduling priority for process matching a criteria.


sysctl

sysctl modifies kernel parameters at runtime.


tload

tload prints a graph of the current system load average to the specified tty or, if none is specified, the tty of the tload process.


top

top provides an ongoing look at processor activity in real time.


vmstat

vmstat reports information about processes, memory, paging, block IO, traps and cpu activity.


w

w displays information about the users, and their processes, currently on the machine.


watch

watch runs command repeatedly, displaying its output (the first screen full).


Library file descriptions

libproc

libproc is the library against which most of the programs in this set are linked to save disk space by implementing common functions only once.



Procps Installation Dependencies

(Last checked against version 2.0.7.)

Bash: sh
Binutils: as, ld, strip
Coreutils: basename, install, ln, mv, pwd, rm, sort, tr
Gawk: awk
GCC: cc1, collect2, cpp0, gcc
Grep: grep
Make: make
Sed: sed


Psmisc

For installation instructions see the Section called Installing Psmisc-21.3 in Chapter 6.


Contents of Psmisc

(Last checked against version 21.)

The Psmisc package contains three programs which help manage the /proc directory.

Psmisc installs the following:


Program Files

fuser, killall and pstree



Descriptions

(Last checked against version 21.)


Program file descriptions

Note that in LFS we don't install the pidof link by default because we use pidof from sysvinit instead.


fuser

fuser displays the PIDs of processes that use the specified files or file systems.


killall

killall sends a signal to all processes running any of the specified commands.


pstree

pstree shows running processes as a tree.



Psmisc Installation Dependencies

(Last checked against version 20.2.)

Bash: sh
Bison: bison
Binutils: as, ld
Coreutils: basename, cat, chmod, echo, expr, hostname, install,
             ls, mkdir, mv, rm, sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Grep: egrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: makeinfo


Sed

For installation instructions see the Section called Installing Sed-4.0.7 in Chapter 6.


Contents of Sed

(Last checked against version 3.02.)

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).

Sed installs the following:



Descriptions

(Last checked against version 3.02.)


Program file descriptions

sed

sed is a stream editor. A stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline).



Sed Installation Dependencies

(Last checked against version 3.02.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: cat, chmod, expr, hostname, install, ls, mv, rm, echo, sleep, tr
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Sed: sed
Texinfo: install-info, makeinfo


Shadow

For installation instructions see the Section called Installing Shadow-4.0.3 in Chapter 6.


Contents of Shadow

(Last checked against version 4.0.3.)

The Shadow package was created to strengthen the security of system passwords.

Shadow installs the following:


Program Files

chage, chfn, chpasswd, chsh, dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod, vigr (link to vipw) and vipw



Descriptions

(Last checked against version 4.0.3.)


Program file descriptions

chage

chage changes the number of days between password changes and the date of the last password change.


chfn

chfn changes a user's full name and other information (office room number, office phone number, and home phone number).


chpasswd

chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users.


chsh

chsh changes the user login shell.


dpasswd

dpasswd adds, deletes and updates dial-up passwords for user login shells.


expiry

expiry checks and enforces a password expiration policy.


faillog

faillog formats the contents of the failure log, /var/log/faillog, and maintains failure counts and limits.


gpasswd

gpasswd is used to administer the /etc/group file.


groupadd

The groupadd command creates a new group account using the values specified on the command line and the default values from the system.


groupdel

The groupdel command modifies the system account files, deleting all entries that refer to group.


groupmod

The groupmod command modifies the system account files to reflect the changes that are specified on the command line.


groups

groups prints the groups which a user is in.


grpck

grpck verifies the integrity of the system authentication information.


grpconv

grpunconv converts to shadow group files from normal group files.


grpunconv

grpunconv converts from shadow group files to normal group files.


lastlog

lastlog formats and prints the contents of the last login log, /var/log/lastlog. The login-name, port and last login time will be printed.


login

login is used to establish a new session with the system.


logoutd

logoutd enforces the login time and port restrictions specified in /etc/porttime.


mkpasswd

mkpasswd reads a file in the format given by the flags and converts it to the corresponding database file format.


newgrp

newgrp is used to change the current group ID during a login session.


newusers

newusers reads a file of user name and clear text password pairs and uses this information to update a group of existing users or to create new users.


passwd

passwd changes passwords for user and group accounts.


pwck

pwck verifies the integrity of the password files.


pwconv

pwconv converts the normal password file to a shadowed password file.


pwunconv

pwunconv converts a shadowed password file to a normal password file.


sg

sg sets the user's GID to that of the given group, or executes a given command as member of the given group.


useradd

useradd creates a new user or updates default new user information.


userdel

userdel modifies the system account files, deleting all entries that refer to a specified login name.


usermod

usermod modifies the system account files to reflect the changes that are specified on the command line.


vipw and vigr

vipw and vigr will edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively.


Library file descriptions

libmisc

No description is currently available.


libshadow

libshadow provides common functionality for the shadow programs.



Shadow Installation Dependencies

(Last checked against version 20001016.)

Bash: sh
Binutils: ar, as, ld, nm, ranlib
Coreutils: basename, cat, chmod, cp, echo, expr, install, ln, ls,
             mkdir, mv, rm, rmdir, sleep, sort, tr, uname, uniq
Diffutils: cmp
Gawk: gawk
GCC: cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: ldconfig
Grep: egrep, grep
M4: m4
Make: make
Net-tools: hostname
Sed: sed
Texinfo: makeinfo


Sysklogd

For installation instructions see the Section called Installing Sysklogd-1.4.1 in Chapter 6.


Contents of Sysklogd

(Last checked against version 1.4.1.)

The Sysklogd package contains programs for recording system log messages, such as those reported by the kernel.

Sysklogd installs the following:


Program Files

klogd and syslogd



Descriptions

(Last checked against version 1.4.1.)


Program file descriptions

klogd

klogd is a system daemon which intercepts and logs Linux kernel messages.


syslogd

syslogd provides the kind of logging that many modern programs use. Every logged message contains at least a time and a hostname field and, normally, a program name field, too. But that depends on how trusty the logging program is.



Sysklogd Installation Dependencies

(Last checked against version 1.4.1.)

Binutils: as, ld, strip
Coreutils: install
GCC: cc1, collect2, cpp0, gcc
Make: make


Sysvinit

For installation instructions see the Section called Installing Sysvinit-2.85 in Chapter 6.


Contents of Sysvinit

(Last checked against version 2.84.)

The Sysvinit package contains programs to control the startup, running and shutdown of all other programs.

Sysvinit installs the following:


Program Files

halt, init, killall5, last, lastb (link to last), mesg, pidof (link to killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit (link to init), utmpdump and wall



Descriptions

(Last checked against version 2.84.)


Program file descriptions

halt

halt notes, in the file /var/log/wtmp, that the system is being brought down and then tells the kernel to either halt, reboot or poweroff the system. If halt or reboot is called when the system is not in runlevel 0 or 6, shutdown will be invoked instead (with the flag -h or -r).


init

init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab. This file usually has entries which cause init to spawn gettys on each line from which users can log in. It also controls autonomous processes required by any particular system.


killall5

killall5 is the SystemV killall command. It sends a signal to all processes except the processes in its own session, so it won't kill the shell that is running the script it was called from.


last

last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.


lastb

lastb is the same as last, except that by default it shows a log of the file /var/log/btmp, which contains all the bad login attempts.


mesg

mesg controls the access to the user's terminal by others. It's typically used to allow or disallow other users to write to his terminal.


pidof

pidof displays the process identifiers (PIDs) of the named programs.


poweroff

poweroff is equivalent to shutdown -h -p now. It halts the computer and switches off the computer (when using an APM compliant BIOS and APM is enabled in the kernel).


reboot

reboot is equivalent to shutdown -r now. It reboots the computer.


runlevel

runlevel reads the system utmp file (usually /var/run/utmp), locates the runlevel record and prints the previous and current system runlevel on its standard output, separated by a single space.


shutdown

shutdown brings the system down in a secure way. All logged-in users are notified that the system is going down and login is blocked.


sulogin

sulogin is invoked by init when the system goes into single user mode (this is done through an entry in /etc/inittab). Init also tries to execute sulogin when it is passed the -b flag from the boot loader (LILO, for example).


telinit

telinit sends appropriate signals to init, telling it which runlevel to enter.


utmpdump

utmpdumps prints the content of a file (usually /var/run/utmp) on standard output in a user friendly format.


wall

wall sends a message to logged in users that have their mesg permission set to yes.



Sysvinit Installation Dependencies

(Last checked against version 2.84.)

Bash: sh
Binutils: as, ld
Coreutils: chown, cp, install, ln, mknod, rm
GCC: cc, cc1, collect2, cpp0
Make: make
Sed: sed


Tar

For installation instructions see the Section called Installing Tar-1.13.25 in Chapter 6.


Contents of Tar

(Last checked against version 1.13.)

Tar is an archiving program designed to store and extract files from an archive file known as a tar file.

Tar installs the following:


Program Files

rmt and tar



Descriptions

(Last checked against version 1.13.)


Program file descriptions

rmt

rmt is a program used by the remote dump and restore programs to manipulate a magnetic tape drive through an interprocess communication connection.


tar

tar is an archiving program designed to store and extract files from an archive file known as a tar file.



Tar Installation Dependencies

(Last checked against version 1.13.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, install, ls, mv, rm,
             sleep, tr, uname
Diffutils: cmp
Gawk: gawk
GCC: cc, cc1, collect2, cpp0, gcc
Gettext: msgfmt, xgettext
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Net-tools: hostname
Patch: patch
Sed: sed
Texinfo: install-info, makeinfo


Texinfo

For installation instructions see the Section called Installing Texinfo-4.6 in Chapter 6.


Contents of Texinfo

(Last checked against version 4.2.)

The Texinfo package contains programs used for reading, writing and converting Info documents, which provide system documentation.

Texinfo installs the following:


Program Files

info, infokey, install-info, makeinfo, texi2dvi and texindex



Descriptions

(Last checked against version 4.2.)


Program file descriptions

info

The info program reads Info documents, usually contained in the /usr/share/info directory. Info documents are like man(ual) pages, but they tend to go deeper than just explaining the options to a program.


infokey

infokey compiles a source file containing Info customizations into a binary format.


install-info

The install-info program updates the info entries. When the info program is run, a list with available topics (ie: available info documents) will be presented. The install-info program is used to maintain this list of available topics. If info files are removed manually, you must also delete the topic in the index file. This program is used for that. It also works the other way around when info documents are added.


makeinfo

The makeinfo program translates Texinfo source documents into various formats. Available formats are: info files, plain text and HTML.


texi2dvi

The texi2dvi program prints Texinfo documents.


texindex

The texindex program is used to sort Texinfo index files.



Texinfo Installation Dependencies

(Last checked against version 4.0.)

Bash: sh
Binutils: ar, as, ld, ranlib
Coreutils: basename, cat, chmod, echo, expr, hostname, install, ln, ls,
             mkdir, mv, rm, sleep, tr
Diffutils: cmp
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Texinfo: makeinfo


Util-linux

For installation instructions see the Section called Installing Util-linux-2.12 in Chapter 6.


Contents of Util-linux

(Last checked against version 2.11t.)

The Util-linux package contains a number of miscellaneous utility programs. Some of the more prominent utilities are used to mount, unmount, format, partition and manage disk drives, open tty ports and fetch kernel messages.

Util-linux installs the following:


Program Files

agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, fsck.cramfs, fsck.minix, getopt, hexdump, hwclock, ipcrm, ipcs, isosize, line, logger, look, losetup, mcookie, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap, more, mount, namei, parse.bash, parse.tcsh, pg, pivot_root, ramsize (link to rdev), raw, rdev, readprofile, rename, renice, rev, rootflags (link to rdev), script, setfdprm, setsid, setterm, sfdisk, swapoff (link to swapon), swapon, test.bash, test.tcsh, tunelp, ul, umount, vidmode (link to rdev), whereis and write



Descriptions

(Last checked against version 2.11t.)


Program file descriptions

agetty

agetty opens a tty port, prompts for a login name and invokes the /bin/login command.


arch

arch prints the machine architecture.


blockdev

blockdev allows to call block device ioctls from the command line.


cal

cal displays a simple calender.


cfdisk

cfdisk is a libncurses based disk partition table manipulator.


chkdupexe

chkdupexe finds duplicate executables.


col

col filters reverse line feeds from input.


colcrt

colcrt filters nroff output for CRT previewing.


colrm

colrm removes columns from a file.


column

column columnates lists.


ctrlaltdel

ctrlaltdel sets the function of the CTRL+ALT+DEL key combination (hard or soft reset).


cytune

cytune queries and modifies the interruption threshold for the Cyclades driver.


ddate

ddate converts Gregorian dates to Discordian dates.


dmesg

dmesg is used to examine or control the kernel ring buffer (boot messages from the kernel).


elvtune

elvtune lets you tune the I/O elevator per block device queue basis.


fdformat

fdformat low-level formats a floppy disk.


fdisk

fdisk is a disk partition table manipulator.


fsck.cramfs

No description is currently available.


fsck.minix

fsck.minix performs a consistency check for the Linux MINIX filesystem.


getopt

getopt parses command options the same way as the getopt C command.


hexdump

hexdump displays specified files, or standard input, in a user specified format (ascii, decimal, hexadecimal, octal).


hwclock

hwclock queries and sets the hardware clock (also called the RTC or BIOS clock).


ipcrm

ipcrm removes a specified resource.


ipcs

ipcs provides information on IPC facilities.


isosize

isosize outputs the length of an iso9660 file system.


line

line copies one line (up to a newline) from standard input and writes it to standard output.


logger

logger makes entries in the system log.


look

look displays lines beginning with a given string.


losetup

losetup sets up and controls loop devices.


mcookie

mcookie generates magic cookies for xauth.


mkfs

mkfs builds a Linux filesystem on a device, usually a harddisk partition.


mkfs.bfs

mkfs.bfs creates an SCO bfs file system on a device, usually a harddisk partition.


mkfs.cramfs

No description is currently available.


mkfs.minix

mkfs.minix creates a Linux MINIX filesystem on a device, usually a harddisk partition.


mkswap

mkswap sets up a Linux swap area on a device or in a file.


more

more is a filter for paging through text one screen full at a time.


mount

mount mounts, from many possible sources, filesystems or directories on a directory (mount point).


namei

namei follows a pathname until a terminal point is found.


parse.bash, parse.tcsh, test.bash, test.tcsh

These are example scripts for using the getopt program with either BASH or TCSH.


pg

No description is currently available.


pivot_root

pivot_root moves the root file system of the current process.


ramsize

ramsize queries and sets RAM disk size.


raw

raw is used to bind a Linux raw character device to a block device.


rdev

rdev queries and sets image root device, swap device, RAM disk size or video mode.


readprofile

readprofile reads kernel profiling information.


rename

rename renames files.


renice

renice alters priority of running processes.


rev

rev reverses lines of a file.


rootflags

rootflags queries and sets extra information used when mounting root.


script

script makes a typescript of terminal session.


setfdprm

setfdprm sets user-provided floppy disk parameters.


setsid

setsid runs programs in a new session.


setterm

setterm sets terminal attributes.


sfdisk

sfdisk is a disk partition table manipulator.


swapoff

swapoff disables devices and files for paging and swapping.


swapon

swapon enables devices and files for paging and swapping.


tunelp

tunelp sets various parameters for the LP device.


ul

ul reads a file and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use.


umount

umount unmounts a mounted filesystem or directory.


vidmode

vidmode queries and sets the video mode.


whereis

whereis locates a binary, source and manual page for a command.


write

write sends a message to another user, if that user has writing enabled (usually by using mesg).



Util-linux Installation Dependencies

(Last checked against version 2.11n.)

Bash: sh
Binutils: as, ld
Coreutils: cat, chgrp, chmod, cp, install, ln, mv, rm, uname, whoami
Diffutils: cmp
GCC: cc, cc1, collect2, cpp, cpp0
Gettext: msgfmt, xgettext
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed


Vim

For installation instructions see the Section called Installing Vim-6.2 in Chapter 6.


Contents of Vim

(Last checked against version 6.1.)

The Vim package contains a configurable text editor built to enable efficient text editing.

Vim installs the following:


Program Files

efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor and xxd



Descriptions

(Last checked against version 6.1.)


Program file descriptions

efm_filter.pl

efm_filter.pl is a filter which reads from stdin, copies to stdout and creates an error file that can be read by vim.


efm_perl.pl

efm_perl.pl reformats the error messages of the Perl interpreter for use with the quickfix mode of vim.


ex

ex starts vim in Ex mode.


less.sh

less.sh is a script which starts vim with less.vim.


mve.awk

mve.awk processes vim errors.


pltags.pl

pltags.pl creates a tags file for Perl code, for use by vim.


ref

ref checks the spelling of arguments.


rview

rview is a restricted version of view. No shell commands can be started and vim can't be suspended.


rvim

rvim is the restricted version of vim. No shell commands can be started and vim can't be suspended.


shtags.pl

shtags.pl generates a tag file for perl scripts.


tcltags

tcltags generates a tag file for Tcl code.


vi

vi starts vim in vi-compatible mode.


view

view starts vim in read-only mode.


vim

vim starts vim in the normal, default way.


vim132

vim132 starts vim with the terminal in 132 column mode.


vim2html.pl

vim2html.pl converts vim documentation to HTML.


vimdiff

vimdiff edits two or three versions of a file with vim and show differences.


vimm

vimm enables the DEC locator input model on a remote terminal.


vimspell.sh

vimspell.sh is a script which spells a file and generates the syntax statements necessary to highlight in vim.


vimtutor

vimtutor starts the Vim tutor.


xxd

xxd makes a hexdump or does the reverse.



Vim Installation Dependencies

(Last checked against version 6.0.)

Bash: sh
Binutils: as, ld, strip
Coreutils: cat, chmod, cp, echo, expr, ln, mkdir, mv, rm, touch, tr,
             uname, wc, whoami
Diffutils: cmp, diff
Find: find
GCC: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Net-tools: hostname
Sed: sed


Zlib

For installation instructions see the Section called Installing Zlib-1.1.4 in Chapter 6.



Contents of Zlib

(Last checked against version 1.1.4.)

The Zlib package contains the zlib library, which is used by many programs for its compression and uncompression functions.

Zlib installs the following:


Library Files

libz[a,so]



Descriptions

(Last checked against version 1.1.4.)


Program file descriptions

libz

This is the zlib library, which is used by many programs for its compression and uncompression functions.



Zlib Installation Dependencies

(No dependencies checked yet.)


Appendix B. Index of programs and library files

This is a list of all the programs and library files that are installed in this book, each with a link to the package in Appendix A to which it belongs.