IN-DEPTH Linux From Scratch
LINUX FROM SCRATCH
Aaron Peters examines building a distro from the ground up with Linux From Scratch, because why take the easy way?
Part One
Don’t miss next issue – subscribe on page 14!
O
ne of the great things about Linux, and open source in general, is the ability to leverage the work of others in order to make something better. Or at least better for you. Today’s Linux distributions do exactly that, assembling individual upstream projects such as the Linux kernel, GNU utilities and applications into a cohesive operating system that’s easy to install and use.
Of course, you can always customise a Linux distro by adding packages, exercise features and applications as desired. But the Linux From Scratch (www. linuxfromscratch.org) project (hereafter also written as LFS) takes a different tact. LFS enables you to build a Linux distribution from the ground up.
PUT YOUR STAMP ON A DISTRO
“The Linux From Scratch is a fantastic way to learn how Linux works at a very basic level”
Sound fun? Well it is, but it’s also a fair amount of work. There are many modern conveniences that will be missing, because you’ll be building everything by yourself from source code and configuration files. The good news is that if you’re someone who’s willing to “read the manual," and you can follow instructions, you too can build a Linux system and gain an understanding of how distribution developers assemble these systems today. And you’ll learn a lot along the way.
There are a few things you’ll require in order to get started with LFS. The first is a compatible Linux system to act as the “host," or the system that provides the tools to get the first parts of LFS built. The second is the “target” system, or where LFS will be installed and boot from. Finally, you need the LFS book, which can be downloaded from the project’s website.
Why from scratch?
A natural question to ask at this point is, “Why on earth would someone want to build Linux from scratch when so many great distributions exist?” There are two primary reasons. The first is that the LFS exercise is a fantastic way to learn how Linux works at a very basic level. Modern distributions do a lot of hand-holding, from convenient administration scripts to built-in hardware detection to package systems with automatic dependency resolution. All these make it easy to forget how intricate all these moving pieces are. So working though an LFS build will not simply bestow knowledge about how they work, but will give you a better background to troubleshoot issues on your regular distro.