Tuesday, January 11, 2011

Crux vs Arch Linux

I had been hunting around for a really good minimalist distro, that remains true to the roots of Linux. I had tried slackware and its clones and found Slackware to be quite good but I didn't like it lacking in new software - it was a bit too old for my taste.

Anyone who has done serious distro hunting would have heard of Crux linux and Arch linux. Crux is a source based distro, which you build over a binary install (the basic install is binary). Arch linux is binary but gives you the option of building packages from source using the excellent ABS (Arch Build System).

When I talk of source based distros, you might be tempted to ask about Gentoo, Sorcerer and Onebase. I tried Gentoo, but I found it unnecessarily complicated (atleast as compared with Crux and Arch). Gentoo's build system is nearly flawless and wise usage of useflags gives a very responsive system. I honestly didn't like the way some configuration files were kept - for example, to enable wireless, I can't just put the configuration in /etc/wpa_supplicant.conf, I had to change something elsewhere ( http://bit.ly/dkxdxO ). I know that this kind of setup in Gentoo is only to enable auto connection to wireless, but I didn't like it. I want no hand-holding and I will setup scripts for the things I need. So Gentoo was not for me.

Sorcerer and Onebase are also source-based distros, but I hate the terminology they use viz., spells, cast, grimour and some other crap. That really put me off from reading their documentation. I didn't find them improving in any way over Gentoo, so adieu to them.

When I installed Arch linux and Crux linux on my Acer eMachines netbook, I loved them! Both are truly minimal. They do no hand-holding. More so with Crux. Crux forces you to compile your own kernel and to build a decent kernel, I had to read "Linux Kernel in a Nutshell" by Greg Kroah-Hartmann but it really was worth the effort. I got to understand exactly how to locate device drivers and how to know the names of device drivers that were not even detected by my kernel. I find that Crux is really a great distro for someone who wants to know the internals of Linux.

Since Crux is a fully source-based distro and Arch is not, Crux is marginally faster.

Here is a rough break-down comparing the two on my eMachines.
Both distros are fully functional desktops (No! No KDE/Gnome - I hate them). I have firefox, X running on Openbox/Fluxbox, mplayer for videos, adobe flash etc. Basically all the stuff I use my desktop for.

(Time is in seconds)
Crux boot time: 15.38
Disk Usage: 1.4 GB (1466056 1K-Blocks)
Firefox startup time: 4.44
List of installed packages: 239
Connecting to wireless network: 6.75
Shutdown time: 10.78

Arch with default kernel
Arch boot time: 19
Disk Usage: 1.5 GB (1481760 1K-Blocks)
Firefox startup time: 5.65
List of installed packages: 291
Connecting to wireless network: 10.37
Shutdown time: 13.75

Arch with compiled kernel (using the same config as Crux)
Arch boot time: 17.90
Firefox startup time: 5.75
Connecting to wireless network: 11.10
Shutdown time: 12.00

As can be seen, Arch is almost as fast as Crux with just the compiled kernel. If I compile only the stuff I need instead of compiling everything, Arch would just be a few milliseconds behind Crux. So is a source-based distro that much different from a binary one? That mostly depends on what you like. I think Arch gives us best of both worlds. You get a vast binary repository, from where you can install any program you want pretty quickly in contrast with compiling it from source. In-case the program is resource hungry, one may use the ABS to build it from source. Both distros keep the built packages in the ports tree (or abs directory), from where you may create a repository for machines with the same hardware (useful for large-scale deployments). Both also give very good roll-back options.

When comparing both Arch and Crux, I find Arch's package management to be much neater compared to Crux. In Crux, I have to install prt-utils to clean up the ports tree and other maintenance jobs. Each job is done by a different program. In Arch, all the work you might need to get done with a package is covered under an option in pacman. Building packages from source in Crux is not that slow though. An entire system upgrade takes about 4-6 hours, which is pretty decent.

I found kernel compilation to be very fast with Crux (probably because of a compiled gcc etc.). Building the kernel with ABS needed some work-arounds, but worked.

Overall, I find both to be really good. Currently I am using Crux on my eMachines, mostly because I am developing some small patches for the Linux kernel and trying to understand its workings; and I find the builds to be really fast. Using these distros is a lease of fresh breath in the world of bloat (Fedora, Ubuntu, SuSE et al).

1 comment:

  1. thanks mohammad! very informative, might give crux a try!