CRUX installation cheatsheet

Since the last couple of months, I’ve been taking an interest in CRUX. I used this Linux distribution some 10 years ago and I really liked how the system was organized. It has a very nice handbook, which is a must during the installation. I decided to simply collect all steps I took in a “cheatsheet”, very similar to what can be already found in their wiki, as “Quick Install Reference”.

At the moment, CRUX is at version 3.6.1, but I downloaded the unofficial updated iso image (27-Jun-2021). Upon boot, the first thing I needed to do was to set my keyboard layout. I have a Finnish keyboard, so let’s specify this:

loadkeys fi

Do disk partitioning if needed:

cfdisk

My disk is /dev/sda, and I want to have a /boot partition on sda1 and / on sda2, formatted as ext2 and xfs, respectively:

mkfs.ext2 /dev/sda1
mkfs.xfs /dev/sda2 -f

Mount the root partition:

mount /dev/sda2 /mnt

Then mount the boot partition:

mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

I will have swap on sda3:

mkswap /dev/sda3
swapon /dev/sda3

Now it’s time to do the actual installation. Start the setup script:

setup

During install, I selected all packages from core, opt and xorg categories. After packages installation is complete, it’s time to configure the system. First, chroot into it by running:

setup-chroot

Create root password:

passwd

Set up /etc/fstab:

nano /etc/fstab

Among the provided examples I set my partitions:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>     <type>    <options>                        <dump> <pass>
/dev/sda3              swap      swap      defaults                         0      0
/dev/sda2              /         xfs       defaults                         1      1
/dev/sda1              /boot     ext2      defaults                         1      2
#/dev/#EXT4FS_ROOT#    /         ext4      defaults                         0      1
#/dev/#BTRFS_ROOT#     /         btrfs     defaults                         0      0
#/dev/#XFS_ROOT#       /         xfs       defaults                         0      0
#/dev/#F2FS_ROOT#      /         f2fs      defaults                         0      0
#/dev/#SWAP#           swap      swap      defaults                         0      0
#/dev/#EXT4FS_HOME#    /home     ext4      defaults                         0      2
#/dev/#BTRFS_HOME#     /home     btrfs     defaults                         0      0
#/dev/#XFS_HOME#       /home     xfs       defaults                         0      0
#/dev/#F2FS_HOME#      /home     f2fs      defaults                         0      0
#/dev/cdrom            /cdrom    iso9660   ro,user,noauto,unhide            0      0
#/dev/dvd              /dvd      udf       ro,user,noauto,unhide            0      0
#/dev/floppy/0         /floppy   vfat      user,noauto,unhide               0      0
#tmp                   /tmp      tmpfs     defaults                         0      0
#usb                   /proc/bus/usb usbfs defaults                         0      0

# the following entries are required for proper system operation
devpts                 /dev/pts  devpts    noexec,nosuid,gid=tty,mode=0620  0      0
shm                    /dev/shm  tmpfs     defaults                         0      0

# End of file

Services startup and other configuration is done in a single file, which is quite explanatory:

nano /etc/rc.conf

Generate locales:

localedef -i en_US -f UTF-8 en_US.UTF-8

Edit hosts as necessary:

nano /etc/hosts

Compile a kernel. Yep, CRUX leaves this to you. What I do is use the provided .config file to build a very “basic” kernel, then reboot and use a config file from Slackware to build a full featured kernel. However, for now just go to the kernel source:

cd /usr/src/linux-5.10.32

And follow the basic steps for kernel configuration and installation, making sure the root filesystem module is built into the kernel:

make oldconfig
make menuconfig
make -j8 all
make modules_install
cp arch/x86/boot/bzImage /boot/vmlinuz
cp System.map /boot

Configure the bootloader. I use LILO, so:

nano /etc/lilo.conf

The /etc/lilo.conf file that comes by default is rather basic, but it will do for now:

#
# /etc/lilo.conf: lilo(8) configuration, see lilo.conf(5)
#
lba32
install=text
boot=/dev/sda
image=/boot/vmlinuz
        label=CRUX
        read-only
        append="root=/dev/sda2"

# End of file

Install lilo:

lilo -v

If there are no errors, reboot. That’s all for now, I will make a separate post about what configurations to do next.


One Comment on “CRUX installation cheatsheet”

  1. […] I am going to outline a few steps to do immediately after install for my future […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s