Tag Archives: BLFS

LFS 6.8 (Part 11): Tweaking and Backing Up the Temporary Toolchain

The LFS temporary toolchain is going to take a while to cover completely, so I’m breaking it up into several parts for readability.

There are a couple final things to do to the temporary toolchain that will get it into a form suitable for backup. Backups will be really nice to have if things go south later on, since I won’t have to rebuild the entire toolchain again.

Stripping

Stripping the temporary toolchain of debugging symbols is optional, but since my system is pretty space-constrained, I went ahead and did it. Debugging symbols are “unnecessary” according to the LFS book (presumably unnecessary for now because of the “temporary” part of “temporary toolchain”) My LFS partition was at 496,584kB (~485MB) before stripping, and was brought down to 339,992kB (~332MB) — a savings of more than twice the 70MB that the LFS book led me to expect!

Also, removing documentation can save more space, so I removed the temporary toolchain’s documentation for further space. Removing documentation brought my 339,992kB (~332MB) LFS partition down to 314,008k (~307MB). Not bad at all!

These steps leave me with nearly 7GB free on my LFS partition, which gives me plenty of room for building the rest of LFS, and possibly even BLFS.

Changing Ownership

Since I will be chrooting into a clean environment where there is no lfs user, the LFS book recommends changing ownership of all the files I’ve built thus far to root. This both enhances security (since no one can abuse those files who creates a user with the same ID as the now non-existent lfs user) and makes things nice and consistent for the next stages in building LFS.

Backing Up

After stripping and changing ownership of the files in the temporary toolchain to root, the LFS /tools partition is ready for backing up. As the LFS book says, “subsequent commands in chapter 6 will alter the tools currently in place, rendering them useless for future builds.” I took the hint.

The LFS book leaves the backup method to the ingenuity of the user. I used a tar command to compress the /tools directory into a .bz2 file and copy it to my future /home directory (and after that, I copied it to my USB drive).

All Done!

Well, the temporary toolchain is done; the rest is yet to come. Everything thus far should have built in 24 hours 28 minutes (i.e., just over a day), but actually took 30 hours 28 minutes. All those extra test suites did their damage.

[Note: Imagine at this point how glad I am to have a backup.]

I am now ready to build the LFS system!

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”.