LFS 6.8 (Part 5): Version Checks and Final Preparations

Continuing my LFS adventures, it is time to check that the base system (in this case, the LFS 6.3-r2160 live CD) has the necessary tools for successfully compiling LFS.

There is a handy version check bash script on page xviii of the LFS book that I ran. I typed it in by hand, but it was satisfying work because I learned some interesting text processing tidbits in the process. It turns out that everything on the live CD is the exact version that LFS 6.8 requires, except that grep is version 2.5.1, but the book lists the minimum required version as 2.5.1a — hopefully everything will work anyway.

Next, I set up the $LFS variable in bash. The $LFS variable is important because it is used throughout the book (trust me, I’ve looked) while building and installing LFS. I haven’t deviated from the book yet, so I was able to type in all the commands verbatim.

Then I created the $LFS/tools directory, which I will use while I build the temporary toolchain. Then I created a /tools symlink on the live CD / (root directory) — this means the toolchain will install its files to /mnt/lfs/tools (aka $LFS/tools), even though thanks to the symlink, they think they installed them in /tools. That way, when the first toolchain is completed and ready to build the second (clean) toolchain, and I have to chroot into $LFS, the toolchain can still look at /tools and find everything it needs.

Next, I followed the instructions for creating a new user — lfs — and setting up a known-good bash environment. I then used the source command to enter into my newly created bash environment: spartan, but effective.

Finally, the LFS book addresses SBUs (Standard Build Units) and test suites before beginning the first toolchain. SBUs are a rough measure of how long a particular package will take to compile. Skipping ahead some, my SBU is 49 minutes and 5 seconds, a far cry from the 3-odd minutes of the “fastest” systems the LFS book speaks of. The book also recommends skipping the test suites that are usually run on the first toolchain, since they offer near-zero benefit at this point.

I am now ready to build the first LFS toolchain. Onward, ho!

LFS 6.8 (Part 4): Partitioning

After getting Pressie ready for building LFS, my next step was to fire her up with the LFS live CD and partition her hard drives.

The LFS live CD required me to choose some basic settings like locale, system time, and console settings as it booted up. Though I still have a one-hour-off clock, the other (default) live CD settings seem to be working fine.

First off, I used cfdisk (a very simple partitioning tool with an ncurses interface) to partition my disks. Soon I’d set up my disks how I wanted them (after I realized that IDE hard drives are at /dev/hdn, not like modern SATA hard drives at /dev/sdn):

  • One large / (root) partition on the main 8.4GB hard disk
  • Two partitions on the secondary 2.1GB hard disk
    • a 1GB /home partition
    • a 1.1GB swap partition (to try to offset the tiny amount of RAM

I was going to have a separate /boot partition as recommended in the LFS book, but decided against it for simplicity’s sake — I doubt I’ll use multiple Linux distros on Pressie at the same time.

Next, I used mke2fs to format / and /home as ext3, and mkswap to make a swap partition. After that, I mounted the new ext3 and swap partitions — success!

I plugged in a USB thumbdrive loaded with the LFS sources and patches, then copied them to the main 8.4GB drive. I unplugged my thumbdrive and plugged in a mouse (just in case).

So far so good!

LFS 6.8 (Part 3): Introducing Pressie

During the four-odd months I took to read the LFS 6.8 book, I was still searching for hardware to actually build LFS with.

Originally, I was going to use a really, really old hard drive I had lying around — a roughly 1998 vintage 2.1GB Seagate ST32122A — and plug that into Limited Edition for the duration of the build. 2.1GB is a little underpowered (some packages need nearly a gigabyte for compilation), but that’s what I had.

Fortuitously, I acquired an old Compaq Presario this summer! Dubbed Pressie, she was made circa 2003, and was passed down from my uncle to my brother-in-law to my brother to me.

Pressie Ready For Action

Isn't she beautiful?

Pressie is pretty impressive for her age, sporting an AMD K6-2 450MHz CPU (a very odd processor, the K6-2), 376MB of RAM (upgraded from the stock 64MB), an 8.4GB hard drive (also up from the stock 4.3GB), a ZIP100 drive, an ORB drive, a working floppy drive, two USB 1 (or 1.1) ports, very nice integrated SIS graphics and SoundBlaster-compatible sound — and most important of all, she’s still working! Pressie is practically a computer history lesson, and it’s a real trip through memory lane examining her innards. I stole her ZIP and ORB drives for Limited Edition, replaced the broken CD-ROM drive with some slightly less-broken drives laying around, and grafted in the old Seagate.

With her spacious 8.4GB hard drive, I’ll have more than enough room to do LFS, and maybe even BLFS. After setting her up in the basement at work, with a spare monitor and other borrowed parts, I’m ready to start work on my first LFS build!

LFS 6.8 (Part 2): Downloading Source and Patches

Continuing on my LFS journey, one of the first things I did was to download the source and patches I would need to get the ball rolling. Fortunately, there is a way to download the seventy-odd packages automagically. Enter this command on your terminal:

wget -i http://www.linuxfromscratch.org/lfs/view/stable/wget-list -P lfs-dl/

This will fetch the current stable LFS version’s list of package download locations, then download all the packages listed there to a directory of your choice (in my case, to the directory lfs-dl). If you want packages for any particular version of LFS, substitute the desired version number (e.g., “6.8”) for “stable” in the URL. Kudos once again to the LFS authors for making things extremely easy!

Depending on your connection, you should soon have a directory of roughly 285MB of sources and patches, together with a copy of the list itself for reference. Simple, eh?

Note: I did this step out of order from the LFS book instructions, as I have been working on getting all the necessary parts for a dedicated LFS near-retrocomputer for nearly as long as I’ve been reading the book.

LFS 6.8 (Part 1): The Linux From Scratch Book

I have been fascinated by the idea of building my own Linux system for years: I was browsing through some old files of mine when I found Linux From Scratch resources I’d downloaded in February 2005! Now in 2011, I am finally taking the plunge and building my own LFS.

To my mind, making my own LFS system is a logical step in the process of learning how to program — I need to understand my tools, if for no other reason than to understand what wheels don’t need reinventing. Before jumping into things, I read the official LFS book entirely through and learned two core lessons:

  1. Linux is very easy to homebrew (conceptually, at least): build a preliminary toolkit, then use that to build the main toolkit, then build your own distro from the main toolkit.
  2. Linux was very hard to understand (conceptually, at least) until I read the LFS book: “Linux” is really not at all like the monolithic Win32 base I used for over a decade! Rather, the Linux “operating system” is a collection of simple tools, which can perform complex tasks when used together.

It took more than four months to finish it, but the LFS book was far and away some of the finest technical documentation I have ever read. The authors of the LFS book went out of their way to fully explain even tedious and potentially “obvious” things, and I have a much stronger grasp of what the most essential Linux tools are (hint: bash!) thanks to their labors.

I am also amazed by how many core tools hail from the GNU project — I wonder if anyone from GNU ever sleeps.

I hope to learn much by doing, and will be writing about my progress as I go along. I am only planning on making the LFS build at this point, but I may also progress to BLFS in order to get more experience with the X windowing system, which has baffled me utterly from day one. Happy hacking!

Bonus: My favorite quote of the book: “false [d]oes nothing, unsuccessfully”.

Goodbye For Now

It is probably obvious from my posting schedule that I’ve been unable to keep up a regular posting schedule for the past few months. This has been for numerous reasons, both large and small, but the general effect has been that my time for even trying to write quality content is pretty much gone.

Therefore, I am going on an extended hiatus. I want to spend my time and effort on things that are going to actually advance my skills, not just my writing portfolio. Farewell, Interwebs! May we meet again someday on better terms.

Installing Crunchbang 10 Statler r20110105 on Piggybacker

Crunchbang Statler on Piggybacker

Crunchbang Statler on Piggybacker

Well, as much as I’ve been loving Crunchbang 9.04.01 on Piggybacker, I’ve been hankering to work with a Debian-based distro for a while. (I plan to migrate Limited Edition over to Aptosid, or maybe vanilla Debian + KDE4 with Sid repositories, and I want to have at least some practice with Debian before then.) So, upon hearing of a new release of Crunchbang Statler that was at a pretty usable point, I downloaded the ISO and got to installing it.

Statler’s install screens are pretty self-explanatory, and the install process took about half an hour, which is pretty good time considering that everything is written to a crotchety and uber-slow CF card. The only real bump in the install process was when I forgot to explicitly tell Crunchbang to use my swap partition, so it of course didn’t use it (apparently I’m already too used to automation!). I took the easy way out and just reinstalled rather than fiddling with /etc/fstab.

After booting into my new Statler install (with a working swap partition this time 😛 ), a startup script popped up to help with the inevitable post-install customizations. Among other things, it allows you to enhance your default install with OpenOffice.org, Java runtime libraries, the Liquorix/Zen kernel (a more bleeding-edge and potentially better kernel, but I’ve not noticed a difference), XFCE side-by-side with Openbox, printer support, and development tools. It is a really nice touch that I would absolutely love to see in other distributions (especially the option to install OpenOffice.org).

I immediately took to Statler’s default theme, mostly because it is much easier to read in bright conditions (like near a window) than the 9.04.01 theme. The scrollbars are way harder to see, but that’s why we have keyboard shorcuts, right? Also, I’m not really a fan of Chrome, so I installed Iceweasel (a.k.a. Firefox).

I only had minor annoyances with the install, like having to manually alter some shortcuts and having some applications (including Firefox) not showing up in the main menu, but the Alt-F2 shortcut is keeping me happy in the meantime. Overall, Statler seems much more polished and visually appealing than 9.04.01, and it has proven very stable and workable as my mobile workstation.