Essential Pre-Reading Hint

AUTHOR: Richard A Downing FBCS CITP <TheOldFellow at gmail dot com>
DATE: 2005-03-18
LICENSE: Creative Commons - Attribution-NonCommercial-ShareAlike 2.0


Essential pre-reading for life with LFS.


This hint is a list of good documents that you can get for free on the Internet, together with some advice from me and my friends. It will help you get 'educated' to a level where you can:
  • successfully build Linux from Scratch (LFS)
  • ask sensible questions on the LFS mailing lists and understand the replies.
  • stay sane while doing all this.


Just the ability to switch on the computer and access the Internet, navigate to the LFS website and find the hint. The rest is our topic...


Please Note:

This will always be a 'work in progress' and I'm missing a good reference on some stuff. So, if you know of, or find a good one, please write to me. Also I just like feedback, so it never hurts to send an email.

The LFS book says:

"This book assumes that its reader has a good deal of knowledge about using and installing Linux software."

The book then suggests some further reading, including this document. But this is more than just an LFS reading list, we expect you to do some exercises too.

Part 1. Social stuff. (Most important)

Many people ask questions badly on the LFS mailing lists. Sometimes they get rude replies. To stay sane, I suggest you read the entertaining How To Ask Questions The Smart Way by Eric Steven Raymond.

Please note that all the LFS mailing lists expect:
  • plain text email. No HTML.
  • bottom posting. Add your bit UNDERNEATH the bit you quoted.
  • pruned quotes. Don't quote everything, just the significant bit.
  • no cross-posts. Just use the right list.
  • thick skins. Don't respond to rudeness, just ignore it.
  • zazen. (Just Sitting) If others have a flame-war, just sit and watch.

Before asking questions on LFS lists, please search the archives, at least the recent months, and please read The LFS FAQ. Read the latest copy online, not some old thing you downloaded last week.

If you ask a question that is in the FAQ, you are being extremely rude, not least to the maintainer who does that job out of the goodness of their heart. So you rightly WILL get flamed.

Special note: If someone tells you to RTFM, they are not, repeat NOT, being rude or getting at you. This is the accepted phrase indicating that you need to Read The Friendly Manual. If you have previously been told that a certain Old Low Dutch word is referred to by the 'F', please be assured that this is just a myth :-)

Part 2. Technical stuff.

Many people attempt to build LFS without sufficient understanding or experience with LINUX. Here is an excerpt from the tar manual:

"You should understand something about how Unix-type operating systems work, and you should know how to use some basic utilities. For example, you should know how to create, list, copy, rename, edit, and delete files and directories; how to change between directories; and how to figure out where you are in the filesystem. You should have some basic understanding of directory structure and how files are named according to which directory they are in. You should understand concepts such as standard output and standard input, what various definitions of the term "argument" mean, the differences between relative and absolute path names"

In the LFS book, it says:

"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. Get a modern distro and play with it."

The Base Distro

Choosing a distro is only hard because of the choice, my advice is to choose an inexpensive one because once you have learned a bit and then built LFS you will junk it ('inexpensive' here might also mean 'quick to download'). I got mine free with a magazine. However it may help to look at Linux On-Line's Distributions page or The DistroWatch site.

Learning to use UNIX

Unlike Windows, Unix requires you to understand what you are doing to get anything much out of it. Both Windows and Unix require deep understanding to get the best out of them. If you are coming from a Windows background or are new to computing in general then reading The UNIX and Internet Fundamentals HOWTO is very basic and will help.

There used to be a rather good document called 'The Linux User's Guide' on the internet, but this is now no longer available for download. So I now recommend Introduction to Linux - A Hands on Guide.

Also, Linux Installation and Getting Started , yes, is very dated, but is still good and worth a read.
The Shell

If you have read those, then you are aware that we drive Unix though a shell, which provides the command line interface. The shell we use in LFS, as in most of the Linux world, is bash (The Bourne Again Shell). You need to be fluent in using bash, and The Advanced Bash Scripting Guide is a good tutorial. (Yes, I know it says 'Advanced', but read it anyway, do you want to be a newbie forever?)

Becoming an apprentice guru

Then there are two books that you ought to have available from or on your box for easy reference, skim read them now so you know how to use them:

The Linux Systems Adminstrator's Guide

The Linux Network Administrator's Guide, Second Edition

I recommend that you put bookmarks to these in your browser, so that you can get to them quickly. It will save lots of time later.

On Building from Source

Having got yourself a LINUX system, and played a bit, you now will know a little about the subject, but before moving on to the building of Linux from Scratch you should learn how to build packages from source code. This is an area where it's hard to find good references. The LFS book suggests Building and Installing Software Packages for Linux and Autoconf, Automake, and Libtool is good too, if a little advanced.

It's very important that you have some experience installing a package from source on your distro before attempting LFS.

One good choice would be GNU-Emacs. Here's what to do:
  • check out it's homepage
  • download a source distribution as a gzipped tar file
  • unpack the source with tar and gunzip
  • read the README file
  • read the INSTALL file
  • build it from scratch

In doing this you will not only learn how to obtain and build a package from scratch, you'll also prove that you have installed the right tools for your distribution.

If you want a real challenge, try MPlayer. This package is a good test of your developing skills, as you will need to track down and install all it's dependencies first. (You could also cheat and look at the Beyond Linux From Scratch book for a hint.)

IBM, once Big Bad Blue, is now a great supporter of OpenSource and Linux. They have some free tutorials on their developerWorks website.

Like most Large Multi-nationals, IBM change their site around regularly, so any link I give to the tutorials may not be valid any more. Follow links to Technical Library and Tutorials though, and you should find:
  • Compiling and installing software from sources
  • Compiling the Linux kernel
  • Using regular expressions

but there are rich pickings here, even for the experienced.


One area where even seasoned UNIX veterans seem to have trouble is with setting up the bootstrap for the new LFS system. Often these problems come from not reading the available documents.

Most people will be building for an X86 platform. Before LFS-5.0 we used Lilo as our recommended BootLoader, from LFS-5.0 we use GRUB. There is little to choose between the two, and they are not the only choices either. However, it is important to take time to familiarise yourself with the bootloader that you plan to use.

Check out the homepages for the bootloader (lilo's is not very impressive):

And the various HOWTO's, not all will be relevant for you:

If you are building for a non-X86 platform you will have to research your own bootloader, try a google for whatever bootstrap is used by your base distro, but these links may help:

But the most important thing you can do is to read the man and info pages for the bootloader. A print (on paper) of the error codes can be very helpful (as the online docs will not be available just when you need this info), and it is vital that you have an alternative means of booting your system before testing your new bootloader.

Part 3. Other stuff.

My starting point for any query or gap in my knowledge is google, yours should be too. Go to the Google page, and hit the advanced search button. Learn the full capabilities of this essential tool, spend at least a whole day on this. Truely, you can't live without it.

Note that if US English isn't your native tongue, then google has many national versions. I use Google UK, as I'm English, and find this version more colourful.

There is a whole heap of documentation at the Linux Documentation Project, some of which I've quoted above. Learn to go there regularly and just poke about, it's a great storehouse of knowledge. Beware though a lot of it is out of date.

You might want to find some other software for your Linux box. The place to search is: Freshmeat

LFS has it's own search system on the website. You can use it to find answers to obscure questions that others have asked in the distant past, as well as 'where is' type inquiries. Look on the LFS website homepage.

And finally, whatever you read or don't read concerning LFS, before asking questions, start by reading the FAQ. FAQ stands for 'Frequently Asked Questions'. We don't want to answer them again, so don't ask them. Read The LFS FAQ

ACKNOWLEDGEMENTS: I have received encouragement and advice from the following, but the words are my fault alone: Dagmar D'Surreal, Tushar Teredesai, Ken Dyke, James Robertson, Eric Miller, and lots of others on lfs-chat. But nothing would have been done at all without the LFS project that Gerard Beekmans started: Linux from Scratch