Friday 21 December 2012

CRUX 2.8 Review - The Inspiration Behind Arch Linux

This one is well overdue, but the time has finally come. In my defence, I installed CRUX 2.7.1 as far back as summer, but a hard drive failure wiped it all, and since then 2.8 was released. Just as well, so we'll be testing the latest version 2.8. CRUX is a DIY distribution that is perhaps less known than others, but it is the inspiration behind the mighty Arch Linux as the distribution Judd Vinet was originally using. I would point to this dated interview if you want to know more about the origins of Arch.

The intro on the main page states that "CRUX is a lightweight, i686-optimized Linux distribution targeted at experienced users", and I would suggest to take this seriously. It's unlike installing Linux MInt or Fedora, it's not even like installing a modified Gentoo, more somewhere between Gentoo or Linux from Scratch and Slackware, with the latter being the easy one. Like most advanced distributions CRUX aims at keeping it simple, adhering to the KISS philospohy. For that it uses a straightforward tar.gz-based package system and BSD-style initscripts, again similar to Slackware and Arch for example. The system is configured through manually editing text files. The main repository as small and provides few packages, but users have access to a ports system which suposedly "makes it easy to install and upgrade applications". We'll see how that works, but personally I think this sounds great. If you like something with a similar outlook to Slackware, perhaps a bit more rolling but not quite as much as Arch and not foisting systemd on you just yet, with a BSD-style ports tree then this could be for you. Actually, a lot of the more advanced Linux distributions seem to be modelling themselves on the BSD's in this respect. It's basically a repository with source code that compiles for your machine at install time.

Part 1 - Installation

CRUX 2.8 was released 24/10/2012, and as ever the official build is i686 32-bit only, but the download page also offers contributed images for the x86_64 architecture. Release notes for RC1 of the already upcoming 3.0 suggest x86_64 will be an official build from now on, or the distribution will switch its main supported architecture. Both have been processed with isohybrid and can be extracted for booting from a USB drive or Flash key etc. Other architectures like ARM, PowerPC and Sparc64 are unofficially supported. I went with the official build for maximum compatibility for which the iso file is 266.3 MB in size. Not a lot, it downloads at a good rate in mere minutes, with many local mirrors accessible from the main page. Of course you'll only get a basic system for that which comprises the install base and the ports tree. It's up to the user to shape the system and that means it can be anything you like. I noticed that on Distrowatch CRUX is classed as server, but, being a vanilla distribution, it can be anything you build, from server to desktop. Follow me to see what it's like.


 
On first boot we are presented with a screen to choose from several options, some useful if your hardware is problematic or you just want to log into the console for some maintenance, otherwise the default entry will do us. After hitting Enter, the usual boot messages scroll by. Some of it in nice color, mind you.


Once finished we are autologged in to the root account. Type 'setup' to proceed and we get a nice little welcome screen which reminds to take a look at the CRUX installation guide before we continue. If you haven't, you really should look at the relevant sections in the handbook. The script will then guide through the rest of the routine, and all in all the steps are very similar to installing Arch.


One potential trap is that if you don't partition the disk and assign mount points before continuing, the text based installer will still go ahead and install packages into the ether, there's no warning about missing mount points or swap partition etc. So type 'cfdisk' and carve up your partitions, then mount them as guided. Essentially you're doing a lot of work manually that in other distributions the installer takes care of in the background, like setting 'swapon'. Now that you're ready you can enter 'setup' for real and progress to installing packages. You get a choice which sets -I chose all three, including Xorg- and after asking you to confirm whether you want to pick every package or just go with the whole subset another prompt finally will install everything to disk. The whole thing barely takes 5 minutes. Once installed, the 'setup' script displays an installation log and will let you know in CAPITAL letters if the install routine was successfull. The nice thing here is that everything is on the CD image and can be installed without network access, no netinstall required, and additional packages can be added from there.

These were only the first steps on the long road to lightweight bliss as now it's time to compile the kernel. Yes indeed, it is more involved than Slackware or Arch. The latest kernel source on the iso image is 3.5.4 and as it is a quite up to date distribution you'll probably have to compile another one once finished, but for now we need a kernel to be able to run in the first place.
I won't go into configuring the kernel here, but readers could check out my post on this subject earlier in the year, or one of these two posts on kernelnewbies.org or one of the many other guides. The CRUX handbook also outlines the basic steps which is probably all you'll need if you've done this before and just need a reminder what to type, but it won't tell you what to select in the configuration steps and which modules and settings your hardware requires to run effectively, so I'ld recommend you know your machine in and out before attempting this. By default the CRUX kernel configuration is extremely slim, in line with the basic and light approach taken, and a default compile results in a kernel of only 1.2 MB. It won't make use of your TV card though.

Aaah, made a mistake, again.
Commands to enter a chroot environment to build are provided as well in the guide, or you can just enter 'setup-chroot' which will do it for you. Enter a password and check or edit important configuration files, again very much like Arch Linux if you have used it before, generate locales and then compile the kernel. After your new kernel is installed it's time to add it to the boot loader and to see if all went well. The system comes with Lilo by default. You may use Grub of course, installation steps are further down in the document, i.e. here.

For further help, you may want to look at Compiling your kernel during 2.7 installation, or at this guide with plenty nice screenshots. Somebody's also uploaded  a video tutorial on kernel compilation in CRUX.

Part 2 - Day to Day Usage

If all went well and Xorg was selected at install time you will get something like this. Not too inviting, but it's a start. We can build the system up from here. Unless of course you only wanted the console anyway.


Before we can install more packages we'll need to connect to and update the ports tree. There's a fair bit of jumping to do in the handbook. As you're most likely using dhcp to acquire a network address but the default service script in /etc/rc.d/net doesn't reflect this, you'll want to configure your network with the script for dhcpcd as shown there in the second box. A simple matter of deleting and retyping some lines. Restart your network or reboot. It's also a good idea to enable the contrib repository in your local prt-get.conf configuration. We're well on the road now to finally getting the latest ports database, and this can be updated with 'ports -u'. Again, refer to the handbook for ports and for package management.

You can list all ports with the -l option or grep for the package you want. This shows that openbox is in opt, but obconf is in the contrib section, so you can't take anything for granted here. The main repos above have a fair amount of packages but none of the bigger desktop environments, Fluxbox and Openbox is what you get. The CRUX website has a ports page with a long list of additional, private repositories where you can also find KDE 4 and Xfce. It's up to you whether you trust them to update your machine from, and the usual disclaimers when using other people's sources apply. Check Building ports as unprivileged user (with fakeroot).

After updating the list of available packages you'll want to install some more stuff to make it usable. I opted for Openbox. prt-get is the utility that actually downloads and compiles software, but trying to add obconf resulted in a dependency error stating that startup-notification was needed first. Not to worry, CRUX supports dependency resolution as long as they're in the repositories and 'prt-get depinst obconf' got me there, bringing in libglade as well. prt-get seems to be the easy option to have it all automated and installed. The other one would be to use 'pkgmk -d' to download the source and build, then use 'pkgadd package#version.pkg.tar.gz'. I built a couple more packages like mplayer which worked well and compiled all codecs using the depinst switch. 'prt-get sysup' updates the entire base install except the kernel and thus replaces the precompiled binaries that were first installed with packages compiled for your machine bit by bit, pun intended. The kernel is not actually installed as a package and is thus not in the database, leaving you free to update separately at your own leisure.

Repositories are fairly limited but as this is a bare bones Linux distribution completely compiled from source it is not difficult to add anything that is missing. Instructions on how to create packages with your own Pkgfile are, as ever, in the handbook. Or you may want to do it the old fashioned way or use src2pkg. The latest images for 2.8 seem to come with the 3.6 kernel instead of 3.5.4. This means the distribution is updated often and it should not be difficult for the experienced user to add anything s/he wants.

Conclusion

At this point I ended my adventure with CRUX until possibly another day. It's a neat little distribution that can give you that raw linux feel of the old days and where the system is yours to shape from the ground up. Needless to say, it's very fast. If that's what you want and you have the time for building it, that's great. You'll need to add everything, from enabling it to mount external USB drives to whatever else you want it to perform. The constant compile time is not to be taken lightly, but it will heat your room in winter.

I really like CRUX, the way it integrates building from ports and dependency resolution without third party unofficial tools, but I prefer starting from a slightly higher level with a more complete system. It appears to be a niche project with only a small core of longer-term users and developers that have settled on it. The documentation is probably all you'll ever need and is updated for every release although most of it is just a straight copy from the previous one if nothing's changed. A basic wiki is accessible from the project's site and forum and IRC channel are available.

Another nice guide to getting started with CRUX by AgentOSS.
12.04 LTS (1) 1280x1024 (2) 14.1 (1) absolute (6) accessibility (6) ad-blocking (2) administration (2) afterstep (1) android (3) announcements (15) anonymity (5) anonymous (1) anonymous browsing (1) anti-malware (1) anti-virus (1) antiX (4) applications (1) arch (11) archbang (11) archone (1) artix (2) authentication (1) backports (1) base (1) bash (2) bittorrent (2) block-this (1) bluestar (1) bodhi (1) books (1) brave (1) brave-browser (1) browsers (8) browsing (1) bsd (4) bug (2) bugs (3) calculate (1) centos (1) certification (1) chakra (2) changelog (22) chat (1) chatzilla (1) chromebook (1) chromium (2) click (1) commodore 64 (1) ControlD (1) critique (1) crunchbang (5) crux (1) ctkarch (1) cyber war (1) debian (29) desktop (62) devuan (6) digital certificates (1) digital memories (1) distributions (75) DNS (1) documentaries (1) documentation (2) dr. web (1) drivers (1) duo (1) e17 (1) email (1) encryption (3) enlightenment (1) events (1) exit nodes (1) ext4 (1) fake (1) fallout (1) fallout 4 (1) fedora (6) file server (2) file systems (1) firefox (3) flash (1) flush (1) fluxbox (7) fluxflux (1) FPS (2) free software (3) frugalware (1) FSF (1) ftp (2) furybsd (1) fusion (1) fvwm (1) fvwm-crystal (1) games (11) gaming (10) gentoo (3) gnome (9) gnome shell (4) gnu/linux (4) google (2) google-chrome (3) graphics (1) grml (1) gtk+ (1) hangouts (1) hardcore punk (1) hardware (3) how-to (23) humor (2) i3 (1) icewm (6) init (3) init freedom (5) interview (1) introduction (1) jibbed (1) jwm (2) kanotix (4) kde (21) KDE neon (1) kde3 (2) kernel (6) knoppix (1) kodi (2) kongoni (2) kubuntu (3) LAS (1) libtorrent-rasterbar (1) linux (20) linux light (16) Linux Mint (6) live (50) live medium (28) live system (13) liveslak (3) LMDE 4 (3) localisation (1) LTS (1) lxde (12) lxqt (1) mageia (1) mandriva (2) manjaro (1) marine life (1) mate (1) media center (6) mepis (2) mint (5) mobile (2) mobile security (1) movies (6) mozilla (3) music (1) MX Linux (1) netbook (2) netrunner (1) networking (5) news (3) nvidia (1) open source (1) openbox (15) openSUSE (4) opinion (13) other (5) overclockix (1) packages (1) pclinuxos (4) perl (1) plasma (5) poll (2) porteus (3) privacy (5) privoxy (1) programming (1) proxy (2) puppy (3) qbittorrent (1) qt (1) quick look (10) ratpoison (1) red hat (7) redcore linux (1) relax (1) release (2) rescue (3) reviews (57) rhythmbox (1) rolling (1) RPG (2) rpm (1) sabayon (5) salix (15) scientific (7) screenshots (2) scripts (3) seamonkey (1) security (4) semplice (1) server (5) shell (1) shooter (4) siduction (1) slackel (1) slackware (68) slackware 14.2 (2) slackware 15.0 (8) slackware-current (34) slax (7) slitaz (1) smart phones (2) sms (1) south africa (2) specialist (1) spoof (1) ssh (1) surfing (1) systemd (2) table mountain (1) TDE (1) tegra k1 (1) The Walking Dead (1) themes (1) tinyme (2) tips (1) tor (3) torrenting (1) torrents (1) traffic analysis (2) trinity (2) trisquel (1) TV shows (2) TWD (1) ubuntu (6) unity (2) unity linux (4) unix (1) upgrade (6) vector (2) video (4) vinux (2) virtualbsd (1) visual impairment (5) voip (1) vpn (5) VSIDO (1) wallpapers (3) window maker (4) window managers (1) windscribe (1) wireless (10) xfce (16) youtube (1) zenwalk (3) zombies (1) zoo (1)