Core OS Index

1.1. Install Crux 3.2

Installation of minimal Crux 3.2 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.2, .

1.1.1. Download Iso

Download Page
        $ curl -k -O https://serverop.de/crux/crux-3.2/iso/crux-3.2.iso
        $ curl -k -O https://serverop.de/crux/crux-3.2/iso/crux-3.2.md5
        $ md5sum crux-3.2.iso
        2e4144590f6b340de2580255ad21620e  crux-3.2.iso
        

1.1.2. Prepare Target

Prepare disk or target location where new system will be installed. Follow steps describe how to create efi and separate partitions such as; boot, root, var, tmp, usr, ports, swap and home.

/boot/efi

EFI System Partition, ESP type EF00. Partition with between 500M and 100M is recommended for standard installations.

        (parted) mkpart ESP fat32 1MiB    120MiB
        
        (parted) align-check opt 1
        

/boot

Boot partition. Partition with 1G provides room for crux iso to boot directly from grub.

(parted) mkpart primary ext4 120MiB 1000MiB
        (parted) align-check optimal 2
        

/

Normal installation root partition uses 200MB-500MB, being 1G recommended. Since we have plenty of space a partition with 2G will be used to host a complete backup of final installation configuration.

        (parted) mkpart primary ext4 1000MiB 3000MiB
        
        (parted) align-check optimal 3
        

/var

Var partition is recommended 100MiB-500MiB, we will use 1G;

        (parted) mkpart primary ext4 3000MiB 4000MiB
        
        (parted) align-check optimal 4
        

/tmp

Temp partition with 20M-50M;

        (parted) mkpart primary ext4 4000MiB 4050MiB
        
        (parted) align-check optimal 5
        

/usr

User partition with 4G is recommended for a desktop setup, we will use 8G;

        (parted) mkpart primary ext4 4050MiB 12000MiB
        
        (parted) align-check optimal 6
        

/home

Home partition with 180G;

        (parted) mkpart primary ext4 12000MiB 192000MiB
        
        (parted) align-check optimal 7
        

/usr/ports

Ports partition with 120G allows to host sources, package backups and ports;

        (parted) mkpart primary ext4 192000MiB 312000MiB
        
        (parted) align-check optimal 8
        

Swap (ram)

Swap partition general advice is same size as memory ram, ports system configured to build on ram need at least 30G to build firefox. Other swap partitions can be added later for port build on ram.

        (parted) mkpart primary linux-swap 312000MiB 342000MiB
        

Create filesystems;

       $ export BLK_EFI=/dev/sda1
       $ export BLK_BOOT=/dev/sda2
       $ export BLK_ROOT=/dev/sda3
       $ export BLK_VAR=/dev/sda4
       $ export BLK_TMP=/dev/sda5
       $ export BLK_USR=/dev/sda6
       $ export BLK_HOME=/dev/sda7
       $ export BLK_PRT=/dev/sda8
       $ export BLK_SWAP=/dev/sda9
        
        $ sudo mkfs.fat -F 32  $BLK_EFI
        
        $ sudo mkswap $BLK_SWAP
        
       $ sudo mkfs.ext4 $BLK_BOOT
       $ sudo mkfs.ext4 $BLK_ROOT
       $ sudo mkfs.ext4 $BKL_VAR
       $ sudo mkfs.ext4 $BKL_TMP
       $ sudo mkfs.ext4 $BKL_USR
       $ sudo mkfs.ext4 $BKL_HOME
       $ sudo mkfs.ext4 $BKL_PRT
        

1.1.3. Prepare Target

        $ export CHROOT=/mnt
        
        $ 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_PRT $CHROOT/usr/ports

        $ 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.2.iso $CHROOT/media
        

1.1.4. Install Crux

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.36-2.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;

        /mnt/iso/crux/core/lilo#24.1-3.pkg.tar.xz
        

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
        

1.1.5. Install extra packages

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
        

Install fakeroot and create user account, read ;

        # pkgadd /media/crux/opt/fakeroot#1.20.2-1.pkg.tar.xz
        
	# chroot /mnt /bin/bash
	
        pkgadd /usr/ports/packages/dbus#1.10.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/expat#2.1.0-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libnl#3.2.27-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libpng#1.6.19-1.pkg.tar.xz
        pkgadd /usr/ports/packages/freetype#2.6.1-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libffi#3.2.1-2.pkg.tar.xz
        pkgadd /usr/ports/packages/sqlite3#3.9.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/python#2.7.10-1.pkg.tar.xz
        pkgadd /usr/ports/packages/glib#2.46.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/grub2#2.00-7.pkg.tar.xz
        pkgadd /usr/ports/packages/grub2-efi#2.00-4.pkg.tar.xz
        pkgadd /usr/ports/packages/wireless-tools#29-1.pkg.tar.xz
        pkgadd /usr/ports/packages/wpa_supplicant#2.5-2.pkg.tar.xz
        pkgadd /usr/ports/packages/lvm2#2.02.133-1.pkg.tar.xz
        pkgadd /usr/ports/packages/mdadm#3.3.4-1.pkg.tar.xz
        pkgadd /usr/ports/packages/efivar#0.21-1.pkg.tar.xz
        pkgadd /usr/ports/packages/efibootmgr#0.12-1.pkg.tar.xz
        pkgadd /usr/ports/packages/dosfstools#3.0.26-1.pkg.tar.xz
        
	# exit
	
        $ sudo rm $CHROOT/pkgadd
        $ sudo rm $CHROOT/core.lst
        

1.1.6. Install extra ports

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/
	

1.1.7. DNS Resolver

        $ sudo cp /etc/resolv.conf $CHROOT/etc
        

1.1.8. Install Handbook

        $ sudo cp $CHROOT/media/crux/handbook.txt $CHROOT/home/root/
        

1.1.9. Basic Skeleton

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) 2016 c9 team. See the file Gnu Free Documentation License for copying conditions.