Copyright © 1999-2003 by Gerard Beekmans
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.
This book is dedicated to my loving and supportive wife Beverly Beekmans.
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
There are many reasons why somebody would want to read this book. The principle reason being to install an LFS system. 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.
One important reason for LFS' existence is to help people learn how a Linux system works from the inside out. Building an LFS system helps demonstrate what makes Linux tick, and how things work together and depend on each other. And perhaps most importantly, how to customize it 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 boot script 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 end up with several programs which you are likely to never use. They're just sitting there wasting (precious) disk space. 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.
Another 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 build it yourself you have no guarantee that the new package was built correctly and actually fixes the problem (adequately). You never truly know whether a security hole is fixed or not unless you do it yourself.
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 build a complete and usable foundation 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/.
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:
Software-Building-HOWTO
This is a comprehensive guide to building and installing "generic" UNIX software distributions under Linux. This HOWTO is available at http://www.tldp.org/HOWTO/Software-Building-HOWTO.html.
The Linux Users' Guide
This guide covers the usage of assorted Linux software and is available at http://espc22.murdoch.edu.au/~stewart/guide/guide.html.
This book is divided into the following four parts:
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 describes how to prepare for the building process: making a partition, downloading the packages, and compiling temporary tools.
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 for the moment consists of just a single appendix: an alphabetical list of all the packages installed, for each package giving its official download location, its contents, and its installation dependencies.
(Much of this Appendix A 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 text based version of the book.)
We thank the following people and organizations for their contributions toward the Linux From Scratch project:
Mark Stone <mstone@linux.com> for donating the linuxfromscratch.org server.
VA Linux Systems for providing rack space and bandwidth for the linuxfromscratch.org server.
Fredrik Danerklint for running the se.linuxfromscratch.org mirror.
Tim Jackson <tim@idge.net> for running the linuxfromscratch.idge.net mirror.
Hagen Herrschaft <hrx@hrxnet.de> for running the de.linuxfromscratch.org mirrors, and for his donation of a P4-2.2GHz system to the LFS project.
UK Mirror Service for running the linuxfromscratch.mirror.ac.uk mirror.
Guido Passet <guido@primerelay.net> for running the www.nl.linuxfromscratch.org and ftp.snt.utwente.nl mirrors.
Timothy Bauscher <timothy@linuxfromscratch.org> for being more than a great help in editing this book.
Mark Hymers <markh@linuxfromscratch.org> for being more than a great help in editing this book.
Marc Heerdink <marc_heerdink@softhome.net> for also being a great help in editing this book.
DREAMWVR.COM for their ongoing sponsorship by donating various resources to the LFS and related sub projects.
Jan Niemann <jan.niemann@tu.bs.de> for running the www.de.linuxfromscratch.org mirror.
Torsten Westermann <westermann@linux-provider.net> for running the lfs.linux-provider.net mirror.
Ian Chilton <ian@ichilton.co.uk> for running the www.us.linuxfromscratch.org and www.linuxfromscratch.co.uk mirrors.
Dag Stenstad <dag@stenstad.net> for providing the www.no.linuxfromscratch.org mirror, and Ian Chilton <ian@ichilton.co.uk> for running it.
Antonin Sprinzl <Antonin.Sprinzl@tuwien.ac.at> for running the www.at.linuxfromscratch.org mirror.
Jason Andrade <jason@dstc.edu.au> for running the www.au.linuxfromscratch.org mirror.
Ian Cooper <ian@wpi.edu> for running the www.us2.linuxfromscratch.org mirror.
VA Linux Systems who, on behalf of Linux.com, donated a VA Linux 420 (former StartX SP2) workstation towards this project.
Johan Lenglet <johan@linuxfromscratch.org> for leading the French LFS translation project.
Jesse Tie-Ten-Quee <highos@linuxfromscratch.org> for donating a Yamaha CDRW 8824E cd writer.
O'Reilly for donating books on SQL and PHP.
Robert Briggs for donating the linuxfromscratch.org and linuxfromscratch.com domain names.
Frank Skettino <bkenoah@oswd.org> at OSWD for coming up with the initial design of the LFS website.
Garrett LeSage <garrett@linux.com> for creating the LFS banner.
Dean Benson <dean@vipersoft.co.uk> for helping out financially with setting up the LFS non-profit organization.
Countless other people on the various LFS mailing lists who are making this book happen by giving their suggestions, testing the book and submitting bug reports.
We are going to build the LFS system by using a previously installed Linux distribution such as Debian, SuSE, Slackware, Mandrake, RedHat, etc. We will use the existing Linux system as the development platform, because we need tools like a compiler, linker, text editor, and other development tools to build our system. Ordinarily, the required tools are available by default if we selected "development" as one of our installation options when we installed a Linux distribution.
After you have downloaded the packages that make up an LFS system, we will create a new Linux native partition and filesystem. Here is where the LFS system will be compiled and installed.
The next step, Chapter 5, will discuss the installation of a number of packages that will form the basic development suite which is used to build the actual system, or needed to resolve circular dependencies. For example, you need a compiler to build a new compiler, and you need a shell in order to install a new shell. The packages in this chapter will be linked statically.
Static linking describes a method of compiling software so that it does not require the presence of libraries when building is complete. The resulting program is able to function on its own. The program is able to do so because the pieces of the program that would normally remain in the libraries are copied from the libraries and built right into the program. Ordinarily, software is built with dynamic linking. This conserves storage space and increases the efficiency of many programs. We statically link our software in Chapter 5 because we will, in theory, be moving our development system to a virtual environment where the already mentioned libraries will be absent. If the software is built dynamically, our development suite will not function. Since the libraries we are talking about are provided by our distribution Linux, the goal of Chapter 5 is to build a development environment where those libraries are not required and is therefore independent of the distribution.
In Chapter 6 we will build and install our final system. We will use the chroot program to enter a virtual environment and start a new shell whose root directory will be set to the partition where we built all the Chapter 5 software. This is very similar to rebooting and instructing the kernel to mount our LFS partition as the root partition. The reason that we don't actually reboot, but instead chroot, is that creating a bootable static system requires additional work which simply isn't necessary. As well, we can continue to use our platform system while we are building LFS. While software is being compiled and installed you can simply switch to a different VC (Virtual Console) or X desktop and continue using your computer normally.
When all the software from Chapter 6 is installed, Chapters 7, 8 and 9 will help us finalize our installation. We will set up our boot scripts in Chapter 7. In Chapter 8 we will build our final Linux kernel and set up the Linux boot loader. Chapter 9 has some pointers to help you after you finish the book. Then finally, you reboot your system and boot into your new LFS system, and start to really use it.
This is the process in a nutshell. Detailed information on the steps we 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. It should become very clear shortly.
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 later.
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 HowTo's, download locations, websites, etc.
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.
This is LFS-BOOK version 4.1 dated April 28th, 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.
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.
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.
4.0 - October 5th, 2002
October 3rd, 2002 [gerard]: Chapter 06 - Linuxthreads: Instead of cd man use the -C option to make which makes a lot more sense (and it's shorter too).
September 29th, 2002 [gerard]: Chapter 05 - GCC: Fixed the old nofixincludes patch and reinstated it.
September 29th, 2002 [markh]: Chapter 05 - Bash: Correct reference to Debian to refer to the old stable release (potato) as it doesn't apply to the current one (woody). Reported by h2k1 on #lfs.
4.0-RC1 - September 28th, 2002
Upgraded to:
automake-1.6.3
bin86-0.16.3
binutils-2.13
bison-1.35
diffutils-2.8.1
file-3.39
gawk-3.1.1
gcc-3.2
gettext-0.11.5
groff-1.18
gzip-1.2.4b.patch
lfs-bootscripts-1.10
linux-2.4.19
MAKEDEV-1.7
man-1.5k
man-pages-1.52
modutils-2.4.19
ncurses-5.2-2.patch
perl-5.8.0
psmisc-21
texinfo-4.2
textutils-2.1
util-linux-2.11u
Added:
ed-0.2.patch
fileutils-4.1.patch
gawk-3.1.1-2.patch
gcc-3.2.patch
gcc-3.2-nofixincludes.patch
glibc-2.2.5-2.patch
gzip-1.2.4b.patch
kbd-1.06-3.patch
man-1.5k.patch
ncurses-5.2.patch
procps-2.0.7.patch
sh-utils-2.0-hostname.patch
vim-6.1.patch
zlib-1.1.4
Removed:
gzip-1.2.4a.patch
kbd-1.06-2.patch
reiserfsprogs-3.x.1b
September 28th, 2002 [gerard]: Chapter 05 - GCC: Added the nofixincludes patch to prevent that script from running in Chapter 05. It should run in Chapter 06, so we need it to be a separate patch.
September 28th, 2002 [gerard]: Chapter 06 - Man: Replaced the sed construction with a regular patch.
September 28th, 2002 [gerard]: Chapter 06 - Bzip2: Removed the PREFIX=/usr from the make install command because the PREFIX is already set to /usr by default.
September 28th, 2002 [gerard]: Chapter 06 - Vim: Removed the FHS compliance notes. They are bogus because Vim doesn't use the localstatedir at all.
September 28th, 2002 [timothy]: Applied Bill Maltby's grammatic-fixes patch. Changed "$LFS" to "LFS" when speaking of the LFS environment variable.
September 23rd, 2002 [timothy]: Applied Bill Maltby's grammatic-related patches.
September 23rd, 2002 [timothy]: Added - before tar options (for clarity).
September 22nd, 2002 [timothy]: Chapter 06: Applied Alex's grammatic-fixes patch.
September 21st, 2002 [timothy]: Chapter 02: Applied Bill Maltby's grammatic-fixes patch.
September 21st, 2002 [timothy]: Chapter 06 - Zlib: mv shared lib to /lib.
September 20th, 2002 [timothy]: Chapter 05 - GCC: Removed the --enable-threads=posix flag since we don't build a C++ compiler in this chapter.
September 18th, 2002 [timothy]: Chapter 05 - Introduction: Removed paragraph about static linking since it seems misleading and is covered in better detail in Why Static.
September 18th, 2002 [timothy]: Chapter 08 - Linux: Removed cd command.
September 18th, 2002 [timothy]: Chapter 06 - Ncurses: Removed old mv /lib/*.a /usr/lib command explanation.
September 13th, 2002 [gerard]: Chapter 06 - Shadow: Added --libdir=/usr/lib to the configure script options. This way a proper libshadow.la is generated. Also changed the mv command to move all the libshadow.so* files to the /lib directory. The lib*a files are already in the /usr/lib directory.
September 13th, 2002 [gerard]: Chapter 06 - Man: Added another regex to the sed command that modifies the man.conf file. The added regex comments out the MANPATH /usr/man line which causes for duplicate results when using the whatis command
September 13th, 2002 [gerard]: Chapter 06: Added the Linux Threads Man Pages installation after the Perl installation.
September 12th, 2002 [gerard]: Chapter 06 - Create mtab link: Made the ln command an ln -sf so the existing /etc/mtab file, created by the mount command, will be removed before re-creating it as a symlink.
September 12th, 2002 [gerard]: Chapter 06 - Sh-utils: Added the sh-utils-hostname patch that suppresses the build of the hostname program. This is done because the hostname program from the net-tools package is superior over this version.
September 12th, 2002 [gerard]: Chapter 06 - Gawk: Updated the Gawk patch. It also changes the DDEFPATH directory location now.
September 12th, 2002 [gerard]: Chapter 06 - Procps: Added patch that fixes a locale problem that makes top crash under certain locale settings.
September 12th, 2002 [timothy]: Chapter 04 - Creating a file system: Referenced alternative filesystems in BLFS.
September 12th, 2002 [gerard]: Removed all superfluous /usr/lib/*.so symbolic links from library installations.
September 12th, 2002 [gerard]: Upgraded to lfs-bootscripts-1.10
September 12th, 2002 [gerard]: Chapter 06 - Configure Sysvinit: Changed the sulogin line to once instead of having it respawn. This way it'll behave as expected (ie: a CTRL+D will continue instead of restart sulogin).
September 12th, 2002 [gerard]: Chapter 06 - GCC: Added the --enable-clocale=gnu option to ensure the proper locale mode is used by the C++ libraries.
September 11th, 2002 [timothy]: Preface: Grammatic changes.
September 8th, 2002 [timothy]: Chapter 06: Applied Alex's grammar changes patch.
September 7th, 2002 [timothy]: Chapter 06 - Gzip: Added gzip-1.2.4b.patch.
September 7th, 2002 [timothy]: Chapter 05 - Textutils: Added re_max_failures2 for old host systems.
September 2nd, 2002 [timothy]: Chapter 06 - Bash: Removed creation of sh symlink. Creating the bash and sh symlinks: Added /bin/bash symlink, symlinked sh to bash. Gzip, Sysvinit, Util-Linux: Shortened cp command. Makedev: Removed /bin/bash creation and removal. Man: Modified sed statement to edit less call, so SGR will work.
September 1st, 2002 [timothy]: Chapter 06 - About debugging symbols: Removed info. about stripping /static. Man: Added sed statement to prevent groff from using SGR escape sequences.
September 1st, 2002 [timothy]: Chapter 05 - Install all software as an unprivileged user: Added $CC='gcc -s' to omit the compilation of symbols in static packages.
August 30th, 2002 [timothy]: Chapter 06 - Makedev: Put rm /bin/bash after device creation. Perl: Removed information about the old patch.
August 30th, 2002 [timothy]: Chapter 05 - GCC: Re-added HAVE_GAS_HIDDEN; removed --enable-__cxa-atexit which was incorrect and not needed in this chapter; added information about the patch.
August 26th, 2002 [gerard]: Added a new Glibc patch and introduced a GCC patch.
August 26th, 2002 [gerard]: Updated to automake-1.6.3, gcc-3.2, groff-1.18, makedev-1.7, perl-5.8.0, util-linux-2.11u
August 22nd, 2002 [timothy]: Appendix: Added missing URLs to patches.
August 18th, 2002 [timothy]: Chapter 05 & 06: Changed ln -sf to ln -s wherever possible.
August 18th, 2002 [timothy]: Chapter 06 - Binutils: cp libiberty.h after install, as it is needed by certain software. Shadow: added command to remove the groups program installed by Shadow because Sh-utils installs a (better) groups program.
August 18th, 2002 [timothy]: Chapter 05 - Sh-utils: Re-added sh-utils-2.0.patch.
August 16th, 2002 [markh]: Chapter 06 - Move man-pages to just after the kernel headers installation.
August 15th, 2002 [markh]: Chapter 06 - Move the MAKEDEV installation to before glibc and remove the temporary creation of /dev/null as we don't need it anymore.
August 15th, 2002 [timothy]: Chapter 04 - Preparing a new partition: mentioned that a swap partition can be shared between the LFS and host systems, grammatic changes.
August 13th, 2002 [gerard]: Chapter 06: Removed the --with-curses switch from the Bash installation as it's unnecessary here.
August 9th, 2002 [timothy]: Updated to modutils-2.4.19, linux-2.4.19, gettext-0.11.5, binutils-2.13, textutils-2.1.
August 9th, 2002 [timothy]: Chapter 06 - Vim: changed alternative editors link from hints to BLFS.
August 8th, 2002 [gerard]: Chapter 06 - Ncurses: removed the --disable-termcap configure option. Termcap is disabled by default now, so no need for this option (left over from a long time ago when it was needed).
August 8th, 2002 [gerard]: Chapter 06 - Linux: Added the command cp include/asm-generic /usr/include. There are programs which use the files in there, as well as headers in the asm directory may be split up in the future, and put in the asm-generic.
August 8th, 2002 [gerard]: Appendix A - Gettext: added the missing program description of msgcat.
August 4th, 2002 [timothy]: Added zlib-1.1.4.
August 3rd, 2002 [timothy]: Updated to man-pages-1.52, man-1.5k, gettext-0.11.4, modutils-2.4.18.
July 29th, 2002 [timothy]: Removed Reiserfsprogs. Updated to util-linux-2.11t and file-3.39.
July 29th, 2002 [timothy]: Chapter 04 & 05 - Creating a new partition, Introduction, Why static: grammatic changes. Diffutils, Fileutils, Grep, Texinfo: set LDFLAGS=-static before configure instead of as an argument to make. GCC: appended HAVE_GAS_HIDDEN to auto-host.h.
July 29th, 2002 [timothy]: Chapter 06 - Glibc: added --disable-profile flag.
July 29th, 2002 [timothy]: Chapter 08 - Linux: added information about modules and kernel documentation.
July 29th, 2002 [timothy]: Chapter 09 - Rebooting the system: added a command to remove the static directory.
July 8th, 2002 [timothy]: Chapter 09 - Rebooting the system: Pointed to BLFS as the next step.
July 3rd, 2002 [timothy]: Chapter 06 - Sysvinit: Simplified the sed command and updated the installation description because init now prints "Sending processes" instead of "Sending all processes".
July 2nd, 2002 [markh]: Internal change - Made all patches use a &package-patch-version; entity and removed all hardcoding of patch versions.
June 30th, 2002 [timothy]: Updated to man-pages-1.51 and automake-1.6.2
June 24th, 2002 [timothy]: Chapter 06 - Shadow, Util-linux, LFS-Bootscripts: Updated package contents.
June 23rd, 2002 [timothy]: Chapter 05 & 06 - Net-tools, Perl, Texinfo, Autoconf, Automake, File, Libtool, Bin86, Vim, Linux, Bison, Less, Man-pages, Groff, Bzip2, E2fsprogs, Grep, Lilo, Modutils, Procps, Psmisc, Reiserfsprogs: Updated package contents.
June 23rd, 2002 [timothy] Chapter 05 & 06 - M4, Bzip2, File, E2fsprogs: Added "last checked against" for uniformity. GCC: Removed i686-specific programs.
June 16th, 2002 [timothy]: Chapter 06 - Gettext: Updated package contents.
June 14th, 2002 [timothy]: Chapter 05 & 06 - Binutils, Bzip2, Diffutils, Grep: Updated package contents. GCC: Updated description of c++filt.
June 13th, 2002 [timothy]: Chapter 09 - The End: Changed $LFS/etc/lfs-4.1 to $LFS/etc/lfs and put the version number inside this file.
June 12th, 2002 [timothy]: Chapter 05 - GCC: Modified the build instructions and command explanations to only build the C compiler. The C++ compiler is not needed until after the second GCC build.
June 12th, 2002 [timothy]: Chapter 06 - Shadow: grammatic changes.
June 11th, 2002 [timothy]: Chapter 05 & 06 - Gawk: Created a list of package contents and descriptions. Fileutils: Removed a confusing paragraph about the fileutils patch. GCC: Updated the package contents.
June 11th, 2002 [timothy] All software: Updated the estimated required disk space.
June 9th, 2002 [markh]: Chapter 06 - Creating Directories: Changed usr,usr/local to just usr/local as we use the -p option to mkdir which will create the usr directory anyways.
June 7th, 2002 [timothy] Chapter 06 - Reiserfsprogs: added a description for unpack.
June 7th, 2002 [timothy] Chapter 02 - How to ask for help: mentioned the FAQ.
June 6th, 2002 [markh] - Chapter 05 - Tidy up explanations following the /static change.
June 5th, 2002 [timothy]: Preface - Who would not want to read this book: applied a revised version of Scot's grammar patch.
June 5th, 2002 [timothy]: Chapter 09 - Rebooting the system, Lilo, Bootscripts: named the hint authors. Chapter 06 - Vim: updated the hint URL. Chapter 05 - Gawk: to avoid confusion, mentioned that the patch will be applied in Chapter 06.
June 3rd, 2002 [timothy] Chapter 01 - FAQ: edited to include reporting typos.
May 31st, 2002 [gerard] Chapter 05 - Findutils: Added the CPPFLAGS...re_max_failures fix which is needed on Glibc-2.1 systems.
May 30th, 2002 [markh]: Chapter 05 & 06 - Update to binutils-2.12.1.
May 30th, 2002 [markh]: Chapter 05 - Bash: Removed section about "last two commands executing anyways" because we no longer have the commands referred to there.
May 30th, 2002 [gerard]: Chapter 06 - Glibc: Replaced the various sed fixes with a regular patch.
May 30th, 2002 [gerard]: Chapter 06 - Gawk: Replaced the sed fix with a regular patch.
May 30th, 2002 [gerard]: Chapter 05 - Fileutils: Replaced the sed fix with a regular patch.
May 30th, 2002 [gerard]: Chapter 06 - Ed: Replaced the sed fix with a regular patch.
May 28th, 2002 [gerard]: Chapter 06 - Changing ownership: removed the explicit command to chown /lost+found. This is done by the first command now that proc isn't mounted anymore in chapter 5.
May 27th, 2002 [gerard]: Upgraded to ncurses-5.2-2.patch (this patch is smaller than the previously used one).
May 26th, 2002 [gerard]: Upgraded to: automake-1.6.1, bin86-0.16.3, file-3.38, gawk-3.1.1, gcc-3.1, gettext-0.11.2, modutils-2.4.16, psmisc-21 and util-linux-2.11r. Added gcc-3.1 compile fix patches for ncurses, perl and vim.
May 26th, 2002 [gerard]: Chapter 05+06 - Binutils: Removed the tooldir setting from chapter 05-binutils, moved its description to chapter 06-binutils.
May 26th, 2002 [gerard]: Chapter 05 - Gawk & Findutils: simplified the installation by removing the libexecdir modifications. We can live with a $LFS/static/libexecdir being created. The whole $LFS/static directory is temporarily anyways, so we're not all that concerned with what it looks like.
May 26th, 2002 [gerard]: Chapter 06 - Creating Directories: removed the cd / command and changed the two chmod commands to use absolute paths instead.
May 25th, 2002 [markh]: Chapter 06 - Some minor corrections dealing with removing the $LFS variable where it isn't wanted.
May 23rd, 2002 [gerard]: Implemented the keep_chap5_and_chap6_sep lfs-hint. Highlights of the change: added findutils and util-linux to chapter 5, installed everything from chapter 5 into $LFS/static and re-ordered the installation of packages in chapter 6 to prevent hard-wiring the wrong path (files from $LFS/static).
May 23rd, 2002 [gerard]: Appendix A - E2fsprogs: Added some more descriptions.
May 23rd, 2002 [gerard]: Appendix A - Bin86: Added some descriptions.
May 23rd, 2002 [gerard]: Appendix A - Flex: Added some descriptions.
May 23rd, 2002 [gerard]: Appendix A - Glibc: Added some more descriptions.
May 18th, 2002 [gerard]: Appendix A - E2fsprogs: Added some descriptions.
May 18th, 2002 [gerard]: Appendix A - Glibc: Added some more descriptions.
May 17th, 2002 [markh]: Changed all chown X.X's to chown X:X's which is less likely to run into problems (according to info chown).
May 16th, 2002 [gerard]: Chapter 01 - Mirror sites: Added http interface to FTP mirror at idge.net
May 16th, 2002 [gerard]: Appendix A - Glibc: Added some more descriptions.
May 15th, 2002 [markh]: Chapter 05 - Bzip2. Changed the instructions to deal with hard links in older distros a'la the Chapter 05 gzip instructions.
May 11th, 2002 [markh]: Various XML fixups; mainly altering <ulink> tags to remove erroneous in the HTML output.
May 9th, 2002 [gerard]: Appendix A - Glibc: Filled in the missing descriptions.
May 6th, 2002 [gerard]: Chapter 06 - Shadow: Fixed the symlink location of vigr to /usr/sbin
May 2nd, 2002 [gerard]: Chapter 06 - Procps: Changed the two single quotes to two double quotes (the two single quotes can be mistaken for one double quote which will cause an error).
May 2nd, 2002 [gerard]: Changed the cd dir && ln -sf commands to one single command (such as ln -sf bash $LFS/bin/sh Same goes for cd dir && mv/cp constructions which are now replaced with constructions like mv $LFS/usr/bin/{bzcat,bzip2} $LFS/bin
May 2nd, 2002 [markh]: Removed the "Removing old NSS library files" section.
May 1st, 2002 [gerard]: Removed all Glibc-2.0 workarounds - gzip patch, sh-utils patch, copying of libnss files. Also removed the export VAR=VALUE...unset VAR constructions and changed them to VAR=VALUE ./configure constructions.
April 26th, 2002 [marcheerdink]: Chapter 06 Findutils: added libexecdir=/usr/bin to the make command to fix a wrong libexecdir path in updatedb.
April 25th, 2002 [gerard]: Chapter 06 Glibc: added a note that if you want to manually install some locales, instead of all of them, then you first need to create the /usr/lib/locale directory.
April 21st,2002 [gerard & markh]: Upgraded to MAKEDEV-1.5
April 12th, 2002 [markh]: Added entities/ directory to cvs and split up index.xml.
April 10th, 2002 [marcheerdink]: Updated to the following packages: bison-1.35, diffutils-2.8.1, texinfo-4.2, util-linux-2.11q
April 9th, 2002 [marcheerdink]: Added --disable-perl-regexp to the grep configure flags to avoid linking against a non-existing static pcre library.
April 8th, 2002 [gerard]: Added the http://ftp.de.linuxfromscratch.org mirror (to complement ftp://ftp.de).
The linuxfromscratch.org server is hosting the following publicly accessible mailing lists:
lfs-support
lfs-dev
lfs-announce
lfs-book
lfs-chat
lfs-security
alfs-discuss
blfs-dev
blfs-book
blfs-support
The lfs-support list is the place to get help following the instructions in the LFS Book itself.
If you're finished with the LFS Book, use blfs-support instead.
The lfs-announce list is a moderated list for those who want notification of new stable releases without the higher traffic of lfs-dev.
The lfs-book list is used for coordinating the LFS book's maintenance. Traffic on it is mostly Bugzilla and CVS commit messages. It is important that all development discussion of interest to the book's users take place on lfs-dev, not here.
The lfs-chat list is the place for community chatter. It's a place where anything goes, nothing is off-topic. You can discuss the price of beer or what hardware to buy. Even GNU versus BSD and Microsoft versus Linux flame wars are okay in lfs-chat.
The lfs-security list discusses security issues. Vulnerability alerts, configuration questions, security related packages, and other things to do with secure systems are appropriate on this list.
The blfs-book list is used for coordinating the BLFS book's maintenance. Traffic on it is mostly Bugzilla and CVS commit messages. It is important that all development discussion of interest to the book's users take place on blfs-dev, not here.
The blfs-support list is for the BLFS Book and beyond. It includes requests for help following the BLFS Book, requests for help with packages not (yet) in either the LFS Book or the BLFS Book, and other requests and discussion concerning software that might be installed on an LFS system. It does not include topics such as the price of beer, what hardware to buy, or GNU versus BSD or Microsoft versus Linux flame wars. These belong on lfs-chat, and since blfs-support is high traffic, please follow this rule strictly.
All these lists are archived and can be viewed online at http://archive.linuxfromscratch.org/mail-archives or downloaded from http://ftp.linuxfromscratch.org/mail-archives or ftp://ftp.linuxfromscratch.org/mail-archives.
The post address for a list is in the format of listname@linuxfromscratch.org where listname is one of the above lists names. Example post addresses are lfs-support@linuxfromscratch.org and blfs-support@linuxfromscratch.org.
Any of the above-mentioned mailing lists can be subscribed to by sending an email to listar@linuxfromscratch.org and writing subscribe listname as the subject header of the message.
Multiple lists at the same time can be subscribed to by using one email. This is done by leaving the subject blank and putting all the commands in the body of the email. The email will look like:
To: listar@linuxfromscratch.org
Subject:
subscribe lfs-dev
subscribe blfs-support
subscribe alfs-discuss
After the email is sent, the Listar program will reply with an email requesting a confirmation of the subscription request. After this confirmation email is sent back, Listar will send an email again with the message that the user has been subscribed to the list(s) along with an introduction message for that particular list.
To unsubscribe from a list, send an email to listar@linuxfromscratch.org and write unsubscribe listname as the subject header of the message.
Multiple lists can be unsubscribed at the same time using one email. This is done by leaving the subject header blank and putting all the commands in the body of the email. The email will look like:
To: listar@linuxfromscratch.org
Subject:
unsubscribe lfs-dev
unsubscribe blfs-support
unsubscribe alfs-discuss
After the email is sent, the Listar program will reply with an email requesting a confirmation of the unsubscription request. After this confirmation email is sent back, Listar will send an email again with the message that the user has been unsubscribed from the list(s).
The modes that can be set by a user require sending an email to listar@linuxfromscratch.org. The modes themselves are set by writing the appropriate commands in the subject header of the message.
As the name implies, the Set command tells what to write to set a mode. The Unset command tells what to write to unset a mode.
The word "listname" in the example subject headers below should be replaced with the listname to which the mode is going to be applied. If more than one mode is to be set (to the same list or multiple lists) with one email, this can be done by leaving the subject header blank and writing all the commands in the body of the message instead.
Set command: set listname digest
Unset command: unset listname digest
All lists have the digest mode available which can be set after a user has subscribed to a list. Being in digest mode will cause you to stop receiving individual messages as they are posted to the list and instead receive one email a day containing all the messages posted to the list during that day.
There is a second digest mode called digest2. When a user is set to this mode he will receive the daily digests but will also continue to receive the individual messages to the lists as they are posted. To set this mode, substitute digest for digest2 in the command.
Set command: set listname vacation
Unset command: unset listname vacation
If a user is going to be away for a while or wishes to stop receiving messages from the lists but doesn't want to unsubscribe, he can change to vacation mode. This has the same effect as unsubscribing, but without having to go through the unsubscribe process and then later through the subscribe process again.
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.
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.
Please direct your emails to one of the LFS mailing lists. See Chapter 1 - Mailing lists and archives for more information on the available mailing lists.
If you need to reach Gerard Beekmans personally, send an email to gerard@linuxfromscratch.org
Please read the following 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 4. For example, let's assume that the LFS partition is mounted on /mnt/lfs.
When you are told to run a command like ./configure --prefix=$LFS/static you actually have to execute ./configure --prefix=/mnt/lfs/static.
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/static, then you may type it literally. Your shell will replace $LFS with /mnt/lfs when it processes the command line (meaning when you hit enter after having typed the command).
SBUs are Static Bash Units and they are our way of identifying how long a package takes to compile. Why don't we use normal times like anybody else?
The biggest problem is that times cannot be accurate, not even a little bit. So many people install LFS on so many different systems, the times it takes to compile something varies too much. One package may take 20 minutes on one system, but that same package may take 3 days on another (this is not an exaggeration). So instead we've come up with a Static Bash Unit or SBU.
It works like this: the very first package you compile in this book is Bash in Chapter 5 and it'll be statically linked. The time it takes to compile this package will be the basis and called the SBU. All other compile times are relative to the time it takes to install Bash. For example, GCC-3.2 takes about 9.5 SBUs and it's proven that this number is fairly consistent among a lot of different systems. So multiply 9.5 by the number of seconds it takes for Bash to install (the SBU value) and you get a close approximation of how long GCC will take on your system.
Note: We've seen that SBUs don't work well on SMP based machines. So all bets are off if you're lucky enough to have an SMP setup.
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 and archives. To assist us in diagnosing and solving your problem, include as much relevant information as possible in your request for help.
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 4.1),
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.)
When something goes wrong during the stage where the configure script is run, look at the last lines of the config.log. 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.
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 |
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://www.tuxedo.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.
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.
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://hints.linuxfromscratch.org/hints/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.
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://beyond.linuxfromscratch.org/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.
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.
Now that we've made ourselves a place to work in, we're ready to download the packages.
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. Feel free to try out newer versions, but if you experience problems with those versions, please try the recommended version first before sending bug reports.
All the URL's, 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, FAQ's, Changelogs and more.
For your convenience the top of the list contains a link to a file you can use with the wget program. Using this file and the wget program will make it easy to download all the files at once, rather than downloading each and every individual file manually.
Download the following packages:
Autoconf (2.57) - 792 KB:
http://freshmeat.net/projects/autoconf/
Automake (1.7.2) - 518 KB:
http://freshmeat.net/projects/automake/
Bash (2.05a) - 1,766 KB:
http://freshmeat.net/projects/gnubash/
Bin86 (0.16.3) - 142 KB:
http://freshmeat.net/projects/bin86/
Binutils (2.13.2) - 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/
Diffutils (2.8.1) - 762 KB:
http://freshmeat.net/projects/diffutils/
E2fsprogs (1.32) - 2,827 KB:
http://freshmeat.net/projects/e2fsprogs/
Ed (0.2) - 182 KB:
http://freshmeat.net/projects/ed/
Ed Patch (0.2) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/ed-0.2.patch
http://downloads.linuxfromscratch.org/ed-0.2.patch
File (3.39) - 177 KB:
http://freshmeat.net/projects/file/
Fileutils (4.1) - 1,770 KB:
http://freshmeat.net/projects/gnufileutils/
Fileutils Patch (4.1) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/fileutils-4.1.patch
http://downloads.linuxfromscratch.org/fileutils-4.1.patch
Findutils (4.1) - 288 KB:
http://freshmeat.net/projects/findutils/
Findutils Patch (4.1) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/findutils-4.1.patch
http://downloads.linuxfromscratch.org/findutils-4.1.patch
Findutils Segfault Patch (4.1) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/findutils-4.1-segfault.patch
http://downloads.linuxfromscratch.org/findutils-4.1-segfault.patch
Flex (2.5.4a) - 372 KB:
http://freshmeat.net/projects/flex/
Gawk (3.1.1) - 1,831 KB:
http://freshmeat.net/projects/gnuawk/
Gawk Patch (3.1.1-3) - 1 KB:
http://downloads.linuxfromscratch.org/gawk-3.1.1-3.patch
GCC-core (3.2.1) - 13,140 KB:
http://freshmeat.net/projects/gcc/
GCC-g++ (3.2.1) - 2520 KB:
http://freshmeat.net/projects/gcc/
Gettext (0.11.5) - 3,637 KB:
http://freshmeat.net/projects/gettext/
Glibc (2.3.1) - 17,463 KB:
http://freshmeat.net/projects/glibc/
Glibc Root/Perl Patch: (2.3.1) - 1 KB:
http://downloads.linuxfromscratch.org/glibc-2.3.1-root-perl.patch
Glibc Libnss Patch: (2.3.1) - 1 KB:
http://downloads.linuxfromscratch.org/glibc-2.3.1-libnss.patch
Glibc-linuxthreads (2.3.1) - 238 KB:
http://freshmeat.net/projects/glibc/
Grep (2.5) - 545 KB:
http://freshmeat.net/projects/grep/
Groff (1.18.1) - 2,198 KB:
http://freshmeat.net/projects/groff/
Gzip (1.2.4a) - 216 KB:
http://freshmeat.net/projects/gzip/
Gzip Patch (1.2.4b) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/gzip-1.2.4b.patch
http://downloads.linuxfromscratch.org/gzip-1.2.4b.patch
Kbd (1.08) - 801 KB:
http://freshmeat.net/projects/kbd/
Kbd Patch (1.08) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/kbd-1.08.patch
http://downloads.linuxfromscratch.org/kbd-1.08.patch
Less (378) - 239 KB:
http://freshmeat.net/projects/less/
LFS-Bootscripts (1.11) - 25 KB:
http://downloads.linuxfromscratch.org/lfs-bootscripts-1.11.tar.bz2
Libtool (1.4.3) - 1137 KB:
http://freshmeat.net/projects/libtool/
Lilo (22.2) - 343 KB:
http://freshmeat.net/projects/lilo/
Linux (2.4.20) - 26,778 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:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/MAKEDEV-1.7.bz2
http://downloads.linuxfromscratch.org/MAKEDEV-1.7.bz2
Man (1.5k) - 189 KB:
http://freshmeat.net/projects/man/
Man 80Cols Patch (1.5k) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5k-80cols.patch
Man Manpath Patch (1.5k) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5k-manpath.patch
Man Pager Patch (1.5k) - 1 KB:
http://downloads.linuxfromscratch.org/man-1.5k-pager.patch
Man-pages (1.54) - 583 KB:
http://freshmeat.net/projects/man-pages/
Modutils (2.4.22) - 214 KB:
http://freshmeat.net/projects/modutils/
Ncurses (5.3) - 2,019 KB:
http://freshmeat.net/projects/ncurses/
Netkit-base (0.17) - 55 KB:
http://freshmeat.net/projects/netkit/
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.5) - 233 KB:
http://freshmeat.net/projects/procps/
Procps Patch (3.1.5) - 1 KB:
http://downloads.linuxfromscratch.org/procps-3.1.5.patch
Psmisc (21.2) - 253 KB:
http://freshmeat.net/projects/psmisc/
Sed (4.0.5) - 665 KB:
http://freshmeat.net/projects/sed/
Shadow (4.0.3) - 1030 KB:
http://freshmeat.net/projects/shadow/
Sh-utils (2.0) - 1214 KB:
http://freshmeat.net/projects/sh-utils/
Sh-utils Hostname Patch (2.0-hostname) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/sh-utils-2.0-hostname.patch
http://downloads.linuxfromscratch.org/sh-utils-2.0-hostname.patch
Sh-utils Patch (2.0) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/sh-utils-2.0.patch
http://downloads.linuxfromscratch.org/sh-utils-2.0.patch
Sysklogd (1.4.1) - 80 KB:
http://freshmeat.net/projects/sysklogd/
Sysvinit (2.84) - 89 KB:
http://freshmeat.net/projects/sysvinit/
Tar (1.13) - 1028 KB:
http://freshmeat.net/projects/tar/
Tar Patch (1.13) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/tar-1.13.patch
http://downloads.linuxfromscratch.org/tar-1.13.patch
Texinfo (4.3) - 1,254 KB:
http://freshmeat.net/projects/texinfo/
Textutils (2.1) - 1,847 KB:
http://freshmeat.net/projects/textutils/
Util-linux (2.11y) - 1,777 KB:
http://freshmeat.net/projects/util-linux/
Vim (6.1) - 2,822 KB:
http://freshmeat.net/projects/vim/
Vim Patch (6.1) - 1 KB:
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/vim-6.1.patch
http://downloads.linuxfromscratch.org/vim-6.1.patch
Zlib (1.1.4) - 144 KB:
http://freshmeat.net/projects/zlib/
Total size of all packages: 99,270 KB (96.96 MB)
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 files compiled in this chapter will be installed under the $LFS/static 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 exactly what each package is used for, and why the user or the system needs it. For this purpose a short description of the content of each package is given right after the installation instructions.
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.
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 all programs in this chapter statically? The reason is that we won't be compiling a temporary glibc here. And we avoid doing this simply to save some time -- around 14 SBUs. Another reason is that the Glibc version on the LFS system might not be compatible with the Glibc on the host system. Applications compiled against your host system's Glibc version may not run properly (or at all) on the LFS system.
This means that the tools compiled in this chapter will have to be self-contained, because when later on we chroot to the LFS partition the GNU library won't be available. That is why we use the -static, --enable-static-link, and --disable-shared flags throughout this chapter, to ensure that all executables are statically linked. When we come to the next chapter, almost the first thing we do is build glibc, the main set of system libraries. Once this is done, we can link all other programs dynamically (including the ones installed statically in this chapter) and take advantage of the space saving opportunities.
All programs compiled in this chapter will be installed under $LFS/static 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. Create the required directory by running the following:
mkdir $LFS/static |
If you are logged in as root during Chapter 5, your host system can be damaged by a single mistake. We recommend that you build the packages in Chapter 5 as an unprivileged user. You could use your own user name, but to ensure a clean build environment, we'll create a new user: lfs. As root, issue the following commands to add the new user:
useradd -s /bin/bash -m lfs passwd lfs |
In order to grant ownership of the $LFS/static directory to the user lfs, issue the command:
chown lfs $LFS/static |
Next, login as user lfs. This can be accomplished via a virtual console, display manager or with the substitute user command:
su - lfs |
The "-" instructs su to start a new, clean shell.
While logged in as user lfs, issue the following commands to set up a good work environment:
cat > ~/.bash_profile << "EOF" umask 022 LFS=/mnt/lfs LC_ALL=POSIX CC="gcc -s" export LFS LC_ALL CC EOF source ~/.bash_profile |
This profile sets the umask to 022, so newly created files and directories will have the correct permissions. To be more specific, only the file owner will have write permission to new files and directories. Other users of the system will be have read permission, and executable permission to directories. It is advisable to keep this setting throughout your LFS installation.
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 "C" or "POSIX" during this chapter may cause trouble if you exit the chroot environment and wish to return later. By setting LC_ALL to "POSIX" ("C" is an alias for "POSIX") we ensure that everything will work as expected in the chroot environment.
CC is a variable we set in order to prevent debugging symbols from being compiled into our static packages. By omitting these symbols during the linking stage of compilation, we save hard drive space and decrease our build time.
We are now prepared to begin building the temporary tools which will support us in later chapters.
Estimated build time: 1 SBU Estimated required disk space: 24 MB |
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:
Last checked against version 2.05a.
Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr, uniq
Before you attempt to install Bash, you have to check to make sure your distribution has the /usr/lib/libcurses.a and /usr/lib/libncurses.a files. If your host distribution is an LFS system, all files will be present if you followed the instructions of the book version you read exactly.
If both of the files are missing, you have to install the Ncurses development package. This package is often called something like ncurses-dev or ncurses-static. If this package is already installed, or you just installed it, check for the two files again. Often the libcurses.a file is (still) missing. If so, create libcurses.a as a symlink by running the following command as user root:
ln -s libncurses.a /usr/lib/libcurses.a |
Now we can really start. Prepare Bash to be compiled by running the following command:
./configure --enable-static-link \ --prefix=$LFS/static --with-curses |
The meaning of the configure options are:
--enable-static-link: This option causes the bash program to be statically linked.
--prefix=$LFS/static: This option installs all of Bash's files under the $LFS/static directory, which becomes the /static directory when chroot'ed or reboot'ed into LFS.
--with-curses: This option causes bash to be linked against the curses library instead of the default termcap library which has become obsolete. Note, on most all Linux systems, the curses library is provided by the Ncurses package (so in truth we link against the ncurses library).
It is not strictly necessary for the static bash to be linked against libncurses (it can link against a static termcap for the time being just fine because we will reinstall Bash in Chapter 6 anyway, where we will use libncurses), but it's a good test to make sure that the Ncurses package has been installed properly. If not, you will get in trouble later on in this chapter when you install the Texinfo package. That package requires ncurses, and termcap can't be used there.
Now we can continue with compiling Bash:
make |
And finish off the installation by installing Bash:
make install |
If the make install phase ends with something along the lines of the following:
install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir' usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn] [--section regexp title] [--infodir=xxx] [--align=nnn] [--calign=nnn] [--quiet] [--menuentry=xxx] [--info-dir=xxx] [--keep-old] [--description=xxx] [--test] [--remove] [--] filename make[1]: *** [install] Error 1 make[1]: Leaving directory `/mnt/lfs/usr/src/bash-2.05a/doc' make: [install] Error 2 (ignored)
then that means that you are probably using Debian-2.2 (potato), and that you have an old version of the texinfo package and the info pages can't be installed at this time. This error is not a problem as the info pages will be installed when we recompile bash dynamically in Chapter 6, so you can ignore it. It is reported that the current release of Debian (3.0; also known as Woody) doesn't have this problem.
Estimated build time: 2.05 SBU Estimated required disk space: 160 MB |
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:
addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip
Last checked against version 2.11.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, rmdir, touch
Flex: flex
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, true, uname
Texinfo: install-info, makeinfo
Textutils: cat, sort, tr, uniq
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.13.2/configure --prefix=$LFS/static --disable-nls |
The meaning of the (new) configure switches are:
--disable-nls: This option disables internationalization (also known as i18n). We don't need this for our static programs and nls often causes problems when you're linking statically.
Continue with compiling the package:
make LDFLAGS="-all-static" |
The meaning of the make option is:
LDFLAGS="-all-static": This is how we tell Binutils that all programs should be statically linked. Setting the LDFLAGS variable is the common way of specifying we want a static link to take place, however, its value and the way it is set is not always the same. You'll see with the remaining packages that there are different ways of setting up the LDFLAGS variable.
And finish off installing the package:
make install |
Estimated build time: 0.07 SBU Estimated required disk space: 6 MB |
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:
bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore
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
Last checked against version 1.0.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Fileutils: cp, ln, rm
Gcc: cc1, collect2, cpp0, gcc
Make: make
Since the Bzip2 package has no configure script we can't prepare it for compilation. Instead we just run the make program and start compiling, with a few variables changed to suit our environment:
make CC="gcc -static -s" |
The meaning of the make option is:
CC="gcc -static -s": The Bzip2 package does not honour the LDFLAGS variable, so instead we set the CC variable which defines which compiler to use. The -static option tells the compiler to link all programs statically.
And finish off installing the package:
make PREFIX=$LFS/static install |
The meaning of the make option is:
PREFIX=$LFS/static: Instead of passing a --prefix=$LFS/static to a configure script, we set the PREFIX variable to accomplish the same goal (since there is no configure script present).
Estimated build time: 0.39 SBU Estimated required disk space: 10 MB |
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:
Last checked against version 2.7.
Bash: sh
Binutils: ld, as
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: date, hostname
Textutils: cat, tr
Prepare Diffutils to be compiled:
LDFLAGS="-static" CPPFLAGS=-Dre_max_failures=re_max_failures2 \ ./configure --prefix=$LFS/static --disable-nls |
The meaning of the configure options are:
LDFLAGS="-static": This is the most common way to tell a package that all programs should be statically linked. This way the LDFLAGS environment variable is set, but only in the subshell that the configure script runs in. When configure has done its job, the LDFLAGS environment variable won't exist anymore and the Makefile files contain will contain this variable locally.
CPPFLAGS=-Dre_max_failures=re_max_failures2: The CPPFLAGS variable is a variable that's read by the cpp program (C PreProcessor). The value of this variable tells the preprocessor to replace every instance of re_max_failures it finds with re_max_failures2 before handing the source file to the compiler itself for compilation. This package has problems linking statically on systems that run an older Glibc version and this construction fixes that problem.
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.94 SBU Estimated required disk space: 40 MB |
Last checked against version 4.1.
Fileutils is a package containing basic file manipulation programs. Included are programs to list and create directories, update timestamps, change permissions and so forth.
Fileutils installs the following files:
chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr
There is a documented bug with the atexit() function in glibc-2.2.3 when it is compiled with gcc-2.95.3. This bug only occurs on some systems (primarily AMD, but not exclusively). This bug causes segmentation faults in fileutils-4.1 when it is compiled statically. This patch causes on_exit() to be called instead of atexit().
Note that in some cases using this patch will result in not being able to compile this package at all, even when your system has an AMD CPU and has Glibc-2.2.3 (or higher) installed. If that's the case, you'll need to remove the fileutils-4.1 directory and unpack it again from the tarball before continuing. We believe this may be the case when your distribution has altered Glibc-2.2.3 somehow, but the exact details are unknown.
To fix this package to compile properly on AMD/Glibc-2.2.3 machines, run the following command. Do NOT attempt this fix if you don't have Glibc-2.2.3 installed. It will more than likely result in all kinds of compilation problems.
patch -Np1 -i ../fileutils-4.1.patch |
Prepare the package to be compiled:
LDFLAGS="-static" \ ./configure --disable-nls --prefix=$LFS/static |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Once you have installed Fileutils, you can test whether the segmentation fault problem has been avoided by running $LFS/static/bin/ls. If this works, then you are OK. If not, then you need to re-do the installation with the patch if you didn't use it, or without the patch if you did use it.
Estimated build time: 0.12 SBU Estimated required disk space: 8 MB |
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:
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Grep: egrep, grep
Gcc: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed
Sh-utils: basename, date, echo, hostname
Textutils: cat, tr
The Findutils package is quite old and it has problems compiling against newer Glibc versions (Glibc-2.0.x and up). You need to apply the patch, which fixes the following issues:
Findutils declares a function called basename, but this function name is already used by the C standard libraries. This patch changes the Findutils version of basename function so that it is called basename2 instead.
Findutils uses library files in an incorrect way. It declares library functions, to tell the compiler what the name of the function will be when the libraries are linked in. This syntax is invalid and causes compiler warnings/errors. This patch removes this improper syntax.
Every GNU package is supposed use a macro called _GNU_SOURCE. This macro enables declarations of GNU library extension functions so the compiler will be able to detect name conflicts between functions more easily. This patch adds this macro to the source code.
patch -Np1 -i ../findutils-4.1.patch |
Prepare Findutils to be compiled:
CPPFLAGS="-Dre_max_failures=re_max_failures2" \ LDFLAGS="-static" ./configure --prefix=$LFS/static |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.39 SBU Estimated required disk space: 17 MB |
Last checked against version 3.1.1.
Gawk is an awk implementation that is used to manipulate text files.
Gawk installs the following:
Prepare Gawk to be compiled:
CPPFLAGS=-Dre_max_failures=re_max_failures2 \ LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 9.48 SBU Estimated required disk space: 326 MB |
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:
c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0
Last checked against version 2.95.3.
Bash: sh
Binutils: ar, as, ld, nm, ranlib
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, touch
Find: find
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: basename, dirname, echo, expr, hostname, sleep, true, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tail, tr
We won't be needing a C++ compiler until Chapter 6. So, only the gcc-core tarball needs to be unpacked at this time.
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.2.1/configure --prefix=/static \ --disable-nls --disable-shared \ --with-as=$LFS/static/bin/as \ --with-ld=$LFS/static/bin/ld |
The meaning of the configure options are:
--prefix=/static: This is NOT a typo. GCC hard codes some paths while compiling and so we need to pass /static as the prefix during the configure stage. We will pass the real installation prefix ($LFS/static) during the installation stage later on.
--disable-shared: This prevents the build of dynamic libraries. They are useless to us at the moment. We'll create them when we reinstall GCC in chapter 6.
--with-as=$LFS/static/bin/as and --with-ld=$LFS/static/bin/ld: GCC can be miscompiled if your host distribution's Binutils package is quite old. We need a good working static GCC until we reinstall GCC later in chapter 6. So by using as and ld from the Binutils package we compiled earlier in this chapter we ensure that GCC will work correctly.
Continue with compiling the package:
make BOOT_LDFLAGS="-static" bootstrap |
The meaning of the make options are:
BOOT_LDFLAGS="-static": This is GCC's equivalent to make LDFLAGS="-static" as we use with other packages to compile them statically.
bootstrap: The bootstrap target doesn't just compile GCC, but it compiles GCC a second time. It uses the first compiled programs to compile itself a second and third time to make sure the compiler was compiled properly and can compile itself properly.
And finish off installing the package:
make prefix=$LFS/static install-no-fixedincludes |
The meaning of the make option is:
install-no-fixedincludes: This prevents the fixincludes script from running. Preventing this is necessary because under normal circumstances the GCC installation will run the fixincludes script which scans your system for header files that need to be fixed. It might find that the Glibc header files of your host system need to be fixed. If so, it will fix them and put them in $LFS/static/lib/gcc-lib/i686-pc-linux-gnu/3.2. Later on in chapter 6 you will install Glibc which will put its header files in /usr/include. Next you will install other programs that use the Glibc headers and GCC will look in /static/lib/gcc-lib before looking in /usr/include, with the result of finding and using the fixed Glibc header files from your host distribution, which are probably incompatible with the Glibc version actually used on the LFS system.
As the finishing touch we'll create the $LFS/static/bin/cc symlink. A lot of programs and scripts try to run cc instead of gcc This is to keep programs generic and usable on all kinds of Unix systems. Not everybody has GNU CC installed. Just running cc (C Compiler) leaves the user free to decide which C compiler to install. The symlink will point to the system's default compiler.
ln -s gcc $LFS/static/bin/cc |
Estimated build time: 0.26 SBU Estimated required disk space: 5 MB |
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:
Last checked against version 2.4.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Grep to be compiled:
LDFLAGS="-static" CPPFLAGS=-Dre_max_failures=re_max_failures2 \ ./configure --prefix=$LFS/static --disable-nls \ --disable-perl-regexp |
The meaning of the configure option is:
--disable-perl-regexp: This configure option makes sure grep is not linked against the PCRE library, which is often only available as a shared library in distributions. Not using this option might result in a compilation error.
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.04 SBU Estimated required disk space: 2 MB |
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:
gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew
Last checked against version 1.2.4a.
Bash: sh
Binutils: as, ld, nm
Fileutils: chmod, cp, install, ln, mv, rm
Gcc: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr
Prepare Gzip to be compiled:
./configure --prefix=$LFS/static |
Continue with compiling the package:
make LDFLAGS="-static" |
And finish off installing the package:
make install |
Estimated build time: 0.26 SBU Estimated required disk space: 8 MB |
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:
Last checked against version 3.79.1.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, install, ls, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Make to be compiled:
LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
During the make install phase you will see this warning:
chgrp: changing group of `/mnt/lfs/static/bin/make': Operation not permitted /mnt/lfs/static/bin/make needs to be owned by group kmem and setgid; otherwise the `-l' option will probably not work. You may need special privileges to complete the installation of /mnt/lfs/static/bin/make.
You can safely ignore this warning. The make program doesn't actually need to be owned by group kmem and setgid for the -l option to work. (This option tells make not to start any new jobs when a certain load on the system has been reached.)
Estimated build time: 0.10 SBU Estimated required disk space: 3 MB |
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:
Last checked against version 2.5.4.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, expr, hostname, uname
Textutils: cat, tr
Prepare Patch to be compiled:
CPPFLAGS=-D_GNU_SOURCE \ LDFLAGS="-static" ./configure --prefix=$LFS/static |
The meaning of the configure option is:
CPPFLAGS=-D_GNU_SOURCE: This flag fixes installation problems of this package on PPC and m68k platforms (that we know of). It doesn't hurt compilation on other platforms, such as x86, so we do it by default.
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.09 SBU Estimated required disk space: 2 MB |
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:
Last checked against version 3.02.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Sed to be compiled:
CPPFLAGS=-Dre_max_failures=re_max_failures2 \ LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls |
Continue with installing the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.47 SBU Estimated required disk space: 42 MB |
Last checked against version 2.0.
The Sh-utils package contains a number of basic shell manipulation utilities.
Sh-utils installs the following:
basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, chown, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
Before Sh-utils is installed, the sh-utils patch file may need to be applied. This patch is needed to avoid a conflict of variable names with certain Glibc versions (usually glibc-2.1.x) when compiling sh-utils statically. It is however safe to apply the patch even if you are running a different glibc version. So, if you aren't sure, it's best to apply it.
patch -Np1 -i ../sh-utils-2.0.patch |
Prepare Sh-utils to be compiled:
LDFLAGS="-static" ./configure --prefix=$LFS/static \ --disable-nls |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
During the make install stage you will see the following warning:
WARNING: insufficient access; not installing su NOTE: to install su, run 'make install-root' as root
You can safely ignore that warning. You need to be logged in as root in order to install su the way Sh-utils wants to install it, which is suid root. Because we don't need su during Chapter 6, and su will be properly installed when we re-install Sh-utils in Chapter 6.
Estimated build time: 0.25 SBU Estimated required disk space: 10 MB |
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:
Last checked against version 1.13.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Patch: patch
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
A patch may be applied to give tar direct support for bzip2 files. This patch adds the -j option to tar, which is similar to the -z option used for gzip files.
Apply the patch by running the following command:
patch -Np1 -i ../tar-1.13.patch |
Prepare Tar to be compiled:
LDFLAGS="-static" ./configure --prefix=$LFS/static --disable-nls |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.47 SBU Estimated required disk space: 19 MB |
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:
Last checked against version 4.0.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep
Texinfo: makeinfo
Textutils: cat, tr
Prepare Texinfo to be compiled:
LDFLAGS="-static" ./configure --prefix=$LFS/static \ --disable-nls |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.95 SBU Estimated required disk space: 49 MB |
Last checked against version 2.0.
The Textutils package contains several file manipulation and text processing programs.
Textutils installs the following:
cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Textutils to be compiled:
CPPFLAGS=-Dre_max_failures=re_max_failures2 \ LDFLAGS="-static" ./configure --prefix=$LFS/static \ --disable-nls |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.09 SBU Estimated required disk space: 9 MB |
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:
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
Last checked against version 2.11n.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, cp, install, ln, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp, cpp0
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed
Sh-utils: uname, whoami
Textutils: cat
Prepare Util-linux to be compiled:
LDFLAGS="-static" ./configure |
Begin compiling the package:
make -C lib |
We only need the mount and umount programs at the moment, so we won't be compiling the entire package. Compile these two programs by issuing the following command:
make -C mount mount umount |
Finish installing these two programs:
cp mount/{mount,umount} $LFS/static/bin |
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://hints.linuxfromscratch.org/hints/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 /static 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 /static, which will cause the program to stop working when the static directory is removed.
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/static/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://hints.linuxfromscratch.org/hints/optimization.txt.
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 /static/bin/env -i \ HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/static/bin \ /static/bin/bash --login |
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.
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 Glibc package hasn't been installed yet.
Right now the /static directory is owned by the lfs user. However, this user account exists only on the host system. Although you may delete the /static directory once you have finished your LFS system, you might want to keep it around, e.g. for building more LFS systems. But if you keep the /static directory you will end up with files owned by a user id without a corresponding account. This is dangerous because a user account created later could get this user id and would suddenly own the /static directory and all of the files therein. This could open the /static directory to manipulation by an untrusted user.
To avoid this issue, you can add the lfs user to the new LFS system later when creating the /etc/passwd file, taking care to assign it the same user and group id. Alternatively, you can (and the book will assume you do) run the following command now, to assign the contents of the /static directory to user root by running the following command:
chown -R 0:0 /static |
The command uses "0:0" instead of "root:root", because chown is unable to resolve the name "root" until glibc has been installed.
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,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 /usr/lib/locale && 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}} && ln -s ../var/tmp /usr |
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.
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.
In order for certain programs to function properly, the proc file system 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 proc file system is already mounted on your host system -- especially so because proc is a virtual file system.
The proc file system is mounted under /proc by running the following command:
mount proc /proc -t proc |
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).
The next thing to do is to create the /etc/mtab file. This is done using the following command:
touch /etc/mtab |
As of LFS-Bootscripts 1.11 this file is handled correctly so there are no errors even when booting after a crash.
Some programs hard-wire paths to programs which don't exist yet. In order to satisfy these programs, we create the symbolic links /bin/bash and /bin/sh, both pointing to the static bash program.
Create the /bin/bash and /bin/sh symlinks by running the following commands:
ln -s /static/bin/bash /bin/bash && ln -s bash /bin/sh |
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.
Create the /etc/passwd file by running the following command:
echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd |
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: 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.
Estimated build time: 0.07 SBU Estimated required disk space: 50 KB |
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:
Last checked against version 1.5.
Bash: sh
Fileutils: chmod, chown, cp, ln, mknod, mv, rm
Grep: grep
Sh-utils: expr, id
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:
cp MAKEDEV-1.7 /dev/MAKEDEV |
Prepare the script for execution:
cd /dev && chmod 754 MAKEDEV |
Run the script to create the device files:
./MAKEDEV -v generic |
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.
If you intend to use devpts, pass the generic-nopty option to MAKEDEV. This creates the same devices as generic, but it skips the creation of pty devices so that devpts can manage those.
Estimated build time: 0.02 SBU Estimated required disk space: 142 MB |
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:
Last checked against version 2.4.17.
Bash: sh
Binutils: ar, as, ld, nm, objcopy
Fileutils: cp, ln, mkdir, mv, rm, touch
Findutils: find, xargs
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Gawk: awk
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed
Sh-utils: basename, date, expr, pwd, stty, uname, whoami, yes
Textutils: cat, md5sum, sort, tail
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.20 directory to ensure all files are owned by user root.
Kernel header installation requires the pwd program. In the kernel source the path to the pwd program is hard-wired as /bin/pwd. Create a symlink to account for that:
ln -s /static/bin/pwd /bin/pwd |
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 |
Since the /bin/pwd symlink we created earlier was only temporary, it can now be removed:
rm /bin/pwd |
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.
Estimated build time: 0.01 SBU Estimated required disk space: 6 MB |
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:
Last checked against version 1.47.
Bash: sh
Fileutils: install
Make: make
Estimated build time: 14.71 SBU Estimated required disk space: 369 MB |
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:
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
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]
Last checked against version 2.2.5.
Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mknod, mv, mkdir, rm, touch
Gcc: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: gawk
Sed: sed
Sh-utils: date, expr, hostname, pwd, uname
Texinfo: install-info, makeinfo
Textutils: cat, cut, sort, tr
Before starting to install Glibc, you must cd into the glibc-2.3.1 directory and unpack Glibc-linuxthreads in that directory, not in /usr/src as you would normally do.
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 your system at a very high risk.
We'll start by applying a patch that does the following:
It converts all occurrences of $(PERL) to /usr/bin/perl in the malloc/Makefile file. This is done because Glibc can't autodetect the location of perl because the Perl package hasn't been installed yet. And if Glibc thinks Perl isn't installed, the perl program mtrace won't be installed either.
It replaces all occurrences of root with 0 in the login/Makefile file. This is done because Glibc itself isn't installed yet and therefore username-to-userid resolving isn't working yet, so a chown root file would fail. Using numeric IDs (as in chown 0 file) works fine.
patch -Np1 -i ../glibc-2.3.1-root-perl.patch |
There is a potential problem that causes statically linked binaries to crash that were linked against Glibc-2.2 or older libraries. Even though static binaries have all the necessary parts of Glibc built-in, they still rely on one external library set: Glibc's NSS libraries. These libraries, among other things, tell programs where the system's password database is (in /etc/password, NIS, or whatever other scheme has been configured).
Glibc has undergone some changes since version 2.2.x and the new NSS code is incompatible with the old one. So when Glibc is installed it will install its new NSS libraries, and static programs will load these new NSS libraries and will abort with a segmentation fault error. This patch undoes some of the changes to overcome the problem.
If you started chapter 5 with a host system that uses Glibc-2.2.x or older, you must apply the following patch. We will install Glibc again at the end of this chapter to remove this patch so you'll have a pristine Glibc as the developers intended it.
patch -Np1 -i ../glibc-2.3.1-libnss.patch |
Glibc will check for the /etc/ld.so.conf file and abort with an error if the file is missing, so we must create it:
touch /etc/ld.so.conf |
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.1/configure --prefix=/usr \ --disable-profile --enable-add-ons \ --libexecdir=/usr/bin |
The meaning of the configure options are:
--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.
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.
Because Glibc hasn't been installed yet, one of the tests that was run by the configure script has failed. This test is supposed to test gcc to determine whether a cross-compiler is installed. However, Glibc needs to be already installed to run this test. Since the test failed, the configure script assumes we have a cross-compiler. We override that assumption by explicitly telling Glibc we're not cross-compiling. Not doing this would have a couple of unintended side effects, such as the timezone files not being installed.
echo "cross-compiling = no" > configparms |
Continue with compiling the package:
make |
We'll continue with installing the package. The Linuxthreads man pages are not going to be installed at this point because it requires a working Perl installation. We'll install Perl later on in this chapter, and the man pages will be installed when Glibc is installed for the second time at the end of this chapter.
make install |
The locales (used by Glibc to make your Linux system talk 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 using the localedef command. Information on this can be found in the INSTALL file in the glibc-2.3.1 tree.
To finish off the installation we'll reload Bash so it will use the new libnss_* files. This will also get rid of the I have no name! message in the command prompt:
exec /static/bin/bash --login |
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 symlink by running:
ln -sf ../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.
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 |
Estimated build time: 13.26 SBU Estimated required disk space: 221 MB |
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:
c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0
Last checked against version 2.95.3.
Bash: sh
Binutils: ar, as, ld, nm, ranlib
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, touch
Find: find
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: basename, dirname, echo, expr, hostname, sleep, true, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tail, tr
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.
We will be building the C and C++ compilers at this time, so you'll need to unpack both the gcc-core and gcc-g++ tarballs. Other compilers are available in the full gcc package; instructions for building them may be found at http://beyond.linuxfromscratch.org/view/cvs/general/gcc.html.
It is recommended by the GCC installation documentation to build GCC in a dedicated directory outside of the source tree. Create the build directory:
mkdir ../gcc-build && cd ../gcc-build |
Prepare GCC to be compiled:
../gcc-3.2.1/configure --prefix=/usr --enable-shared \ --enable-threads=posix --with-slibdir=/lib \ --enable-__cxa_atexit --enable-clocale=gnu |
The meanings of the configure options are:
--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.
Continue with compiling the package:
make bootstrap |
The bootstrap target doesn't just compile GCC, but it compiles GCC multiple times. It uses the first compiled programs to compile itself a second and third time to make sure the compiler was compiled properly.
Finish installing the package:
make install-no-fixedincludes |
Some packages expect the C PreProcessor to be installed in the /lib and /usr/lib directories. To honor those packages, create two symlinks:
ln -s ../usr/bin/cpp /lib && ln -s ../bin/cpp /usr/lib |
Many packages compile using cc as the name for the C compiler. To satisfy those packages, create a cc symlink:
ln -s gcc /usr/bin/cc |
Estimated build time: 0.07 SBU Estimated required disk space: 1 MB |
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:
Prepare Zlib to be compiled:
CFLAGS="$CFLAGS -fPIC" \ ./configure --prefix=/usr --shared |
The -fPIC flag helps to assure quality in the dynamic zlib library.
Some packages expect a static zlib library to be present on the system. To satisfy those programs, compile both the shared and static libraries:
make LIBS="libz.so.1.1.4 libz.a" |
Install the libraries:
make LIBS="libz.so.1.1.4 libz.a" 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 |
Estimated build time: 0.10 SBU Estimated required disk space: 3 MB |
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:
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Grep: egrep, grep
Gcc: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed
Sh-utils: basename, date, echo, hostname
Textutils: cat, tr
The Findutils package is quite old and it has problems compiling against newer Glibc versions (Glibc-2.0.x and up). You need to apply the patch, which fixes the following issues:
Findutils declares a function called basename, but this function name is already used by the C standard libraries. This patch changes the Findutils version of basename function so that it is called basename2 instead.
Findutils uses library files in an incorrect way. It declares library functions, to tell the compiler what the name of the function will be when the libraries are linked in. This syntax is invalid and causes compiler warnings/errors. This patch removes this improper syntax.
Every GNU package is supposed use a macro called _GNU_SOURCE. This macro enables declarations of GNU library extension functions and so the compiler will be able to detect name conflicts between functions more easily. This patch adds this macro to the source code.
patch -Np1 -i ../findutils-4.1.patch |
There is a bug in locate.c of Findutils that causes a segmentation fault to occur on very long path names. The problem is caused by the get_short() function calculating negative numbers incorrectly. This patch corrects this bug.
patch -Np1 -i ../findutils-4.1-segfault.patch |
Prepare Findutils to be compiled:
./configure --prefix=/usr |
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 both make commands below.
Continue with compiling the package:
make libexecdir=/usr/bin |
Finish installing the package:
make libexecdir=/usr/bin install |
Estimated build time: 0.39 SBU Estimated required disk space: 15 MB |
Last checked against version 3.1.1.
Gawk is an awk implementation that is used to manipulate text files.
Gawk installs the following:
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.1 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.1 to be more correct.
The patch ensures that this directory ($prefix/share/gawk-3.1.1) is removed along with its contents on a make uninstall.
patch -Np1 -i ../gawk-3.1.1-3.patch |
Prepare Gawk to be compiled:
./configure --prefix=/usr --libexecdir=/usr/bin |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 1.88 SBU Estimated required disk space: 22 MB |
Last checked against version 5.2.
The Ncurses package provides character and terminal handling libraries, including panels and menus.
Ncurses installs the following:
captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput and tset.
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
Last checked against version 5.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mkdir, mv, rm
Gcc: c++, cc1, cc1plus, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, uname
Textutils: cat, sort, tr, wc
Prepare Ncurses to be compiled:
./configure --prefix=/usr --with-shared |
Continue with compiling the package:
make |
Install the package:
make install |
Give the ncurses libraries executable permission:
chmod 755 /usr/lib/*.5.3 |
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 libncurses.a /usr/lib/libcurses.a && ln -sf ../../lib/libncurses.so.5 /usr/lib/libncurses.so && ln -sf ../../lib/libncurses.so.5 /usr/lib/libcurses.so |
Estimated build time: 0.81 SBU Estimated required disk space: 24 MB |
Last checked against version 6.1.
The Vim package contains a configurable text editor built to enable efficient text editing.
Vim installs the following:
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
emacs, joe and nano
http://beyond.linuxfromscratch.org/view/cvs/postlfs/editors.html
Last checked against version 6.0.
Bash: sh
Binutils: as, ld, strip
Diffutils: cmp, diff
Fileutils: chmod, cp, ln, mkdir, mv, rm, touch
Find: find
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Net-tools: hostname
Sed: sed
Sh-utils: echo, expr, uname, whoami
Textutils: cat, tr, wc
This package requires its patch to be applied before you can install it. This patch fixes a compile problem with GCC-3.2:
patch -Np1 -i ../vim-6.1.patch |
Prepare Vim to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\" |
The meaning of the make option is:
CPPFLAGS=-DSYS_VIMRC_FILE=\\\"/etc/vimrc\\\": This option causes vim to look for the /etc/vimrc file which contains vim's global settings. Normally, this file is assumed to be located in /usr/share/vim, but we feel that /etc is a more logical place for this kind of file.
Finish installing 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.
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 |
Estimated build time: 0.08 SBU Estimated required disk space: 3 MB |
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:
Last checked against version 1.4.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Make: make
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Sed: sed
Sh-utils: date, echo, hostname
Textutils: cat, tr
Prepare M4 to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.27 SBU Estimated required disk space: 6 MB |
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:
Last checked against version 1.31.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: basename, dirname, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, head, tr, uniq
Prepare Bison to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.13 SBU Estimated required disk space: 2 MB |
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:
Last checked against version 358.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, mv, rm, touch
Grep: egrep, grep
Gcc: cc1, collect2, cpp0, gcc
Make: make
Sed: sed
Sh-utils: expr, hostname, uname
Textutils: cat, tr
Prepare Less to be compiled:
./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 1.08 SBU Estimated required disk space: 18 MB |
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:
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)
Last checked against version 1.17.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, touch
Gcc: cc1, cc1plus, collect2, cpp0, g++, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, uname
Textutils: cat, tr
Prepare Groff to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Install the package:
make install |
Some groff/man document 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 |
Estimated build time: 0.83 SBU Estimated required disk space: 17 MB |
Last checked against version 2.0.
The Textutils package contains several file manipulation and text processing programs.
Textutils installs the following:
cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Textutils to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Install the package:
make install |
Finally, complete the installation of this package by moving some of its programs to a more appropriate directory:
mv /usr/bin/{cat,head} /bin |
Estimated build time: 0.09 SBU Estimated required disk space: 2 MB |
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:
Last checked against version 3.02.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Sed to be compiled:
./configure --prefix=/usr --bindir=/bin |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.05 SBU Estimated required disk space: 3 MB |
Last checked against version 2.5.4a.
The Flex package is used to generate programs which recognize patterns in text.
Flex installs the following:
Last checked against version 2.5.4a.
Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, hostname
Textutils: cat, tr
Prepare Flex to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Install the package:
make install |
There are packages which expect to find the lex library in the /usr/lib directory. Create a symlink to account for this:
ln -s libfl.a /usr/lib/libl.a |
Some programs don't know about flex and try to find the lex program (flex is a (better) alternative for lex). To please those programs, create a shell script named lex which calls flex in 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 |
Estimated build time: 2.48 SBU Estimated required disk space: 94 MB |
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:
addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip
Last checked against version 2.11.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, rmdir, touch
Flex: flex
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, true, uname
Texinfo: install-info, makeinfo
Textutils: cat, sort, tr, uniq
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 |
Next, prepare Binutils to be compiled:
../binutils-2.13.2/configure --prefix=/usr --enable-shared |
Continue with compiling 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 the Intel machine that generates code that can be executed on Apple PowerPC machines).
Install the package:
make tooldir=/usr install |
Install the info pages:
make tooldir=/usr install-info |
Some packages require the libiberty header in order to build. To honor those packages, install the file:
cp ../binutils-2.13.2/include/libiberty.h /usr/include |
Estimated build time: 0.68 SBU Estimated required disk space: 17 MB |
Last checked against version 4.1.
Fileutils is a package containing basic file manipulation programs. Included are programs to list and create directories, update timestamps, change permissions and so forth.
Fileutils installs the following files:
chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr
Prepare Fileutils to be compiled:
./configure --prefix=/usr --bindir=/bin |
Continue with compiling the package:
make |
Install the package:
make install |
Some packages hardwire the path to the install program as /usr/bin/install. Create a symlink to account for this:
ln -s ../../bin/install /usr/bin |
Estimated build time: 0.42 SBU Estimated required disk space: 12 MB |
Last checked against version 2.0.
The Sh-utils package contains a number of basic shell manipulation utilities.
Sh-utils installs the following:
basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, chown, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
This package requires its hostname-patch to be applied before you can install it. This patch suppresses the build of the hostname program which will be installed later with the net-tools package. The hostname program from the net-tools package is a much better version (and in some cases even required since it supports options that are needed by some programs such as XFree86). Apply the patch:
patch -Np1 -i ../sh-utils-2.0-hostname.patch |
Prepare Shellutils to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Install the package:
make install |
Finally, move some of the programs to more appropriate locations:
mv /usr/bin/{basename,date,echo,false,pwd} /bin && mv /usr/bin/{sleep,stty,su,test,true,uname} /bin && mv /usr/bin/chroot /usr/sbin |
There is a command installed in this package which is named test. It is often used in shell scripts to evaluate conditions, but is more often encountered in the form of [ condition ]. These brackets are built into the bash interpreter, but the FHS dictates that there should be a [ binary. Create it by running:
ln -s test /bin/[ |
Estimated build time: 0.99 SBU Estimated required disk space: 39 MB |
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:
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
Last checked against version 0.10.40.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Bison: bison
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, sort, tr, uniq
Prepare Gettext to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.16 SBU Estimated required disk space: 5 MB |
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:
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)
Last checked against version 1.60.
Bash: bash, sh
Binutils: ar, as, ld
Fileutils: install, ln, ls, mv, rm
Gcc: cc, cc1, collect2, cpp0
Make: make
Sh-utils: echo
If you don't know what to answer to all the questions asked during the make phase, then just accept the defaults, which will be just fine in the majority of the cases. What you are asked here are a bunch of questions relating to the kind of network protocols that you have enabled in your kernel.
The default answers will enable the tools from this package to work with the most common protocols such as TCP, PPP and a bunch of others. You still need to actually enable these protocols in the kernel. What you do here is merely telling the programs to be able to use those protocols, but it's up to the kernel to make them available to the system.
Compile the package:
make |
If you intend to accept the default settings, you may skip the questions generated by make by running yes "" | make instead.
Finish installing the package:
make update |
The update option to make works similarly to the install option, with one exception: it doesn't make backups of files it's replacing.
If you decide to reinstall this package at some point in the future, a make update won't backup all the files from a previous net-tools installation.
Estimated build time: 3.81 SBU Estimated required disk space: 52 MB |
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:
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
Last checked against version 5.6.1.
Bash: sh
Binutils: ar, as, ld, nm
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, touch
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, pwd, uname, whoami
Textutils: cat, comm, sort, split, tr, uniq, wc
Prepare Perl to be compiled:
./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.
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.43 SBU Estimated required disk space: 12 MB |
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:
Last checked against version 4.0.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep
Texinfo: makeinfo
Textutils: cat, tr
Prepare Texinfo to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
Install the package:
make install |
Install the texinfo components which belong in a TeX installation:
make TEXMF=/usr/share/texmf install-tex |
Estimated build time: 0.05 SBU Estimated required disk space: 6 MB |
Last checked against version 2.53.
Autoconf produces shell scripts which automatically configure source code.
Autoconf installs the following:
Last checked against version 2.52.
Bash: sh
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm
Grep: fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr
Prepare Autoconf to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.03 SBU Estimated required disk space: 6 MB |
Last checked against version 1.6.2.
Automake generates Makefile.in files, intended for use with Autoconf.
Automake installs the following:
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
Last checked against version 1.5.
Bash: sh
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm, rmdir
Grep: fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: install-info
Textutils: cat, tr
Prepare Automake to be compiled:
./configure --prefix=/usr |
Continue with compiling and installing the package:
make install |
Create a necessary symbolic link:
ln -s automake-1.7 /usr/share/automake |
Estimated build time: 0.82 SBU Estimated required disk space: 14 MB |
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:
Last checked against version 2.05a.
Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr, uniq
Prepare Bash to be compiled:
./configure --prefix=/usr --bindir=/bin |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Reload the newly compiled Bash:
exec /bin/bash --login |
Estimated build time: 0.21 SBU Estimated required disk space: 2 MB |
Last checked against version 3.39.
File is a utility used to determine file types.
File installs the following:
Last checked against version 3.37.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: makeinfo
Textutils: cat, tr
Prepare File to be compiled:
./configure --prefix=/usr --datadir=/usr/share/misc |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.15 SBU Estimated required disk space: 7 MB |
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:
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
Last checked against version 1.4.2.
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, sort, tr, uniq
Prepare Libtool to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.07 SBU Estimated required disk space: 2 MB |
Last checked against version 0.16.3
Bin86 is a simple assembler and linker for 8086 - 80386 machine code.
Bin86 installs the following:
as86, as86_encap, ld86, nm86 (link to objdump86), objdump86 and size86 (link to objdump86)
Last checked against version 0.16.0.
Bash: sh
Binutils: as, ld, strip
Fileutils: chmod, install, ln, mv
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
This package is only needed if you decide to use Lilo on your LFS system. If you're going to use something else like Grub you won't need bin86. Check the documentation for your favorite boot loader to see if you need the bin86 package (usually only ld86 and/or as86 from this package are required).
Keep in mind, though, that it's not just boot loaders that use the bin86 package. There is always the chance that some other package needs programs from this package, so keep that in mind if you decide to skip this.
Compile the package:
make |
And finish off installing the package:
make PREFIX=/usr install |
Estimated build time: 0.09 SBU Estimated required disk space: 3 MB |
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:
bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore
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
Last checked against version 1.0.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Fileutils: cp, ln, rm
Gcc: cc1, collect2, cpp0, gcc
Make: make
Begin compiling the package:
make -f Makefile-libbz2_so |
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.
Continue compiling the package:
make |
Install the package:
make install |
Copy the Bzip2 binary into the /bin directory, 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 |
Estimated build time: 0.06 SBU Estimated required disk space: 3 MB |
Last checked against version 0.2.
GNU ed is an 8-bit clean, POSIX-compliant line editor.
Ed installs the following:
Last checked against version 0.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr
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 uses mktemp to create temporary files in /tmp, but this function has a security vulnerability (see section on Temporary Files in http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html). This 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 |
Prepare Ed to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
We need to move the Ed binaries to the /bin directory so they may be used in the event that the /usr partition is unavailable.
mv /usr/bin/{ed,red} /bin |
Estimated build time: 0.12 SBU Estimated required disk space: 8 MB |
Last checked against version 1.06.
Kbd contains keytable files and keyboard utilities.
Kbd installs the following:
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
Last checked against version 1.06.
Bash: sh
Binutils: as, ld, strip
Bison: bison
Diffutils: cmp
Fileutils: cp, install, ln, mv, rm
Flex: flex
Gettext: msgfmt, xgettext
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gunzip, gzip
Make: make
Patch: patch
Sed: sed
Sh-utils: uname
Kbd doesn't install some of its utilities (setlogcons, setvesablank and getunimap) by default. The kbd patch enables the compilation of these utilities. Apply the patch:
patch -Np1 -i ../kbd-1.08.patch |
Prepare Kbd to be compiled:
./configure |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.31 SBU Estimated required disk space: 6 MB |
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:
Last checked against version 2.7.
Bash: sh
Binutils: ld, as
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: date, hostname
Textutils: cat, tr
Prepare Diffutils to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.80 SBU Estimated required disk space: 13 MB |
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:
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
Last checked against version 1.25.
Bash: sh
Binutils: ar, as, ld, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mkdir, mv, rm, sync
Gcc: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, uname
Texinfo: makeinfo
Textutils: cat, tr
It is recommended to build E2fsprogs outside of the source tree:
mkdir ../e2fsprogs-build && cd ../e2fsprogs-build |
Prepare E2fsprogs to be compiled:
../e2fsprogs-1.32/configure --prefix=/usr --with-root-prefix="" \ --enable-elf-shlibs |
The meaning of the configure options are:
--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.
Continue with compiling the package:
make |
Begin installing the package:
make install |
Install the shared libraries:
make install-libs |
Update the /usr/share/info/dir file to include E2fsprogs' info pages in the index:
install-info /usr/share/info/libext2fs.info /usr/share/info/dir |
Estimated build time: 0.22 SBU Estimated required disk space: 5 MB |
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:
Last checked against version 2.4.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Grep to be compiled:
./configure --prefix=/usr --bindir=/bin |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.03 SBU Estimated required disk space: 2 MB |
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:
gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew
Last checked against version 1.2.4a.
Bash: sh
Binutils: as, ld, nm
Fileutils: chmod, cp, install, ln, mv, rm
Gcc: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr
The following patch fixes a buffer overflow that occurs when a filename is longer than 1020 characters. It does this by inserting a check that the buffer is large enough for the given filename. The program exits with the message "Filename too long" if the buffer is not large enough.
patch -Np1 -i ../gzip-1.2.4b.patch |
Prepare Gzip to be compiled:
./configure --prefix=/usr |
Change the default installation directory for Gzip so it will be installed in the /bin directory:
cp gzexe.in{,.backup} && sed 's%"BINDIR"%/bin%' gzexe.in.backup > gzexe.in |
Continue with compiling the package:
make |
Install the package:
make install |
Move the Gzip binaries 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 |
Estimated build time: 0.05 SBU Estimated required disk space: 2 MB |
Last checked against version 1.5i.
Bash: sh
Binutils: as, ld
Fileutils: chmod, cp, install, mkdir, rm
Gcc: c11, collect2, cpp0, gcc
Grep: grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: echo
Textutils: cat
There are three patches for Man. The first patch comments out one of the lines in the man.conf file (MANPATH /usr/man) to prevent redundant results when using programs such as whatis:
patch -Np1 -i ../man-1.5k-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.5k-pager.patch |
The last patch prevents 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.5k-80cols.patch |
The paths to some programs are written into man's files. Unfortunately, the configure 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 /static directory.
Prepare Man to be compiled:
PATH=$PATH:/usr/bin:/bin \ ./configure -default -confdir=/etc |
Continue with compiling the package:
make |
And finish off installing the package:
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://hints.linuxfromscratch.org/hints/man.txt, which deals with formatting and compression issues for man pages.
Estimated build time: 0.08 SBU Estimated required disk space: 3 MB |
Last checked against version 22.2.
Lilo is the LInux LOader.
Lilo installs the following:
Last checked against version 22.1.
Bash: sh
Bin86: as86, ld86
Binutils: as, ld, strip
Fileutils: cp, dd, ln
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
Textutils: cat
We have chosen Lilo as a boot loader because we feel comfortable with it, but you may wish to choose another. Fabio Fracassi has written a hint on GRUB, which is available at http://hints.linuxfromscratch.org/hints/grub-howto.txt.
Compile Lilo:
make |
And finish off installing the package:
make install |
At the end of the installation, a message will appear stating that /sbin/lilo has to be executed. This is pointless because the /etc/lilo.conf file isn't present yet. We will complete the installation of lilo in Chapter 8.
The standard LILO prompt, or menu, may be replaced by the LFS logo or any logo you like. Martin Imobersteg has written a hint about this, which is located at http://hints.linuxfromscratch.org/hints/bootlogo.txt.
Estimated build time: 0.22 SBU Estimated required disk space: 6 MB |
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:
Last checked against version 3.79.1.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, install, ls, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
Prepare Make to be compiled:
./configure --prefix=/usr |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
By default, /usr/bin/make is installed setgid kmem. This is needed on some systems so it can check the load average by using /dev/kmem. However, on Linux systems, setgid kmem is not needed, so we remove this from our make binary. This also fixes problems with make ignoring certain variables like LD_LIBRARY_PATH.
chgrp root /usr/bin/make && chmod 755 /usr/bin/make |
Estimated build time: 0.13 SBU Estimated required disk space: 3 MB |
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:
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)
Last checked against version 2.4.12.
Bash: sh
Binutils: ar, as, ld, ranlib, strip
Bison: bison
Diffutils: cmp
Fileutils: chmod, install, ln, mkdir, mv, rm
Flex: flex
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: basename, expr, hostname, uname
Textutils: cat, tr
Prepare Modutils to be compiled:
./configure |
Continue with compiling the package:
make |
And finish off installing the package:
make install |
Estimated build time: 0.03 SBU Estimated required disk space: 1 MB |
Last checked against version 0.17.
The Netkit-base package contains two network-related tools: ping, which determines the response time of ICMP packets, and the inet daemon, which listens for port requests and assigns these requests to the appropriate programs.
Netkit-base installs the following:
Last checked against version 0.17.
Bash: sh
Binutils: as, ld, strip
Fileutils: cp, install, rm
Make: make
Gcc: cc1, collect2, cpp0, gcc
Sed: sed
Sh-utils: date
Textutils: cat
Prepare Netkit-base to be compiled:
./configure |
Continue with compiling the package:
make |
Install the package:
make install |
Finally, two essential config files need to be installed in the /etc directory. There are other files in the etc.sample directory which might be of interest to you.
Complete the installation of this package:
cp etc.sample/{services,protocols} /etc |
Estimated build time: 0.10 Estimated required disk space: 2 MB |
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:
Last checked against version 2.5.4.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, expr, hostname, uname
Textutils: cat, tr
Prepare Patch to be compiled:
CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.02 SBU Estimated required disk space: 168 KB |
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:
Last checked against version 18.
Binutils: as, ld
Fileutils: install, mkdir
Gcc: cc1, collect2, cpp0, gcc
Make: make
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.
Finish installing the package:
make install |
Estimated build time: 0.14 SBU Estimated required disk space: 2 MB |
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:
free, kill, oldps, pgrep, pkill, ps, skill, snice, sysctl, tload, top, vmstat, w and watch
Last checked against version 2.0.7.
Bash: sh
Binutils: as, ld, strip
Fileutils: install, ln, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, pwd
Textutils: sort, tr
This package requires its patch to be applied before you can install it. This patch fixes a locale problem that makes w crash under certain locale settings. Apply the patch:
patch -Np1 -i ../procps-3.1.5.patch |
Compile Procps:
make |
Finish installing the package:
make XSCPT="" install |
The XSCPT option will set the Makefile variable XSCPT to an empty value so that XConsole installation is disabled. Otherwise, make install tries to copy the file XConsole to /usr/X11R6/lib/X11/app-defaults. That directory does not exist because X is not installed.
Estimated build time: 0.11 SBU Estimated required disk space: 2 MB |
Last checked against version 21.
The Psmisc package contains three programs which help manage the /proc directory.
Psmisc installs the following:
Last checked against version 20.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Bison: bison
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: makeinfo
Textutils: cat, tr
Prepare Psmisc to be compiled:
./configure --prefix=/usr --exec-prefix=/ |
The --exec-prefix=/ flag will cause the programs to be installed in /bin rather than in /usr/bin. The programs in this package are often used in bootscripts; they should be in the /bin directory so they can be used in the event that the /usr partition isn't mounted.
Continue with compiling the package:
make |
Finish installing the package:
make install |
Psmisc's pidof program isn't installed by default. Generally, this isn't a problem because we later install the Sysvinit package, which provides a better pidof program.
It's up to you to decide if you are going to use the Sysvinit package, which provides a pidof program, or not. If you're not going to use Sysvinit, you should complete this package's installation by creating the /bin/pidof symlink:
ln -s killall /bin/pidof |
Estimated build time: 0.88 SBU Estimated required disk space: 7 MB |
Last checked against version 4.0.3.
The Shadow package was created to strengthen the security of system passwords.
Shadow installs the following:
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
Last checked against version 20001016.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Texinfo: makeinfo
Textutils: cat, sort, tr, uniq
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://hints.linuxfromscratch.org/hints/shadowpasswd_plus.txt.
Prepare Shadow to be compiled:
./configure --prefix=/usr --libdir=/usr/lib \ --enable-shared |
Continue with compiling the package:
make |
Install the package:
make install |
Shadow uses two files to configure authentication settings for the system. Install those config files:
cp etc/{limits,login.access} /etc |
/var/spool/mail is the old location of the user mailboxes. The location that is used nowadays is /var/mail. Issue the following command to modify the mailbox location:
sed 's%/var/spool/mail%/var/mail%' \ etc/login.defs.linux > /etc/login.defs |
According to the manpage of vipw, a vigr symlink should exist. Because the shadow installation procedure doesn't create this symlink, it must be created manually:
ln -s vipw /usr/sbin/vigr |
The vipw link is currently pointing to a non-existing file. Since this file isn't needed here, remove it:
rm /bin/vipw |
Move the sg program to the /usr/bin directory:
mv /bin/sg /usr/bin |
Move Shadow's dynamic libraries to a more appropriate location:
mv /usr/lib/lib{shadow,misc}.so.0* /lib |
The libraries have been moved, but some packages expect to find them in them in the /usr/lib directory. To account for this, create the following symlinks:
ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so && ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so |
Sh-utils and Shadow Password Suite each install a unique groups program. If you wish, you may remove the groups program installed by the Shadow Password Suite:
rm /bin/groups |
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 |
Estimated build time: 0.03 SBU Estimated required disk space: 472 KB |
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:
Last checked against version 1.4.1.
Binutils: as, ld, strip
Fileutils: install
Gcc: cc1, collect2, cpp0, gcc
Make: make
Prepare Sysklogd to be compiled:
make |
Finish installing the package:
make install |
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 |
Estimated build time: 0.06 SBU Estimated required disk space: 1 MB |
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:
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
Last checked against version 2.84.
Bash: sh
Binutils: as, ld
Fileutils: chown, cp, install, ln, mknod, rm
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
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 |
Finish installing the package:
make -C src install |
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 |
Estimated build time: 0.26 SBU Estimated required disk space: 6 MB |
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:
Last checked against version 1.13.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Patch: patch
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
A patch may be applied to give tar direct support for bzip2 files. This patch adds the -j option to tar, which is similar to the -z option used for gzip files.
Apply the patch by running the following command:
patch -Np1 -i ../tar-1.13.patch |
Prepare Tar to be compiled:
./configure --prefix=/usr --bindir=/bin \ --libexecdir=/usr/bin |
Continue with compiling the package:
make |
Finish installing the package:
make install |
Estimated build time: 0.38 SBU Estimated required disk space: 10 MB |
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:
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
Last checked against version 2.11n.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, cp, install, ln, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp, cpp0
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed
Sh-utils: uname, whoami
Textutils: cat
The FHS recommends that we use /var/lib/hwclock, instead of the usual /etc, as the location of the adjtime file. To make hwclock 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 |
Prepare Util-linux to be compiled:
./configure |
Continue with compiling the package:
make HAVE_SLN=yes |
The HAVE_SLN option prevents this package, which was already was installed by Glibc, from being built again.
Finish installing the package:
make HAVE_SLN=yes install |
Estimated build time: 0.01 SBU Estimated required disk space: To Be Determined |
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:
Build the manual pages:
make mandocs |
Install the manual pages:
cp -a Documentation/man /usr/share/man/man9 |
Estimated build time: To Be Determined Estimated required disk space: To Be Determined |
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:
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
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]
Last checked against version 2.2.5.
Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mknod, mv, mkdir, rm, touch
Gcc: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: gawk
Sed: sed
Sh-utils: date, expr, hostname, pwd, uname
Texinfo: install-info, makeinfo
Textutils: cat, cut, sort, tr
At the beginning of this chapter you installed Glibc and applied a patch to it. Part of this patch was undoing some changes to make static binaries compiled against Glibc-2.2 work. However, this is not what the Glibc developers intended and we don't need to keep this modified Glibc around. So we reinstall Glibc here to remove this patch.
A second reason to install Glibc again is because it's considered cleaner. The first Glibc was installed using programs compiled on your host distribution which sometimes has the effect of tainting Glibc. While this isn't a problem with the other packages compiled early in this chapter, for Glibc we want to be sure it's 100% OK (although feel free to reinstall other packages at this point so you can say you compiled an LFS system with LFS. Much like GCC's bootstrap installation method).
We'll also install the linuxthreads man pages here. As you may recall, during the first installation of Glibc this wasn't possible because Perl wasn't installed yet. Now that everything needed to install the Glibc linuxthreads man pages is present as well, we will install those too.
Before starting to install Glibc, you must cd into the glibc-2.3.1 directory and unpack glibc-linuxthreads inside the glibc-2.3.1 directory, not in /usr/src as you normally would do.
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 Glibc. You have been warned.
Basically, compiling Glibc in any other way than the book suggests is putting your system at very high risk.
It is recommended by the Glibc installation documentation to build Glibc outside of the source tree. Create the build directory:
mkdir ../glibc-build && cd ../glibc-build |
Next, prepare Glibc to be compiled:
../glibc-2.3.1/configure --prefix=/usr --disable-profile \ --enable-add-ons --libexecdir=/usr/bin |
Continue with compiling the package:
make |
Begin package installation:
make install |
Build the linuxthreads man pages:
make -C ../glibc-2.3.1/linuxthreads/man |
Install the man pages:
make -C ../glibc-2.3.1/linuxthreads/man install |
Complete package installation by relaunching bash:
exec /bin/bash --login |
From now on when you exit the chroot environment and wish to re-enter it, you need to run the following modified chroot command. The one at the beginning of this chapter might not work anymore (if your host distribution was based on glibc-2.2.x or older, the programs in /static/bin, such as bash, will not work anymore). The following chroot command will work regardless of your host distribution's Glibc version.
Additionally, now that all software has been installed there is no need to use anything from the /static directory anymore.
chroot $LFS /usr/bin/env -i \ HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login |
Estimated build time: 0.01 SBU Estimated required disk space: 252 KB |
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:
checkfs, cleanfs, functions, halt, ifdown, ifup, loadkeys, localnet, mountfs, mountproc, network, rc, reboot, sendsignals, setclock, swap, sysklogd and template
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, which may be found at http://hints.linuxfromscratch.org/hints/bsd-init.txt.
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 |
Now that all software is installed, all that we need to do is perform a few configuration tasks.
Nothing is more annoying than using Linux with a wrong keymap loaded for your keyboard. If you have a default US keyboard, you can skip this section. The US keymap file is the default if you don't change it.
To set the default keymap file, create the /usr/share/kbd/keymaps/defkeymap.map.gz symlink by running the following commands:
ln -s <path/to/keymap> /usr/share/kbd/keymaps/defkeymap.map.gz |
Replace <path/to/keymap> with the your keyboard's map file. For example, if you have a Dutch keyboard, you would run:
ln -s i386/qwerty/nl.map.gz /usr/share/kbd/keymaps/defkeymap.map.gz |
A second option to configure your keyboard's layout is to compile the keymap directly into the kernel. This will make sure that your keyboard always works as expected, even when you have booted into maintenance mode (by passing `init=/bin/sh' to the kernel), in which case the bootscript that normally sets up your keymap isn't run.
Run the following command to patch the correct 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.20/drivers/char/defkeymap.c |
Programs like login, shutdown, uptime and others want to read from and write to the /var/run/utmp, /var/log/btmp and /var/log/wtmp. These files contain information about who is currently logged in. They also contain information on when the computer was last booted and shutdown and a record of the bad login attempts.
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} |
Choose a password for user root and create it by running the following command:
passwd root |
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.
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).
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://hints.linuxfromscratch.org/hints/time.txt. It explains issues such as time zones, UTC, and the TZ environment variable.
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.
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.
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.
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 www.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 www.mydomain.org <value of HOSTNAME> # End /etc/hosts (network card version) EOF |
Of course, the 192.168.1.1 and www.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).
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)
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.
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.
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 adding the proper entries to LILO so that the LFS system can be selected for booting at the LILO: prompt.
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 # 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.
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.
Estimated build time: All default options: 4.20 SBU Estimated required disk space: All default options: 181 MB |
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:
Last checked against version 2.4.17.
Bash: sh
Binutils: ar, as, ld, nm, objcopy
Fileutils: cp, ln, mkdir, mv, rm, touch
Findutils: find, xargs
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Gawk: awk
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed
Sh-utils: basename, date, expr, pwd, stty, uname, whoami, yes
Textutils: cat, md5sum, sort, tail
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 copying the kernel config file, .config, from your host system to the $LFS/usr/src/linux-2.4.20 directory.
Verify dependencies and create dependency information files:
make dep |
Compile the kernel image:
make bzImage |
Compile the drivers which have been configured as modules:
make 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.20/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 modules_install |
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 |
In order to be able to boot the LFS system, we need to update our bootloader. We're assuming that your host system is using Lilo (since that's the most commonly used boot loader at the moment).
We will not be running the lilo program inside chroot. Running lilo inside chroot can have fatal side-effects which render your MBR useless and you'd need a boot disk to be able to start any Linux system (either the host system or the LFS system).
First we'll exit chroot and copy the lfskernel file to the host system:
logout cp $LFS/boot/lfskernel /boot |
The next step is adding an entry to /etc/lilo.conf so that we can choose LFS when booting the computer:
cat >> /etc/lilo.conf << "EOF" image=/boot/lfskernel label=lfs root=<partition> read-only EOF |
<partition> must be replaced with the LFS partition's designation.
Also note that if you are using reiserfs for your root partition, the line read-only should be changed to read-write.
Now, update the boot loader by running:
/sbin/lilo -v |
The last step is synchronizing the host system's lilo configuration files with the LFS system's:
cp /etc/lilo.conf $LFS/etc && cp $(grep "image.*=" /etc/lilo.conf | cut -f 2 -d "=") $LFS/boot |
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 4.1 > $LFS/etc/lfs |
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...
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 LILO: prompt 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.
One final thing you may want to do is run lilo, now that you are booted into LFS. This way you will put the LFS version of LILO in the MBR rather than the one that's there right now from your host system. Depending on how old your host distribution is, the LFS version may have more advanced features you need/could use.
Either way, run the following to make the lilo version installed on LFS active:
/sbin/lilo |
You may now remove the static directory. If you think you may need to redo Chapter 5, then you may wish to backup the directory before removing it. To remove the static directory, type the following command:
rm -rf /static |
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://beyond.linuxfromscratch.org/.
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://hints.linuxfromscratch.org/hints.shtml.
Mailing lists
There are several LFS mailing lists you may subscribe to if you are in need of help. See Chapter 1 - Mailing lists and archives 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/.
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.
Last checked against version 2.53.
Autoconf produces shell scripts which automatically configure source code.
Autoconf installs the following:
Last checked against version 2.53.
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.
The autoheader program can create a template file of C #define statements for configure to use.
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.
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.
The autoupdate program updates a configure.in file that calls autoconf macros by their old names to use the current macro names.
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.
Last checked against version 2.52.
Bash: sh
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm
Grep: fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr
Last checked against version 1.6.2.
Automake generates Makefile.in files, intended for use with Autoconf.
Automake installs the following:
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
Last checked against version 1.6.2.
acinstall is a script which installs aclocal-style M4 files.
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.
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.
missing is a script which acts as a common stub for a few missing GNU programs during an installation.
Last checked against version 1.5.
Bash: sh
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm, rmdir
Grep: fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: install-info
Textutils: cat, tr
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:
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.
bashbug is a shell script to help the user compose and mail bug reports concerning bash in a standard format.
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.
Last checked against version 2.05a.
Bash: bash, sh
Binutils: ar, as, ld, ranlib, size
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr, uniq
Last checked against version 0.16.3
Bin86 is a simple assembler and linker for 8086 - 80386 machine code.
Bin86 installs the following:
as86, as86_encap, ld86, nm86 (link to objdump86), objdump86 and size86 (link to objdump86)
Last checked against version 0.16.3
as86 is an assembler for the 8086...80386 processors.
as86_encap is a shell script to call as86 and convert the created binary into a C file prog.v to be included in or linked with programs like boot block installers.
ld86 understands only the object files produced by the as86 assembler. It can link them into either an impure or a separate I&D executable.
Last checked against version 0.16.0.
Bash: sh
Binutils: as, ld, strip
Fileutils: chmod, install, ln, mv
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
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:
addr2line, ar, as, gprof, ld, nm, objcopy, objdump, ranlib, readelf, size, strings and strip
Last checked against version 2.12.1.
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.
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 is primarily intended to assemble the output of the GNU C compiler, gcc, for use by the linker 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.
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 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 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.
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.
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 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.
libbfd is the Binary File Descriptor library.
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.
Last checked against version 2.11.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, rmdir, touch
Flex: flex
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, true, uname
Texinfo: install-info, makeinfo
Textutils: cat, sort, tr, uniq
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:
Last checked against version 1.35.
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.
This bash script calls bison using the -y option. This is for compatibility purposes for programs which use yacc instead of bison.
Last checked against version 1.31.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: basename, dirname, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, head, tr, uniq
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:
bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless and bzmore
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
Last checked against version 1.0.2
bunzip2 decompresses files that are compressed with bzip2.
bzcmp and bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files.
bzegrep, bzfgrep, and bzgrep invoke either egrep, fgrep, or grep (respectively) on bzip2-compressed files.
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.
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 is a filter which allows examination of compressed or plain text files, one screenful at a time on a soft-copy terminal, like more.
libbz2 is the library for implementing lossless, block-sorting data compression, using the Burrows-Wheeler algorithm.
Last checked against version 1.0.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Fileutils: cp, ln, rm
Gcc: cc1, collect2, cpp0, gcc
Make: make
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:
Last checked against version 2.8.1.
cmp and diff both compare two files and report their differences. Both programs have extra options which compare files in different situations.
Last checked against version 2.7.
Bash: sh
Binutils: ld, as
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: date, hostname
Textutils: cat, tr
E2fsprogs (1.32):
ftp://download.sourceforge.net/pub/sourceforge/e2fsprogs/
http://download.sourceforge.net/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:
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
Last checked against version 1.27.
badblocks is used to search for bad blocks on a device (usually a disk partition).
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.
The debugfs program is a file system debugger. It can be used to examine and change the state of an ext2 file system.
dumpe2fs prints the super block and blocks group information for the filesystem present on a specified device.
e2fsck and fsck.ext2 are used to check, and optionally repair, Linux second extended filesystems.
e2label will display or change the filesystem label on the ext2 filesystem located on the specified device.
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 is used to create a Linux second extended file system on a device (usually a disk partition). mkfs.ext2 does the same as mke2fs.
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.
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.
The common error display routine.
The ext2fs library is designed to allow user-level programs to manipulate an ext2 filesystem.
The libuuid library is used to generate unique identifiers for objects that may be accessible beyond the local system.
Last checked against version 1.25.
Bash: sh
Binutils: ar, as, ld, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mkdir, mv, rm, sync
Gcc: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, echo, expr, hostname, uname
Texinfo: makeinfo
Textutils: cat, tr
Ed (0.2):
ftp://ftp.gnu.org/gnu/ed/
Ed Patch (0.2):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Last checked against version 0.2.
GNU ed is an 8-bit clean, POSIX-compliant line editor.
Ed installs the following:
Last checked against version 0.2.
ed is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.
red is a restricted ed: it can only edit files in the current directory and cannot execute shell commands.
Last checked against version 0.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr
Last checked against version 3.39.
File is a utility used to determine file types.
File installs the following:
Last checked against version 3.39.
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.
Last checked against version 3.37.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: makeinfo
Textutils: cat, tr
Fileutils (4.1):
ftp://ftp.gnu.org/gnu/fileutils/
Fileutils Patch (4.1):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Last checked against version 4.1.
Fileutils is a package containing basic file manipulation programs. Included are programs to list and create directories, update timestamps, change permissions and so forth.
Fileutils installs the following files:
chgrp, chmod, chown, cp, dd, df, dir, dircolors, du, install, ln, ls, mkdir, mkfifo, mknod, mv, rm, rmdir, shred, sync, touch and vdir
Last checked against version 4.1.
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 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.
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 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 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 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.
du displays the amount of disk space used by each file or directory listed on the command-line and by each of their subdirectories.
install copies files and sets their permission modes and, if possible, their owner and group.
mv moves files from one directory to another or renames files, depending on the arguments given to mv.
touch changes the access and modification times of each given file to the current time. Files that do not exist are created empty.
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, tr
Findutils (4.1):
ftp://ftp.gnu.org/gnu/findutils/
Findutils Patch (4.1):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Findutils Segfault Patch (4.1):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
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:
Last checked against version 4.1.
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.
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 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 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.
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.
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.
Last checked against version 4.1.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Grep: egrep, grep
Gcc: cc1, collect2, cpp0, gcc
Make: make
Patch: patch
Sed: sed
Sh-utils: basename, date, echo, hostname
Textutils: cat, tr
Last checked against version 2.5.4a.
The Flex package is used to generate programs which recognize patterns in text.
Flex installs the following:
Last checked against version 2.5.4a.
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.
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.
Last checked against version 2.5.4a.
Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mv, rm, touch
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, hostname
Textutils: cat, tr
Gawk (3.1.1):
ftp://ftp.gnu.org/pub/gnu/gawk/
Gawk Patch (3.1.1-3):
http://downloads.linuxfromscratch.org/
Last checked against version 3.1.1.
Gawk is an awk implementation that is used to manipulate text files.
Gawk installs the following:
Last checked against version 3.1.1.
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:
c++, c++filt, cc (link to gcc), cc1, cc1plus, collect2, cpp, cpp0, g++, gcc, gccbug, gcov and tradcpp0
Last checked against version 3.1.
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.
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.
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.
Run-time support files for gcc.
libiberty is a collection of subroutines used by various GNU programs including getopt, obstack, strerror, strtol and strtoul.
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++ provides support for the c++ programming language. Among other things, libsupc++ contains routines for exception handling.
Last checked against version 2.95.3.
Bash: sh
Binutils: ar, as, ld, nm, ranlib
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, touch
Find: find
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: basename, dirname, echo, expr, hostname, sleep, true, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tail, tr
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:
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
Last checked against version 0.11.2.
The config.charset script outputs a system-dependent table of character encoding aliases.
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.
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.
The gettextize program copies all standard gettext files into a directory. It's used to make a package with gettext translations.
The msgattrib program filters the messages of a translation catalog according to their attributes and manipulates the attributes.
The msgcomm program searches messages which appear in several .po files. It's used to compare how things are translated.
The msgfmt program compiles raw translation into machine code. It's used to create the final program/package translation file.
The msggrep program extracts all messages of a translation catalog that match a given pattern or belong to some given source files.
The msginit program creates a new PO file, initializing the meta information with values from the user's environment.
The msgmerge program combines two raw translations into one file. It's used to update the raw translation with the source extract.
The msgunfmt program decompiles translation files into raw translation text. It can only be used if the compiled versions are available.
The ngettext program displays native language translations of a textual message whose grammatical form depends on a number.
The team-address script prints the team's address to stdout and outputs additional instructions.
The xgettext program extracts the message lines from the programmers' C files. It's used to make the first translation template.
Last checked against version 0.10.40.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Bison: bison
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, sort, tr, uniq
Glibc (2.3.1):
ftp://ftp.gnu.org/gnu/glibc/
Glibc-linuxthreads (2.3.1):
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/
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:
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
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]
Last checked against version 2.2.5.
catchsegv can be used to create a stack trace when a program terminates with a segmentation fault.
ldd prints the shared libraries required by each program or shared library specified on the command line.
locale is a Perl program which tells the compiler to enable (or disable) the use of POSIX locales for built-in operations.
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.
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.
tzselect asks the user for information about the current location and outputs the resulting time zone description to standard output.
ld.so is the helper program for shared library executables.
libbsd-compat provides the portability needed in order to run certain programs in Linux.
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.
libmemusage is used by memusage to help collect information about the memory usage of a program.
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.
Code used by the kernel to track CPU time spent in functions, source code lines, and instructions.
Functions in this library provide for creating, sending, and interpreting packets to the Internet domain name servers.
Functions in this library provide most of the interfaces specified by the POSIX.1b Realtime Extension.
Functions is this library are useful for building debuggers for multi-threaded programs.
Last checked against version 2.2.5.
Bash: sh
Binutils: ar, as, ld, ranlib, readelf
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mknod, mv, mkdir, rm, touch
Gcc: cc, cc1, collect2, cpp, gcc
Grep: egrep, grep
Gzip: gzip
Make: make
Gawk: gawk
Sed: sed
Sh-utils: date, expr, hostname, pwd, uname
Texinfo: install-info, makeinfo
Textutils: cat, cut, sort, tr
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:
Last checked against version 2.5.
egrep prints lines from files matching an extended regular expression pattern.
fgrep prints lines from files matching a list of fixed strings, separated by newlines, any of which is to be matched.
Last checked against version 2.4.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
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:
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)
Last checked against version 1.17.2.
addftinfo reads a troff font file and adds some additional font-metric information that is used by the groff system.
eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff.
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 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.
grolj4 is a driver for groff that produces output in PCL5 format suitable for an HP Laserjet 4 printer.
indxbib makes an inverted index for the bibliographic databases a specified file for use with refer, lookbib, and lkbib.
lkbib searches bibliographic databases for references that contain specified keys and prints any references found on the standard output.
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.
pic compiles descriptions of pictures embedded within troff or TeX input files into commands that are understood by TeX or troff.
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.
tbl compiles descriptions of tables embedded within troff input files into commands that are understood by 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.
Last checked against version 1.17.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Bison: bison
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, touch
Gcc: cc1, cc1plus, collect2, cpp0, g++, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, uname
Textutils: cat, tr
Gzip (1.2.4a):
ftp://ftp.gnu.org/gnu/gzip/
Gzip Patch (1.2.4b):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
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:
gunzip (link to gzip), gzexe, gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, zforce, zgrep, zmore and znew
Last checked against version 1.2.4a.
gunzip and uncompress decompress files which are compressed with gzip.
gzexe allows you to compress executables in place and have them automatically uncompress and execute when they are run (at a penalty in performance).
zcat uncompresses, and writes to standard output, either a list of files on the command line or a file being read from standard input.
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.
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).
Last checked against version 1.2.4a.
Bash: sh
Binutils: as, ld, nm
Fileutils: chmod, cp, install, ln, mv, rm
Gcc: cc1, collect2, cpp, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: hostname
Textutils: cat, tr
Kbd (1.08):
ftp://ftp.win.tue.nl/pub/linux-local/utils/kbd/
Kbd Patch (1.08):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Last checked against version 1.06.
Kbd contains keytable files and keyboard utilities.
Kbd installs the following:
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
Last checked against version 1.06.
chvt changes foreground virtual terminal.
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.
These are a set of tools for handling Unicode character tables for console fonts.
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.
This lets you fiddle with the built-in hardware screensaver (not toasters, only a blank screen).
showfont displays data about a font. The information shown includes font information, font properties, character metrics and character bitmaps.
Last checked against version 1.06.
Bash: sh
Binutils: as, ld, strip
Bison: bison
Diffutils: cmp
Fileutils: cp, install, ln, mv, rm
Flex: flex
Gettext: msgfmt, xgettext
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gunzip, gzip
Make: make
Patch: patch
Sed: sed
Sh-utils: uname
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:
Last checked against version 374.
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.
Last checked against version 358.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, mv, rm, touch
Grep: egrep, grep
Gcc: cc1, collect2, cpp0, gcc
Make: make
Sed: sed
Sh-utils: expr, hostname, uname
Textutils: cat, tr
LFS-Bootscripts (1.11):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
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:
checkfs, cleanfs, functions, halt, ifdown, ifup, loadkeys, localnet, mountfs, mountproc, network, rc, reboot, sendsignals, setclock, swap, sysklogd and template
Last checked against version 1.11.
The checkfs script checks the file systems just before they are mounted (with the exception of journal and network based file systems).
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.
The functions script contains functions shared among different scripts such as error checking, status checking, etc.
The loadkeys script loads the keymap table you specified as proper for your keyboard layout.
The mountfs script mounts all file systems that aren't marked noauto or aren't network based.
The network script sets up network interfaces, such as network cards, and sets up the default gateway where applicable.
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.
The sendsignals script makes sure every process is terminated before the system reboots or halts.
The setclock scripts resets the kernel clock to localtime in case the hardware clock isn't set to GMT time.
The template script is a template you can use to create your own bootscripts for your other daemons.
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:
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
Last checked against version 1.4.2.
A small library that aims at hiding, from programmers, the various difficulties of dlopening libraries.
Last checked against version 1.4.2.
Bash: sh
Binutils: ar, as, ld, nm, ranlib, strip
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gcc: cc, cc1, collect2, cpp0
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: echo, expr, hostname, sleep, uname
Texinfo: install-info
Textutils: cat, sort, tr, uniq
Lilo (22.2):
ftp://ibiblio.org/pub/Linux/system/boot/lilo/
http://ibiblio.org/pub/Linux/system/boot/lilo/
Last checked against version 22.2.
Lilo is the LInux LOader.
Lilo installs the following:
Last checked against version 22.2.
lilo installs the Linux boot loader which is used to start a Linux system.
keytab-lilo.pl compiles keytable definitions into a format which lilo can use in order to set the keyboard type during boot.
Last checked against version 22.1.
Bash: sh
Bin86: as86, ld86
Binutils: as, ld, strip
Fileutils: cp, dd, ln
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
Textutils: cat
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:
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.
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.
Last checked against version 2.4.17.
Bash: sh
Binutils: ar, as, ld, nm, objcopy
Fileutils: cp, ln, mkdir, mv, rm, touch
Findutils: find, xargs
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Gzip: gzip
Make: make
Gawk: awk
Modutils: depmod, genksyms
Net-tools: dnsdomainname, hostname
Sed: sed
Sh-utils: basename, date, expr, pwd, stty, uname, whoami, yes
Textutils: cat, md5sum, sort, tail
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:
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.
Last checked against version 1.4.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, mv, rm
Make: make
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Sed: sed
Sh-utils: date, echo, hostname
Textutils: cat, tr
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:
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.
Last checked against version 3.79.1.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, install, ls, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
MAKEDEV (1.7):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
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:
Last checked against version 1.5.
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.
Last checked against version 1.5.
Bash: sh
Fileutils: chmod, chown, cp, ln, mknod, mv, rm
Grep: grep
Sh-utils: expr, id
Man (1.5k):
ftp://ftp.win.tue.nl/pub/linux-local/utils/man/
Man 80Cols Patch (1.5k):
http://downloads.linuxfromscratch.org/
Man Manpath Patch (1.5k):
http://downloads.linuxfromscratch.org/
Man Pager Patch (1.5k):
http://downloads.linuxfromscratch.org/
Last checked against version 1.5k.
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 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.
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.
Last checked against version 1.5i.
Bash: sh
Binutils: as, ld
Fileutils: chmod, cp, install, mkdir, rm
Gcc: c11, collect2, cpp0, gcc
Grep: grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: echo
Textutils: cat
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:
Last checked against version 1.54.
Examples of provided manual pages are the manual pages describing all the C and C++ functions, a few important /dev/ files and more.
Last checked against version 1.47.
Bash: sh
Fileutils: install
Make: make
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:
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)
Last checked against version 2.4.16.
depmod handles dependency descriptions for loadable kernel modules.
genksyms reads (on standard input) the output from gcc -E source.c and generates a file containing version information.
modinfo examines an object file associated with a kernel module and displays any information that it can glean.
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.
Last checked against version 2.4.12.
Bash: sh
Binutils: ar, as, ld, ranlib, strip
Bison: bison
Diffutils: cmp
Fileutils: chmod, install, ln, mkdir, mv, rm
Flex: flex
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: basename, expr, hostname, uname
Textutils: cat, tr
Last checked against version 5.2.
The Ncurses package provides character and terminal handling libraries, including panels and menus.
Ncurses installs the following:
captoinfo (link to tic), clear, infocmp, infotocap (link to tic), reset (link to tset), tack, tic, toe, tput and tset.
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
Last checked against version 5.2.
captoinfo converts a termcap description into a terminfo description.
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 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).
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.
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.
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 initializes terminals so they can be used, but it's not widely used anymore. It's provided for 4.4BSD compatibility.
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.
Last checked against version 5.2.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, mkdir, mv, rm
Gcc: c++, cc1, cc1plus, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, fgrep, grep
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, uname
Textutils: cat, sort, tr, wc
Last checked against version 0.17.
The Netkit-base package contains two network-related tools: ping, which determines the response time of ICMP packets, and the inet daemon, which listens for port requests and assigns these requests to the appropriate programs.
Netkit-base installs the following:
Last checked against version 0.17.
inetd is the mother of all daemons. It listens for connections and transfers the call to the appropriate daemon.
Last checked against version 0.17.
Bash: sh
Binutils: as, ld, strip
Fileutils: cp, install, rm
Make: make
Gcc: cc1, collect2, cpp0, gcc
Sed: sed
Sh-utils: date
Textutils: cat
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:
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)
Last checked against version 1.60.
arp is used to manipulate the kernel's ARP cache, usually to add or delete an entry, or to dump the ARP cache.
netstat is a multi-purpose tool used to print the network connections, routing tables, interface statistics, masquerade connections and multicast memberships.
slattach attaches a network interface to a serial line, i.e.. puts a normal terminal line into one of several "network" modes.
Last checked against version 1.60.
Bash: bash, sh
Binutils: ar, as, ld
Fileutils: install, ln, ls, mv, rm
Gcc: cc, cc1, collect2, cpp0
Make: make
Sh-utils: echo
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:
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 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.
Last checked against version 2.5.4.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, mv, rm
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, grep
Make: make
Sed: sed
Sh-utils: echo, expr, hostname, uname
Textutils: cat, tr
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:
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
Last checked against version 5.6.1.
a2p is an awk to perl translator.
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 helps to generate bug reports about perl or the modules that come with it, and mail them.
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 is a tool to aid in the conversion of Perl4-style .pl library files to Perl5-style library modules.
Last checked against version 5.6.1.
Bash: sh
Binutils: ar, as, ld, nm
Diffutils: cmp
Fileutils: chmod, cp, ln, ls, mkdir, mv, rm, touch
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, date, echo, expr, hostname, pwd, uname, whoami
Textutils: cat, comm, sort, split, tr, uniq, wc
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:
Last checked against version 18.
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 gathers some system data from the /proc directory and prints it nicely formatted on the standard output device.
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.
Last checked against version 18.
Binutils: as, ld
Fileutils: install, mkdir
Gcc: cc1, collect2, cpp0, gcc
Make: make
Procps (3.1.5):
http://procps.sourceforge.net/
Procps Patch (3.1.5):
http://downloads.linuxfromscratch.org
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:
free, kill, oldps, pgrep, pkill, ps, skill, snice, sysctl, tload, top, vmstat, w and watch
Last checked against version 2.0.7.
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.
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.
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.
Last checked against version 2.0.7.
Bash: sh
Binutils: as, ld, strip
Fileutils: install, ln, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: grep
Make: make
Gawk: awk
Sed: sed
Sh-utils: basename, pwd
Textutils: sort, tr
Psmisc (21.2):
http://download.sourceforge.net/psmisc/
ftp://download.sourceforge.net/pub/sourceforge/psmisc/
Last checked against version 21.
The Psmisc package contains three programs which help manage the /proc directory.
Psmisc installs the following:
Last checked against version 21.
Note that in LFS we don't install the pidof link by default because we use pidof from sysvinit instead.
Last checked against version 20.2.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Bison: bison
Binutils: as, ld
Diffutils: cmp
Fileutils: chmod, install, ls, mkdir, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Texinfo: makeinfo
Textutils: cat, tr
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:
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).
Last checked against version 3.02.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Sed: sed
Sh-utils: echo, expr, hostname, sleep
Texinfo: install-info, makeinfo
Textutils: cat, tr
Last checked against version 4.0.3.
The Shadow package was created to strengthen the security of system passwords.
Shadow installs the following:
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
Last checked against version 4.0.3.
chage changes the number of days between password changes and the date of the last password change.
chfn changes a user's full name and other information (office room number, office phone number, and home phone number).
chpasswd reads a file of user name and password pairs from standard input and uses this information to update a group of existing users.
faillog formats the contents of the failure log, /var/log/faillog, and maintains failure counts and limits.
The groupadd command creates a new group account using the values specified on the command line and the default values from the system.
The groupdel command modifies the system account files, deleting all entries that refer to group.
The groupmod command modifies the system account files to reflect the changes that are specified on the command line.
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.
mkpasswd reads a file in the format given by the flags and converts it to the corresponding database file format.
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.
sg sets the user's GID to that of the given group, or executes a given command as member of the given group.
userdel modifies the system account files, deleting all entries that refer to a specified login name.
usermod modifies the system account files to reflect the changes that are specified on the command line.
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.
Last checked against version 20001016.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, nm, ranlib
Diffutils: cmp
Fileutils: chmod, cp, install, ln, ls, mkdir, mv, rm, rmdir
Gettext: msgfmt, xgettext
Gcc: cc1, collect2, cpp0, gcc
Glibc: ldconfig
Grep: egrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Texinfo: makeinfo
Textutils: cat, sort, tr, uniq
Sh-utils (2.0):
ftp://ftp.gnu.org/gnu/sh-utils/
Sh-utils Patch (2.0):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Sh-utils Hostname Patch (2.0-hostname):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Last checked against version 2.0.
The Sh-utils package contains a number of basic shell manipulation utilities.
Sh-utils installs the following:
basename, chroot, date, dirname, echo, env, expr, factor, false, groups, hostid, id, logname, nice, nohup, pathchk, pinky, printenv, printf, pwd, seq, sleep, stty, su, tee, test, true, tty, uname, uptime, users, who, whoami and yes
Last checked against version 2.0.
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, chown, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
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:
Last checked against version 1.4.1.
klogd is a system daemon which intercepts and logs Linux kernel messages.
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.
Last checked against version 1.4.1.
Binutils: as, ld, strip
Fileutils: install
Gcc: cc1, collect2, cpp0, gcc
Make: make
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:
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
Last checked against version 2.84.
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 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 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 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 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 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.
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).
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 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 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).
utmpdumps prints the content of a file (usually /var/run/utmp) on standard output in a user friendly format.
Last checked against version 2.84.
Bash: sh
Binutils: as, ld
Fileutils: chown, cp, install, ln, mknod, rm
Gcc: cc, cc1, collect2, cpp0
Make: make
Sed: sed
Tar (1.13):
ftp://ftp.gnu.org/gnu/tar/
Tar Patch (1.13):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
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:
Last checked against version 1.13.
rmt is a program used by the remote dump and restore programs to manipulate a magnetic tape drive through an interprocess communication connection.
tar is an archiving program designed to store and extract files from an archive file known as a tar file.
Last checked against version 1.13.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Patch: patch
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Texinfo: install-info, makeinfo
Textutils: cat, tr
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:
Last checked against version 4.2.
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.
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.
The makeinfo program translates Texinfo source documents into various formats. Available formats are: info files, plain text and HTML.
Last checked against version 4.0.
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ln, ls, mkdir, mv, rm
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, fgrep, grep
Make: make
Sed: sed
Sh-utils: basename, echo, expr, hostname, sleep
Texinfo: makeinfo
Textutils: cat, tr
Last checked against version 2.0.
The Textutils package contains several file manipulation and text processing programs.
Textutils installs the following:
cat, cksum, comm, csplit, cut, expand, fmt, fold, head, join, md5sum, nl, od, paste, pr, ptx, sort, split, sum, tac, tail, tr, tsort, unexpand, uniq and wc
Last checked against version 2.0.
cat concatenates file(s) or standard input to standard output.
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.
fold wraps input lines in each specified file (standard input by default), writing to standard output.
od writes an unambiguous representation, octal bytes by default, of a specified file to standard output.
paste writes lines consisting of the sequentially corresponding lines from each specified file, separated by TABs, to standard output.
tr translates, squeezes, and/or deletes characters from standard input, writing to standard output.
wc prints line, word and byte counts for each specified file and a total line, if more than one file is specified.
Last checked against version 2.0.
Autoconf: autoconf, autoheader
Automake: aclocal, automake
Bash: sh
Binutils: ar, as, ld, ranlib
Diffutils: cmp
Fileutils: chmod, install, ls, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp0, gcc
Glibc: getconf
Grep: egrep, fgrep, grep
M4: m4
Make: make
Gawk: gawk
Net-tools: hostname
Perl: perl
Sed: sed
Sh-utils: basename, echo, expr, sleep, uname
Tar: tar
Texinfo: install-info, makeinfo
Textutils: cat, tr
Util-linux (2.11y):
ftp://ftp.win.tue.nl/pub/linux-local/utils/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:
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
Last checked against version 2.11t.
agetty opens a tty port, prompts for a login name and invokes the /bin/login command.
hexdump displays specified files, or standard input, in a user specified format (ascii, decimal, hexadecimal, octal).
mount mounts, from many possible sources, filesystems or directories on a directory (mount point).
These are example scripts for using the getopt program with either BASH or TCSH.
ul reads a file and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use.
write sends a message to another user, if that user has writing enabled (usually by using mesg).
Last checked against version 2.11n.
Bash: sh
Binutils: as, ld
Diffutils: cmp
Fileutils: chgrp, chmod, cp, install, ln, mv, rm
Gettext: msgfmt, xgettext
Gcc: cc, cc1, collect2, cpp, cpp0
Glibc: rpcgen
Grep: grep
Make: make
Sed: sed
Sh-utils: uname, whoami
Textutils: cat
Vim (6.1):
ftp://ftp.vim.org/pub/editors/vim/unix/
Vim Patch (6.1):
ftp://ftp.linuxfromscratch.org/lfs-packages/cvs/
http://downloads.linuxfromscratch.org/
Last checked against version 6.1.
The Vim package contains a configurable text editor built to enable efficient text editing.
Vim installs the following:
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
emacs, joe and nano
http://beyond.linuxfromscratch.org/view/cvs/postlfs/editors.html
Last checked against version 6.1.
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 reformats the error messages of the Perl interpreter for use with the quickfix mode of vim.
rview is a restricted version of view. No shell commands can be started and vim can't be suspended.
rvim is the restricted version of vim. No shell commands can be started and vim can't be suspended.
vimspell.sh is a script which spells a file and generates the syntax statements necessary to highlight in vim.
Last checked against version 6.0.
Bash: sh
Binutils: as, ld, strip
Diffutils: cmp, diff
Fileutils: chmod, cp, ln, mkdir, mv, rm, touch
Find: find
Gcc: cc1, collect2, cpp0, gcc
Grep: egrep, grep
Make: make
Net-tools: hostname
Sed: sed
Sh-utils: echo, expr, uname, whoami
Textutils: cat, tr, wc
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:
Last checked against version 1.1.4.
This is the zlib library, which is used by many programs for its compression and uncompression functions.