Dolce Far Niente

Getting to the CRUX of it: Notes on a Great Exploration

CRUX is a lightweight Linux distribution for the x86-64 architecture targeted at experienced Linux users. The primary focus of this distribution is keep it simple, which is reflected in a straightforward tar.gz-based package system, BSD-style initscripts, and a relatively small collection of trimmed packages. The secondary focus is utilization of new Linux features and recent tools and libraries. CRUX also has a ports system which makes it easy to install and upgrade applications.

The handbook of CRUX be found at:

https://crux.nu/Main/Handbook3-8

I recommend you check it out on a regular basis.

Unless stated otherwise all installation steps are performed by the root account. Obviously all steps are based on my hardware and preferences. Your mileage will vary.

Installation notes

Download a recent crux-3.8 iso from:

https://crux.ninja/updated-iso/

These are technically unsupported but usually contain either no changes aside from package updates, or minor functionality changes to the kernel or similar. It saves you time later on in the system update.

Boot into the iso and at the (root) prompt type:

Check the name of your disk with:

Open cfdisk and partition the disks:

Create the filesystems:

Be aware that I'm using xfs here. This has an implication for the kernel compilation config later on. If you use ext4 here, you don't need to change flags in your kernel config later on. Ext4 is the default in there.

Mount the filesystems:

Doublecheck the setup with lsblk.

Installation:

The first steps are self-explanatory, just follow and answer them.

Select the following package collections:

We are going to start out the Slackware way, install everything, so we can't miss anything ;-)

Select bootloader:

Chroot into the new system:

Create root password:

Edit fstab:

Setup rc.conf:

Create locale:

Edit the hosts file:

Configuring the kernel:

The easy config:

Options to change:

Then:

Check the created .config file for the changes above. Remember these options should be adjusted to your setup!

Prepare kernel compilation:

Run that first compile:

Then:

Install grub and reboot:

Subsequently:

Post Installation

Ports live in /usr/ports and are organized by collection. Each port is a directory containing a Pkgfile (basically a shell script that downloads, builds and packages sofware).
We now have the Core, Opt and Xorg collections earmarked for the system, but there are more unoffical ports collections that can be found at:

https://crux.ninja/portdb/

There's also a large collection of ports available in Contrib, but it is disabled by default.
Port management is done throught prt-get, so let's first enable Contrib:

Download all activated ports onto the system:

Let's install mc (Midnight Commander) and make our life a bit easier by using prt-get (a package mgmnt frontend for Crux):

By using 'depinst' dependencies will be downloaded and installed as well. You could of course also go to:

In both cases it is wise to edit /etc/pkgmk.conf and enable parallel processing by uncommenting:

Let's add a regular user:

I install opendoas later and add the regular user to /etc/doas.conf.

Kernel update

One of our chores is compiling and updating the kernel on a regular basis. This is how I do it:

After that follow the instructions above for kernel compilation and grub-mkconfig.
Over time you can start removing older kernels, but I'd always keep one 'old' working kernel as a fallback.

Additional ports

The basic ports provided in Xorg, Core, Opt and Contrib are already a pretty big collection. But the fun is of course in adding and enabling 3rd party ports databases. As mentioned before you can find a lot of them @ https://crux.ninja/portdb/.

As always I urge you to check out the related repo's before enabling them. Some I found were pretty old and seemed almost unmaintained; others deliver the latest and greatest. It is your personal choice and responsability, but let me show you how to enable a 3rd party repo.

In this example I'll enable the Portastrophe repo, which provides a great collection of stuff. I've known Jay (the maintainer) for a couple of years now, and he's become a trusted source of great software for me.

First download the necessary files:

Move the downloaded files to the proper folder:

Create the dir where the ports will be contained:

Add the specific ports line in your /etc/prt-get.conf to fetch the repo:

Update the repo onto your computer:

You can now install things like niri, noctalia, fuzzel and ghostty onto CRUX!

Final steps

During installation some optional dependencies might not have been installed. That feature is being worked on as we speak, but it is recommended to rebuild all locally installed packages after you've finished your base install with a command like this:

This will ensure all ports are recompiled and any optional depends are picked up along the way.
If you only installed the "core" ports when initially installing CRUX, this may be a required step.

Later on we will use this to update our system:

Now you're good to go to use CRUX and build your own system ;-)


Shoutout for inspiration and tips to:

Jay Lanagan @ https://lngn.net/
Tony Banters @ https://tonybtw.com/


Feel free to use these builds and dots as you like. I do not, however, imply any form of support or ongoing maintenance.

And of course, you use them entirely at your own risk. Have fun!

#crux #linux #thoughts #writing