My Workstation OS: Linux From Scratch

463

Author: Vinod Vijayarajan

Like nearly every other person who has contributed to this series, I have tinkered around with my share of Linux distributions. I happened on Linux From Scratch (LFS) about an year and a half ago. With LFS, my choices run deep into the system — into matters such as which shell to run, what feature of glibc to use, and how to tailor boot scripts. LFS 6.0, which is what I have built my system around, comes with gcc 3.4.1 (which is used to build everything else), a fairly recent CVS build of glibc 2.3.4 (which the LFS team provides for download), kernel 2.6.8.1, and udev.

LFS is a source-based distribution, and that detail alone nearly put me off it the first time around. My impression of typical source-based distros is that I’ll be sitting around twiddling my thumbs until the installer (downloads and) builds each package. During that time, I’ll have no system to work with, and except for the start when I specify some compiler options and the like, I have no further say in the process of building the system.

LFS was different. LFS is probably the only Linux distribution in which building the system is as much part of the experience as working on it. LFS must be built alongside an existing Linux distribution. This allows you flexibility in choosing the best compiler options for a particular package. It lets you research packages on the Net or elsewhere throughly before installing them. You can revert to your existing system if something goes awry. For a tinkerer such as I, this is manna. When I built my system, I happily spent hours looking around, selecting packages and options to use on my system. The whole procedure entails an unbeatable learning experience in that you actually watch your system grow from the basic toolchain to a desktop.

LFS is, in the strict definition of the term, not a distribution. It is rather a set of detailed and meticulously assembled instructions for building a custom Linux system. Laid out in order in a comprehensive book, the instructions describe each package that goes into your system, offer and suggest build options that can help you extract that little extra out of the package, and include patches that fix or enhance something in a package.

LFS does not bind you to a particular package set. You can choose to build a basic barebones system or a full-fledged desktop system. You can choose custom options for your particular hardware setup. This ability to customize your operating system helps you avoid the inevitable bloat and performance penalty that most available distributions suffer from, since they have to align their package set, options, and features to a lowest common denominator. In LFS, the lowest common denominator is you.

Given that you can squeeze the most from your hardware in LFS, it’s no surprise that a system built thusly is the fastest you can get running. GNOME, KDE, and even OpenOffice.org are perceptibly faster in load and execution than under other distros.

LFS, on its own, can help you build a barebones system suitable for some basic console-based work or a server system. For a workstation, however, you’ll need other pieces of software (system tools, libraries, languages, browsers, etc.) to fill out your system. That’s where Beyond Linux From Scratch comes in. BLFS is a comprehensive follow-through to LFS that outlines build procedures for X (you have a choice of XFree86 or Xorg), a staggering number of development libraries and languages (including Python), a choice of Web browsers, desktop environments (KDE 3.3.2, GNOME 2.8.x and XFCE4), a printing subsystem, and multimedia tools (Xine, MPlayer, and XMMS, among others). Formatted like LFS, BLFS fills the void that its parent may appear to suffer from in terms of workstation software.

You are not constrained to the package versions in the book, though I’d suggest you limit yourself to them until you get the hang of the build process. During install and after, you can use the procedures and order and dependency information outlined in the book to install later releases of packages.

If the book were not enough, the community around LFS has come up with several other helpful projects, including the Hints project (a treasure trove of tips you can use to enhance your LFS/BLFS setup), the Patches project (which collects and test patches for later revisions of LFS/BLFS packages), and the LFS Hackers list, which maintains notes on changes to build instructions for bleeding-edge package versions. There are other related projects too, such as Automated-LFS, which seeks to automate building some or most of the LFS system, and Hardened-LFS, which seeks to build a hardened LFS.

While the practical benefits of building and using an LFS system cannot be debated, the basic premise of its philosophy has unavoidable downsides. The biggest of these is the lack of a package management system. In LFS’s defense, it can be argued and even grudgingly admitted that a package management system is alien to its sphere and that several hints and tools in the Hints database attempt to provide this functionality. Further, several existing systems (such as RPM, APT, and pacman) can be configured to work in LFS. However, I do wish for some native package management system that would download package upgrades, build them with the customisations I have chosen for the previous version of the package, query me when it encounters unknown options, and finally install the upgrade.

With LFS, there may be times when you’re building your system that you wish you could just install and be done with it. But if you persist and allow yourself the time to tinker and tweak, you’ll find yourself learning and appreciating the pieces that go into constructing a Linux system. This knowledge will stand you in good stead if something breaks later, and the undertaking as a whole will make the subsequent experience of working on your system feel like riding on a finely tuned, well-greased, custom-made car.

Building an LFS/BLFS system may be a challenge. Working on one is as close to distro heaven as it gets.

What’s your desktop OS of choice? So far, we’ve heard from fans of FreeBSD,
Mepis
Linux
, Debian, Xandros, Slackware, Windows XP, Lycoris, SUSE Professional, NetBSD, Ubuntu, FreeDOS, Libranet, Mandrakelinux, Arch Linux, Mac OS X, Knoppix, Linspire, Gentoo, PCLinuxOS, Yoper, Fedora Core 3, Windows 2000 Professional, Damn Small Linux, VidaLinux, Kanotix, VectorLinux, Irix, and Scientific Linux.

Category:

  • Linux