Packages on the official CRUX ISO image are compiled with optimization for x86-64 (AMD Athlon 64, Intel Core, Intel Atom) or newer processors. Do not try to install it on an i686 (Pentium-Pro, Celeron, Pentium-III) or lower processor, since it simply will not work.
A minimum of 2GB system memory is required to install CRUX from a DVD or removable flash drive. It is possible to perform a custom chroot installation with a smaller amount of RAM.
The kernel used during installation, i.e. when booting from the CRUX ISO image (El Torito), is compiled with support for most disk controllers. If your hard disk is not recognized after booting from the ISO image (i.e., the output of lsblk
only shows the CRUX media), you might find a solution in the CRUX wiki, the mailing lists, or the bug tracker. You could also ask for help on the CRUX IRC channels. For example, the owner of a low-power machine that uses a board soldered memory card as its main disk was able to install CRUX successfully after building an ISO with kernel customized to enable CONFIG_X86_INTEL_LPSS
.
Download the CRUX ISO image (crux-3.8.iso). To ensure that the download was successful, examine its checksum.
$ shasum -a 256 crux-3.8.iso
Compare the output with the file crux-3.8.sha256, which can be found in the same directory as the ISO image on the download site. If the checksums match, the download was successful and you can continue by burning the ISO image to a DVD or writing it to a removable flash drive.
The ISO image is bootable. After making sure that your BIOS gives priority to optical drives or flash drives, just insert the newly-written DVD or removable flash drive and reboot your computer. Press Enter
at the boot prompt (you might have to adjust the root=
parameter, depending on your hardware configuration). You will be logged in as root on tty1 (root has no password set).
If performing a clean installation, create (if necessary) and format the partition(s) you want CRUX to be installed on. You can skip this step when performing an upgrade. Remember the choice you make for the filesystems (especially root)! The driver for your chosen filesystem must be compiled into your Linux kernel, or included on an initramfs.
$ fdisk /dev/sd? $ mkfs.???? /dev/sd?? $ mkswap /dev/sd??
Note
The amount of disk space required depends on how many packages are selected to install. It is recommended to have at least a 5G root partition (CRUX will use about 500MB-1GB, depending on whether you create separate partition for /usr, and other decisions you make in the setup process).
The amount of swap space required depends on several factors, including whether you intend to use hibernation or build new packages in RAM. For more information about how memory is handled by modern Linux kernels, please refer to In Defense of Swap.
Note: UEFI
Note: MBR
CRUX supports all the filesystems supported as root filesystems by the Linux kernel: btrfs, ext2, ext3, ext4, JFS, reiserfs and XFS. Further, it is highly recommended to separate the system data from user data, i.e. use a separate partition for /home (and possibly /var) since that will make your life a lot easier the day you want to upgrade, reinstall or remove your system.
Note
Note
$ mount /dev/sd?? /mnt
$ mkdir /mnt/var $ mount /dev/sd?? /mnt/var
$ swapon /dev/sd??
Note: initramfs
Note: UEFI
Note: Upgrading an existing CRUX installation
After the packages have finished installing, the setup script will display an installation log. Make sure the last line in the log says “0 error(s)”
.
If you missed or forgot to install certain packages, you can just mount the CRUX installation medium and use pkgadd to install them.
Now it's time to compile your kernel and do basic system configuration. The kernel compilation requires that you “chroot” into your new CRUX installation.
Note
$ mount --bind /dev /mnt/dev $ mount --bind /tmp /mnt/tmp $ mount --bind /run /mnt/run $ mount -t proc proc /mnt/proc $ mount -t sysfs none /mnt/sys $ mount -t devpts -o noexec,nosuid,gid=tty,mode=0620 devpts /mnt/dev/pts (UEFI only) $ mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars $ chroot /mnt /bin/bash
Set the root password. (Not needed if upgrading from a previous CRUX installation)
$ passwd
Edit /etc/fstab to configure your filesystem(s). Editors vim and nano are available. The fstab installed by the setup script includes the most commonly-used mountpoints (commented out, of course), which can be used as a reference when customizing fstab for your partition scheme.
# dev> mountpoint> type> options> dump> pass> [..] devpts /dev/pts devpts noexec,nosuid,gid=tty,mode=0620 0 0
Note
Note
$ cd /usr/src/linux-6.12.23 $ make mrproper && make clean $ make menuconfig $ make all $ make modules_install $ cp arch/x86/boot/bzImage /boot/vmlinuz-6.12.23 $ cp System.map /boot
Note
cp
commands to copy the kernel into a more appropriate location, e.g., the subdirectory EFI/BOOT under the mountpoint of the EFI system partition. The SYSLINUX bootloader on UEFI systems will also require a different location for the saved kernel; see SYSLINUX, in UEFI boot mode for the proper cp
commands.
Note
kernel that can tell you the exact set of modules needed for your particular hardware, or if you find it too
daunting to navigate through the interface of the make menuconfig
step. You can find this file, config-6.12.23-modular, under /crux/kernel/contrib on the installation media.
Unless you compiled your kernel to provide an EFI stub and have UEFI boot mode enabled in your BIOS, you will want to install a bootloader on your hard disk. Simple instructions are provided below for four distinct combinations of bootloader and BIOS setting. You are advised to choose one of the following options based on how your BIOS is configured and on how much you value “do-it-yourself” config files. The EFI stub option is presented in the Appendix, if you find it simpler to modify EFI variables rather than configuration files.
Note
Note
Option 1: GRUB, in UEFI boot mode:
Option 2: GRUB, in legacy (non-UEFI) boot mode:
grub-mkconfig
's output can be altered by setting variables in a configuration file, /etc/default/grub. This file is NOT created by default and is not required, but is useful for customizing the video resolution and grub menu colors without crafting a grub.cfg by hand. For more information, see the GRUB manual at http://www.gnu.org/software/grub/manual/.
Option 3: SYSLINUX, in UEFI boot mode:
$ mkdir -p /boot/efi/EFI/BOOT $ cd /boot/efi/EFI/BOOT $ cp /usr/src/linux-6.6.62/arch/x86/boot/bzImage vmlinuz-6.6.62 $ cp /usr/share/syslinux/efi64/ldlinux.e64 . $ cp /usr/share/syslinux/efi64/syslinux.efi BOOTX64.EFI $ cat <<EOF > syslinux.cfg DEFAULT CRUX-3.8 PROMPT 1 TIMEOUT 10 LABEL CRUX-3.8 SAY "Now booting into CRUX" KERNEL vmlinuz-6.6.62 APPEND root=/dev/sda2 rw quiet # End of config file EOF
efibootmgr
.
mkdir
and cd
commands accordingly (UEFI itself is completely agnostic about mountpoints specified in /etc/fstab).
cp
command from the kernel building step is not applicable when SYSLINUX is installed on the EFI mountpoint /boot/efi, and a different target directory appears in the cp
commands above.
Option 4: SYSLINUX, in legacy (non-UEFI) boot mode:
$ mkdir /boot/syslinux $ cd /boot/syslinux $ cp /usr/share/syslinux/ldlinux.c32 . $ extlinux --install /boot/syslinux $ [ -e ../vmlinuz-6.6.62 ] || cp /usr/src/linux-6.6.62/arch/x86/boot/bzImage ../vmlinuz-6.6.62 $ cat <<EOF > syslinux.cfg DEFAULT CRUX-3.8 PROMPT 1 TIMEOUT 10 LABEL CRUX-3.8 SAY "Now booting into CRUX" KERNEL ../vmlinuz-6.6.62 APPEND root=/dev/sda2 rw quiet # End of config file EOF
cp
command from the kernel building step should put the kernel in a reachable path, hence the cp
command above does not need to run if the kernel was already copied to the expected place.
$ PTYPE=$(fdisk -l /dev/sda | grep "^Disklabel type" | cut -d " " -f3) $ [ "$PTYPE" = "gpt" ] && BINBLOB=gptmbr.bin || BINBLOB=mbr.bin $ dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/$BINBLOB of=/dev/sda
More information about UEFI and other boot loader/manager options can be found in the CRUX wiki at https://crux.nu/Wiki/UEFI.
Remove the CRUX installation media from your computer and reboot from harddisk.