Installation of minimal Crux 3.3 Gnu\Linux system, with selected packages from core, opt and contrib ports. Process of installation documented can be executed from iso or from existing gnu\linux installation. Read Hand book 3.3, .
If you are booting from crux iso and is not your keyboard layout of choice run;
# loadkeys dvorak
Visit crux download page for more notes before downloading iso. Script setup-iso.sh downloads iso from master repo and checks md5sum.
$ curl -k -O https://serverop.de/crux/crux-3.3/iso/crux-3.3.iso $ curl -k -O https://serverop.de/crux/crux-3.3/iso/crux-3.3.md5 $ md5sum crux-3.3.iso b82134d40c9947580f7510694f6970de crux-3.3.iso
Prepare disk or target location where new system will be installed. Follow steps describe how to create efi and separate partitions such as; bios grub, EFI, boot, root, var, usr, swap and home. For more information about gpt partitions table read devil-detail grub2 on gpt. Script setup-target.sh creates follow partitions;
Create gpt label and set unit size to use;
(parted) mklabel gpt (parted) unit mib
Partition used by grub boot loader. Partition size 2M;
mkpart primary 1 3 name 1 grub set 1 bios_grub on
EFI System Partition, ESP type EF00. Partition with between 500M and 100M is recommended for standard installations. Partition size 128M;
(parted) mkpart ESP fat32 3 125 (parted) name 2 efi (parted) set 2 boot on
Boot partition. Partition with 1G provide room for kernels and crux iso that can be directly boot from grub (without root partition). Partition size 1G;
(parted) mkpart primary ext4 125 1128 (parted) name 3 boot
Normal core crux installation root partition uses approximately 2G, without /usr 200MB-500M. Minimum 2G is recommended to give room to root home directory with dedicated (separated) usr and var partition. Partition size 4G;
(parted) mkpart primary ext4 1128 5128 (parted) name 4 root
Var partition is recommended 1G-5G depending on how system is configured. Partition size 1G;
(parted) mkpart primary ext4 5128 6128 (parted) name 5 var
User partition with 4G-8G is recommended for a desktop setup, with dedicated partition for ports. Partition size 8G;
(parted) mkpart primary ext4 6128 14128 (parted) name 6 usr
Swap partition general advice is to have the same size as memory ram, ports system will be configured to build on ram. To build firefox is necessary at least 34G, swap partitions will be added to lvm and this partition removed. Partition size 4G;
(parted) mkpart primary linux-swap 14128 18128 (parted) name 3 swap
Home partition general advice is to fill the rest of disk space. Home partition will be added later to lvm and this partition removed. Fill the rest of disk space;
(parted) mkpart primary ext4 18128 100% (parted) name 8 home
From now on script setup-install.sh create file systems, install packages, configure host metadata and setup ports;
$ export CHROOT=/mnt
$ export DEV=/dev/sda
$ export BLK_EFI="${DEV}2" $ export BLK_BOOT="${DEV}3" $ export BLK_ROOT="${DEV}4" $ export BLK_VAR="${DEV}5" $ export BLK_USR="${DEV}6" $ export BLK_SWP="${DEV}7" $ export BLK_HOME="${DEV}8"
$ sudo mkfs.fat -F 32 $BLK_EFI $ sudo mkfs.ext4 $BLK_BOOT $ sudo mkfs.ext4 $BLK_ROOT $ sudo mkfs.ext4 $BKL_VAR $ sudo mkfs.ext4 $BKL_USR $ sudo mkswap $BLK_SWAP $ sudo mkfs.ext4 $BKL_HOME
$ sudo mount $BLK_ROOT $CHROOT
Create directories and mount target partitions;
$ sudo mkdir -p $CHROOT/boot $ sudo mkdir -p $CHROOT/var $ sudo mkdir -p $CHROOT/usr $ sudo mkdir -p $CHROOT/media $ sudo mkdir -p $CHROOT/home $ sudo mkdir -p $CHROOT/dev $ sudo mkdir -p $CHROOT/tmp $ sudo mkdir -p $CHROOT/proc $ sudo mkdir -p $CHROOT/sys $ sudo mount $BLK_BOOT $CHROOT/boot $ sudo mkdir -p $CHROOT/boot/efi $ sudo mount $BLK_EFI $CHROOT/boot/efi $ sudo mount $BLK_VAR $CHROOT/var $ sudo mkdir -p $CHROOT/var/lib/pkg $ sudo mount $BLK_USR $CHROOT/usr $ sudo mount $BLK_HOME $CHROOT/home
Activate Chroot;
$ sudo mount --bind /dev $CHROOT/dev $ sudo mount -vt devpts devpts $CHROOT/dev/pts $ sudo mount -vt tmpfs shm $CHROOT/dev/shm $ sudo mount -vt proc proc $CHROOT/proc $ sudo mount -vt sysfs sysfs $CHROOT/sys
Mount iso on target partition;
# modprobe isofs # modprobe loop # mount -o loop crux-3.3.iso $CHROOT/media
Create file $CHROOT/core.lst containing list of binary packages present in $CHROOT/media/crux/core/;
$ sudo for p in $CHROOT/media/crux/core/*; do echo $p << $CHROOT/core.lst; done
Install temporary pkgadd on $CHROOT;
$ sudo tar xf /media/crux/core/pkgutils#5.40-1.pkg.tar.xz usr/bin/pkgadd -O > $CHROOT/pkgadd $ sudo chmod +x $CHROOT/pkgadd
Edit $CHROOT/core.lst with your preferences, you can remove or add packages from opt collection. Remove lilo if you want grub.
Create package database, it will contain a list of i nstalled packages files.
$ sudo touch $CHROOT/var/lib/pkg/db
Install all packages listed in $CHROOT/core.lst;
$ su # cd $CHROOT while read line; do printf "Installing $line;\n" $CHROOT/pkgadd -f -r $CHROOT $line done < core.lst
Install additional ports like wireless-tools, grub2 and fakeroot;
cp $CHROOT/media/crux/opt/* $CHROOT/usr/ports/packages cp $CHROOT/media/crux/xorg/* $CHROOT/usr/ports/packages
# chroot $CHROOT /bin/bash
pkgadd /usr/ports/packages/fakeroot#* pkgadd /usr/ports/packages/dbus#* pkgadd /usr/ports/packages/expat#* pkgadd /usr/ports/packages/libnl#* pkgadd /usr/ports/packages/libpng#* pkgadd /usr/ports/packages/freetype#* pkgadd /usr/ports/packages/libffi#* pkgadd /usr/ports/packages/sqlite3#* pkgadd /usr/ports/packages/python#* pkgadd /usr/ports/packages/glib#* pkgadd /usr/ports/packages/grub2#* pkgadd /usr/ports/packages/grub2-efi#* pkgadd /usr/ports/packages/wireless-tools#* pkgadd /usr/ports/packages/wpa_supplicant#* pkgadd /usr/ports/packages/lvm2#* pkgadd /usr/ports/packages/mdadm#* pkgadd /usr/ports/packages/efivar#* pkgadd /usr/ports/packages/efibootmgr#* pkgadd /usr/ports/packages/dosfstools#*
# exit
$ sudo rm $CHROOT/pkgadd $ sudo rm $CHROOT/core.lst
Create c9 ports;
$ sudo mkdir $CHROOT/usr/ports/c9-ports
Copy ports from c9-doc/core/ports;
$ sudo cp -r ports/* $CHROOT/usr/ports/c9-ports/
$ sudo cp /etc/resolv.conf $CHROOT/etc
$ sudo cp $CHROOT/media/crux/handbook.txt $CHROOT/home/root/
Copy skeletons from c9-doc/core/conf;
$ sudo cp -R conf/skel $CHROOT/etc/Core OS Index
This is part of the c9 Manual. Copyright (C) 2017 c9 team. See the file Gnu Free Documentation License for copying conditions.