LWN.net Logo

Linux From Scratch and Beyond

The Linux From Scratch Project has been around for quite a while. So most readers are already aware that this project teaches people about how Linux works and how it can help you build a customized system. But if you haven't looked at it lately, you may not be aware of all that it has to offer these days.

Linux From Scratch (LFS) provides a book of instructions for building a system. The stable version of this book is currently at version 6.1.1 and it covers everything you need to know about building a minimal Linux system, from creating a new partition for your system to making your system bootable. The development version of the book is available through Subversion and the second pre-release has been announced.

Once you have a system, you can use Beyond Linux From Scratch (BLFS) to help you flesh it out. This book covers things like adding software and setting up networking, with a look at servers and several chapters on desktop software.

Suppose that you've built your system before. You know what you want and how to go about it. Then you're ready for Automated Linux From Scratch, (ALFS) a project that creates the generic framework for an extendable system builder and package installer. The current implementation of ALFS is nALFS, a C program that parses an XML profile that contains information concerning the LFS build process into a series of internal commands. It can then execute these at your discretion, automating the compilation of LFS. Recently a new implementation of ALFS called jhalfs has announced its 1.0 release.

Cross Linux From Scratch (CLFS) teaches you how to make a cross-compiler and the necessary tools, to build a basic system on a different architecture. For example you would be able to build a Sparc toolchain on an x86 machine, and utilize that toolchain to build a Linux system from source code. Currently supported architectures include x86, x86_64, sparc, mips, powerpc and alpha.

For the security conscious Hardened Linux From Scratch (HLFS) is a project that provides you with step-by-step instructions for building your own customized and hardened Linux system entirely from source.

Of course there's the Linux From Scratch LiveCD project. The LFS Live CD is geared toward providing a reliable host system for building your LFS system and doubles as a rescue system.

All these projects are represented in the wiki pages as well as from the main LFS site. So if the available Linux distributions aren't providing quite what you want, or you just want to know more about Linux internals, LSF could be just what you are looking for.


(Log in to post comments)

Linux From Scratch and Beyond

Posted Jul 27, 2006 7:04 UTC (Thu) by dune73 (subscriber, #17225) [Link]

nice sumup. I used to be tempted by LFS for a while. Now seeing all these opportunities...

Linux From Scratch and Beyond

Posted Jul 27, 2006 10:39 UTC (Thu) by Jaffa (guest, #4327) [Link]

I used LFS to create the bootstrap for WIMP OS[1] which is the start of an attempt to create a Linux-kernel-using operating system inspired by Acorn's RISC OS[2] using lots of relocatable ROX AppDirs and, in future Zero Install etc.

At the moment it's only something you can chroot into, but it should be *almost* bootable.

LFS made it relatively straight forward, though. Having said that, it's worrying the number of little patches that the LFS instructions say need applying to the upstream source: why aren't they included upstream already?

Cheers,

Andrew

[1] http://www.bleb.org/software/wimpos/
[2] http://www.osnews.com/story.php?news_id=15098

Linux From Scratch and Beyond

Posted Jul 30, 2006 5:36 UTC (Sun) by nlucas (subscriber, #33793) [Link]

    ... it's worrying the number of little patches that the LFS instructions say need applying to the upstream source: why aren't they included upstream already?

Most probably are, but usually not on the same version (they are applied to a latter version which becomes stable after the book was "frozen"), and for every version change they would need to check if the rest of the system would work with that new version.

By providing patches they can maintain the same book version and use and test the new versions on the unstable version of the book.

I'm not particulary in favor of their aproach, but they probably know better...

Linux From Scratch and Beyond

Posted Aug 3, 2006 0:11 UTC (Thu) by dbnichol (subscriber, #39622) [Link]

The number of patches used in LFS is often far less than that used in many of the big distros. For instance, see the number of patches used in the LFS coreutils build vs. Fedora's coreutils build: 3 vs. ~20.

http://www.linuxfromscratch.org/lfs/view/6.2/chapter06/co...
http://cvs.fedora.redhat.com/viewcvs/devel/coreutils/

An important thing to remember is that it is actually a very difficult task to get an entire system working together. The reason that these fixes aren't included upstream are varied, but often times they are system specific. Sometimes these patches _are_ backported from upstream.

Also, a lot of the patches used in LFS are specific to the fact that you are bootstrapping one system from another. Many of the tools are not meant to be built in this way, and special care needs to be taken to assure that the host does not influence your final system.

Try it out sometime. It's very addicting once you've got all the power in your hands.

Dan

Linux From Scratch and Beyond

Posted Jul 27, 2006 10:40 UTC (Thu) by debacle (subscriber, #7114) [Link]

Don't forget Debian From Scratch (DFS)!

Linux From Scratch and Beyond

Posted Jul 30, 2006 4:51 UTC (Sun) by dberkholz (subscriber, #23346) [Link]

Don't forget Gentoo. It even has package management! =P

Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds