On Sunday afternoon I started transferring files off my laptop (artemis) and onto my desktop (zephyr) ready to replace the former’s Arch Linux installation with CRUX, a source-based GNU/Linux distribution that inspired the creation of Arch. Five and a half days later yesterday afternoon, and the installation and setup are complete, with only a few things not quite working, which are set up as tasks to do later once I’ve settled into the new OS a little more. I think I’ve probably put in about fifty hours, throwing all else aside, and the result can be summarised as this document, where I wrote everything down, and my repository of CRUX ports for all the software I had to package up for CRUX, which I’ll put up online and have added to the CRUX ports database soon.
A few thoughts on why it has taken so long. First of all I spent a great deal of time figuring out how I was going to encrypt the drive, which is important on a laptop. In order to speed things up CRUX doesn’t use an initrd which means that it’s impossible to encrypt absolutely everything, so either you slow things down by working in an initrd, or don’t encrypt quite everything; I took the latter approach, but it took me a while to figure out how I could make this feasible. The resulting solution is elegant and simple and essentially as secure as my setup before; they suffered from the same weakness of having unencrypted code on the drive that could be tampered with by an attacker. Once I got this sorted out the rest of the time was spent, aside from waiting for files to copy and for software to compile, packaging up all my software, for a surprising amount of it isn’t available for CRUX. Oh and there were plenty of existent packages to fix as well. It’s quite poor just how many CRUX ports are broken. But this was a one-time thing, essentially, aside from software updates from time to time which aren’t too hard.
Yesterday evening I wiped the family 256MB Celeron and installed Linux Mint LXDE to try and get some use out of it, because once I have Emacs installed with a few utilities, I can get on with things, and this of course is a lot easier than installing software on CRUX. Apt rumbles into action, does layer after layer of auto-configuration and everything Just Works; I sat there wondering just a little why I don’t just use this. Except the version of Emacs that comes with Mint is too old, so then you have to figure out how to upgrade the package, but there are actually about three packages and a metapackage that interact and the Emacs addons like BBDB keep in sync with these in (too) clever ways so paradoxically, until you realise what’s going on, you can’t remove one version of Emacs without it trying to install an older version in its place and vice-versa and urgh, it’s so complicated once you try and do something even remotely different. But CRUX’s package management and in fact everything about it is so simple, that you don’t have to spend long understanding it before you can just apply your general Unix knowledge to make it do what you want it to. It requires a lot more knowledge, but not that much more effort.
I wasn’t feeling so positive a few days ago about all this, when I’d got almost everything in place except classic GNU/Linux unexplainables like X11 font rendering, and (still unfixed) ACPI nonsense and laptop-mode. I was wondering if I’d ever get these things fixed at all, if I’d ever get my setup back to what I am used to, and starting to question the amount of time I’d poured into this project. Was I really going to get something worthwhile out of it? What if I couldn’t get it right, gave up and went back to my old setup—think of how much time I would have wasted! This is all wrong though. Firstly I have learnt so very much over the past week about how a GNU/Linux system is constructed. As you move from distributions that do more for you, such as Debian, to distributions that do less, such as Arch, and then down to the bare minimum like CRUX, more and more of the system makes sense and stops being a mysterious black box. Right now I don’t know much about init, and of course the clever things the kernel does on the inside are always going to beyond this lowly math/phil with no knowledge of computer science, but I get how little you actually need in order to boot the rest of the OS. It’s all just a bunch of bash scripts. I definitely couldn’t have completed this installation without my prior experience of Arch.
Secondly, I’ve now switched distros while carrying my entire environment with me enough times to know that I am capable of fixing pretty much everything eventually, and what I can’t fix I’ll get used to. Switching from Debian to Arch was dramatic in the sense that I suddenly had to get little things in place all over, and Arch to CRUX was the same. X11 font rendering is a good example: Arch has patches in place to make things look non-rubbish, and I was anxious to achieve the same thing, but CRUX gives you nothing with the standard packages and I was left with forum thread after forum thread (Arch forums that is; there is almost no information out there on CRUX). I’m not quite there and things are still weird: for example I have noticed that my browser’s interface now uses a sans-serif font whereas I was very used to it using a serif before, but I got over the major hurdle in that things are not rubbish, and after that I realised that anything else doesn’t actually matter and I was getting worked up for the sake of it. During my Arch install I was far less comfortable without my knowledge gained through experience that I will get there in the end. The other thing I’ve learnt is that once this stuff is set up, I forget about it. So even if my setup is slightly messy in that some of the packages I have written don’t install as neatly as I would like, I won’t care once I go back to my normal computing of working away in Emacs and reading away in Conkeror (web browser). And even if it’s messier than Arch or Debian because it’s less automated, it’s just that I’m aware of the mess because I made it; I don’t doubt there is plenty of mess to be blamed on Arch and Debian devs too.
If this is the case the natural question to ask is whether I’ve gained any benefits at all from this aside from what I learnt from building the system up. In a non-minimalist hipster way, the elegance of CRUX’s simplicity is worth having for itself, and for the ease with which you can extend it sensibly. What I mean by this is that if I want to install something new and not just slap it in but have it as a package so that I can repeat that install automatically in the future, I can do that far more easily than I could with Debian or even Arch. When it’s time to upgrade the system, I can do that without too many headaches over things no longer working together, because the tools for upgrading and merging configuration files are simple and elegant. CRUX has no dependency resolution by default and not much of a central software repository; these seem like they will give you more work, but once you get into it, the effort required to maintain an elegant system you can recreate when needed is far smaller than it would be with other distros, which is important. A lack of features but once you get the package together it’s brilliantly slick. Aside from waiting around for things to compile but I can live with that.
I haven’t expressed that very well nor have I expressed how cool CRUX’s simplicity is in this post in general, but that is perhaps because it pales in comparison to the main non-educational thing I’ve gained from this project, and that is blazing speed. When artemis and zephyr had near-identical installs of Arch, zephyr out-paced the laptop by a good way because it’s faster, has a better video card, and is a desktop (I maintain that laptops are Just Slower), so I was rather surprised to find that with CRUX installed, artemis is actually beating, rather than just coming closer to, zephyr, on basic things that matter such as booting, firing up X, opening and closing Emacs, opening and closing my mail client etc.. Sure, zephyr will still encode MP3s faster, but the snappiness I’ve gained makes computing a lot pleasanter. My laptop no longer feels like a slowish machine, which it shouldn’t considering its very reasonable hardware. Now of course I shudder to think just how fast zephyr is going to be when I switch it from Arch to CRUX too. As a more standard machine, since laptops are always a bit special, I can probably pare the kernel down even more.
And of course this is not just about gaining speed—you might say, just buy a faster machine. Given the general trend of operating systems towards being more bloated, buying faster and faster machines doesn’t make your basic computing any faster any more, nor is it really a very good idea for environmental reasons. But setting up a CRUX system or something similar really does speed things up in a very meaningful way. I suspect the biggest factor is stripping so much out of the kernel, rather than the distribution being source-based, but I don’t really know what’s doing it.
That’s a lot of poor prose about what I’ve been doing for the past week or so; mildly annoyed I haven’t managed to explain it better. The other thing I wanted to note down was a few thoughts on my new Facebook account. I’ve only logged on once since I created it on Monday, and that was the following morning to approve a few friend requests, and I suppose I shall have to do the same at some point for the others that have come in. TheFriendMail is working well for giving me a daily copy of my newsfeed but the HTML doesn’t render well in Gnus and I end up struggling to tell when something is a comment on a status or whatever, since everything seems to be commentable on nowadays. However I can scan for important things so it’s serving its purpose.
In the time that I did spend on Facebook I’ve been impressed with the slick new interface, which has changed a lot (I suspect multiple times) since I last actively used Facebook. It really is impressive what people can construct inside browsers nowadays, even if it’s going to always be to a certain degree inelegant for being within a browser without really being a webpage. It feels like a distressingly cohesive and well thought-out interface for converting social lives into the Facebook Ideal of a social life. Glad to be staying away from actually getting involved in very much, but wanted to note that it looks like they’ve got things sorted, even if I don’t like their attitude towards some of the features.