Due to spam comments are moderated and will only appear after approval.

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.

Labels

12.04 LTS (1) 1280x1024 (2) 14.1 (1) absolute (3) accessibility (6) administration (1) afterstep (1) android (1) announcements (12) anonymity (3) anonymous (1) antiX (2) applications (1) arch (9) archbang (11) archone (1) authentication (1) backports (1) bash (2) bittorrent (2) bodhi (1) books (1) browsers (5) browsing (1) bsd (2) bug (2) bugs (3) calculate (1) centos (1) certification (1) chakra (2) chatzilla (1) chromium (2) click (1) commodore 64 (1) crunchbang (5) crux (1) ctkarch (1) debian (20) desktop (55) digital certificates (1) distributions (71) documentaries (1) documentation (2) drivers (1) e17 (1) encryption (1) enlightenment (1) events (1) fake (1) fedora (6) firefox (3) flash (1) flush (1) fluxbox (6) fluxflux (1) FPS (2) free software (2) frugalware (1) FSF (1) fusion (1) fvwm (1) fvwm-crystal (1) games (10) gaming (8) gentoo (2) gnome (8) gnome shell (4) gnu/linux (3) google-chrome (2) graphics (1) grml (1) hardcore punk (1) hardware (3) how-to (21) humor (1) icewm (3) interview (1) introduction (1) jibbed (1) jwm (1) kanotix (2) kde (17) kde3 (2) kernel (5) knoppix (1) kongoni (2) kubuntu (1) LAS (1) libtorrent-rasterbar (1) linux (17) linux light (12) live (40) live medium (12) live system (7) lxde (12) lxqt (1) mageia (1) mandriva (1) marine life (1) mate (1) media center (4) mepis (2) mint (2) mobile (2) movies (5) mozilla (3) music (1) netbook (2) networking (2) news (2) open source (1) openbox (13) openSUSE (2) opinion (12) other (5) overclockix (1) packages (1) pclinuxos (2) perl (1) poll (2) porteus (3) privacy (3) privoxy (1) programming (1) proxy (2) puppy (3) qbittorrent (1) qt (1) quick look (10) ratpoison (1) red hat (6) relax (1) release (1) reviews (48) rhythmbox (1) RPG (2) sabayon (5) salix (15) scientific (7) screenshots (2) scripts (3) security (1) semplice (1) server (3) shell (1) shooter (4) siduction (1) slackel (1) slackware (46) slackware-current (7) slax (7) slitaz (1) smart phones (2) sms (1) south africa (2) specialist (1) spoof (1) surfing (1) table mountain (1) TDE (1) themes (1) tinyme (1) tips (1) tor (2) torrenting (1) torrents (1) traffic analysis (1) trinity (2) trisquel (1) ubuntu (4) unity (2) unity linux (3) unix (1) upgrade (5) vector (2) video (3) vinux (2) virtualbsd (1) visual impairment (5) wallpapers (3) window maker (4) window managers (1) wireless (10) xfce (13) youtube (1) zenwalk (3) zoo (1)