Linux From Scratch

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Linux From Scratch (LFS) is a type of a Linux installation and the name of a book written by Gerard Beekmans among others. In that book the reader is given instructions on how to build a Linux system from source. The book is available freely from the Linux From Scratch website and is currently in version 6.4.[1]

To keep LFS small and focused, the book Beyond Linux From Scratch (BLFS) was created which presents instructions on how to further develop the basic Linux system that was created in LFS. It introduces and guides the reader through additions to the system including networking, X, sound, printer and scanner support. Current Stable release of Beyond Linux From Scratch is 6.3 and was released on August 28 2007. Since Release 5.0, the BLFS book version matches the LFS book version.[2]

In addition to LFS and BLFS books Cross Linux from Scratch describes cross compiling and Hardened Linux From Scratch focuses on security enhancements like use of Stack-smashing protection, PaX and Address space layout randomization using grsecurity. Cross Linux from Scratch provides the necessary instructions to build a base, command line only Linux distribution. While LFS is limited to the x86 architecture, CLFS supports a broader range of processors. CLFS addresses advanced techniques not included in the LFS book such as cross-build toolchains, multilibrary support (32 & 64-bit libraries side-by-side), and alternative hardware architectures such as x86-64, Itanium, SPARC, MIPS, and DEC Alpha. Hardened Linux From Scratch focuses on creating a more secure version of the original Linux From Scratch as its main purpose, including embedded systems.

Linux From Scratch is a way to install a working Linux system by building all components of it manually. This is, naturally, a longer process than installing a pre-compiled Linux distribution. According to the Linux From Scratch website, the advantages to this method are a compact, flexible and secure system and the process leads to a greater understanding of the internal workings of the Linux OS. [1]

Contents

[edit] Requirements and procedure

A clean partition and a working Linux system with a compiler and some essential software libraries are required to build LFS. Instead of installing from an existing Linux system, one can also use a Live CD (e.g., the Linux From Scratch Live CD). The LFS Live CD contains all the source packages (in the full version of the Live CD only), the LFS book, automated building tools and (except for the minimal Live CD version) an Xfce GUI environment to work in.

First a toolchain must be compiled consisting of the tools used to compile LFS like GCC, glibc, binutils and other necessary utilities. Then the root directory must be changed (using chroot) to the toolchain's partition to start building the final system. One of the first packages to compile is glibc; after that, the toolchain's linker must be adjusted to link against the newly built glibc, so that all other packages that will make up the finished system can be linked against it as well. During the chroot phase, bash's hashing feature is turned off and the temporary toolchain's bin directory moved to the end of PATH. This way the newly compiled programs come first in PATH and the new system builds on its own new components.

[edit] List of LFS software

This is a list of the packages included in LFS version 6.4:

This is a list of the packages included in CLFS version 1.1.0. Unless otherwise noted, this list is applicable to all supported architectures.

[edit] Standard build unit

A "standard build unit" ("SBU") is a term used during initial bootstrapping of the system, and represents the amount of time required to build the first package in LFS on a given computer. Its creation was prompted by the long length of time required to build an LFS system, and the desire of many of users to know how long a source tarball will take to build ahead of time.

As of Linux from Scratch version 6.3, the first package built by the user is GNU binutils. When building it, users are encouraged to time that build process using shell constructs and dub that time that system's "standard build unit". Once this number is known, an estimate of the time required to build later packages is expressed relative to the known SBU.

Several packages built during compilation take much longer to build than binutils, including the GNU C library (rated at 9.5 SBUs). The unit is not a concrete description, and must be interpreted as an approximation; many various and unrelated factors influence the wall-clock time that a package requires to build.


[edit] External links

[edit] References

  1. ^ Gerard Beekmans: Linux from Scratch (Iuniverse Inc, Dec 2000) ISBN-10: 0595137652 ISBN-13: 978-0595137657
  2. ^ Gerard Beekmans: Beyond Linux From Scratch, Version 6.3 (August 2008)
  1. "LFS Project Homepage". Linux From Scratch. Gerard Beekmans. 2008-03-17. http://www.linuxfromscratch.org/lfs/. Retrieved on 2008-03-17. 
Personal tools