Minority Opinions

Not everyone can be mainstream, after all.

Re-Installing Linux

leave a comment »

At the moment, my best video card is stuck in a machine with an operating system that I can no longer upgrade.  If I can get Pyglet to work on it, I just might be able to run Dandelion, the recent PyWeek winner.  I had considered wiping the whole machine, but it has some backups that I would rather not disturb, particularly given that some of them are from a laptop that no longer turns on.

That machine has three partitions: The operating system, swap space, and my home directory.  Unfortunately, that leaves no decent space to install a new operating system.  (Note to self: In the future, use five partitions.  Small /boot, two 10-20 GB roots, swap, and large /home.)  Fortunately, I had installed gcc before losing access to the package repositories, so I made the crazy decision to compile Linux From Scratch.  Again.

Yes, I have installed it before.  During my last year of college, I purchased an aging desktop and installed an old Red Hat system on it.  I had used Linux before, but hadn’t really learned it, and was extra-enthusiastic about customizations, so the LFS project caught my attention as a great way to jump in.  Once I had a minimal system, I started over, combining the package users hint with the Paco package manager hint, using group-based subdirectories in various places around the hierarchy, and writing scripts to automate builds as much as possible.  That system has been serving SSH, HTTP, SMTP, DNS, DAIDE, and SVN off and on for the last seven years, and continuously for the last 268 days.

In theory, I could use the scripts I developed from that, but Linux has moved on since then.  A new version of the LFS book is available, with (among other things) a completely new implementation of udev.  I have also determined that package groups are more annoying than helpful.  In fact, I’ve decided that the whole /usr split is more annoying than helpful; I’ve already encountered situations where a script expects a /bin program to be in /usr/bin, or vice versa.

So this time, I’m symlinking /bin, /sbin, and /lib directly to their /usr counterparts.  I’m also symlinking /usr/local directly to /usr, leaving me with only two places for all of my commands: /usr/bin and /usr/sbin.  I’m not even convinced that the second is necessary.  Granted, I’ve had to be a little careful with a few of the LFS commands; the /lib/cpp symlink in particular needed correction, and the bzip2 instructions remove a command that had just been installed, but for the most part it’s a matter of skipping lines that move files between /bin and /usr/bin.

The more interesting part of this run has been using git as a package manager.  Not the Guarded Installation Tool in the LFS hints, but the distributed version control system.  I’ve been using it on my home directory for almost a year now (Mercurial for three), so why not on a whole operating system?  Yes, it’s annoying that it ignores empty directories, directory permissions, user and group assignments, and device nodes, but it finds newly installed and modified files without resorting to timestamps, package users, or library preloading.  It noticed, for example, that the shadow package overwrites a pair of man pages; I’m still wondering which version is better.  It might even help me detect rootkits, and I get /etc version control for free.

If I do it again, though, I’m going to ignore /usr/share/locale and /usr/share/info; neither tree is very useful to me, locale files frequently overwhelm git status output, and /usr/share/info/dir is one of the top three most-modified files on the system.  Language-specific man pages could also be safely ignored.  That probably won’t bring /.git to significantly less than half the size of /usr, but it could help some.

Meanwhile, I’m off to compile the kernel, and probably a few extra packages, before attempting to boot into my /home partition.


Written by eswald

23 Oct 2012 at 6:35 pm

Posted in Linux, Technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s