This course will become read-only in the near future. Tell us at if that is a problem.

Build your book [May 9, 2012, 2:26 p.m.]

This task can be skipped. You can download the copy of the book I built here instead:


And in fact I recommend doing so if this step looks overwhelming. This step is a lot more challenging than some of the first ones you'll be taking.


Otherwise, the only thing you need to have pre-installed and working on your system is Java. You will also need this script:


The CLFS and CBLFS teams are always working hard on improvements, and the advantage to building the book for yourself is that you'll always have the most up-to-date possible information. Being on the cutting edge with most linux distributions is a double-edged sword, where you sacrifice stability in exchange for a more secure operating system with the latest bug fixes. However, since you'll be building this from scratch yourself and will be intimately familiar with the inner workings of your system, you are going to encounter a lot of instability anyway, and you'll be providing yourself with a great set of tools for dealing with that instability. So this is one of those rare instances where having your cake and eating it too is not only possible, but recommended.


I did say rare; before we begin, there is a very old saying on LFS mailing lists: FTBTBIG. That stands for "follow the book; the book is good". It's usually best with projects like this to do things the way they're layed out at least once. If you do it a couple more times, you'll understand it well, and once you understand it well, you'll be in a position to gain something with experimentation and customization.


Alright, enough chit-chat. If you're still reading this, then you'll want to know how to build your book. These instructions have two parts: building fop, and building the book itself.


Building FOP

If you are on a rare lucky system that has this utility, please continue on down to "Building the book".

Fop is (as far as I can tell, please let me know if I'm wrong) a no longer supported package that turns XML and an XSL stylesheet into a PDF document. The CLFS book uses this tool. It is also part of the XPontus package. You can read more acout XPontus on its CBLFS page,

  1. Download XPontus from here:
  2. Run XPontus with the following command:

    $ sh

    Note: any time I am using a monospace font separated out like that, I'm giving you code to put into a terminal or text editor. If I start the line with a dollar sign, it means you should be an ordinary user, and if I start with a hash mark, it means you should be the administrator (usually called "root"; I'll use "root" instead of "administrator" from here on out).
  3. In the wizard, install to any directory you like. I prefer /tmp/xpontus. We are not permanently installing this software; we are just borrowing the java .jar files it relies on.
  4. As root, make a directory at /usr/bin/classpath. You can use the following command:

    # mkdir -pv /usr/bin/classpath

    You'll notice I used the "v" flag. The CLFS book uses that flag, which is short for "verbose", a lot. Normally when a shell command executes correctly the output is... nothing at all. Asking for output gives us a lot more information about what is going on, and is an especially good habit for writing installer shell scripts. The reason why the default behavior is no output, is because any output at all can interfere with other programs that use or "wrap" other shell utilities and programs. But we LFSers are taking on the role of that "other software" and our human eyes will be the only ones seeing that output. Since CLFS uses this convention, I will too.
  5. Copy all the jars that XPontus uses to your classpath folder. You can do this as root (substitute out the directory you installed XPontus to) with

    # XPONTUSDIR=/tmp/xpontus
    # cp -v $XPONTUSDIR/lib/*.jar /usr/lib/classpath

  6. Next, download the script above. Rename it to "fop", give it executable access, and add it to your path. You can do all that with this one liner (replace DOWNLOADFOLDER with your download folder)

    # DOWNLOADFOLDER=/home/sean/Downloads
    # install -v -m755 $DOWNLOADFOLDER/ /usr/bin/fop

That's it. You can test fop by simply running the command "fop". If you get useage information, it installed correctly.


Building the book

  1. Check out a fresh copy of the CLFS book from git:

    $ git clone git://
    $ cd cross-lfs/BOOK

  2. Make a new copy of the book. You can save time by picking your own architecture, but for now we'll build all of them to be safe:

    $ make pdf

It takes a few minutes, but when you're done, it will show up in cross-lfs/render/pdf. Just open up the book for your architecture in your favorite PDF reader.


Thanks go to for providing me with hosting