This guide is for those who want to install either CRUX or Source Mage GNU/Linux. It was written so it can be used by both, only diverging on the particular details.
* CRUX: A ports based, BSD style init scripts, distro following true KISS principles (Keep It Simple, Stupid).
* Source Mage GNU/Linux: Without 3rd party patches, sensible defaults or masked packages, free from obfuscated and pre-configured code, use clean dependencies as they came from upstream developers and can also use flags.
In these examples we make only two partitions but you can extend this if you know how. The partitions are one root partition, later mounted to /mnt/drive format with mkfs.<ROOT_FILESYSTEM>, and one boot partition, later mounted to /mnt/drive/boot and format with mkfs.<BOOTLOADER_FILESYSTEM> unless is UEFI in which case mkfs.vfat is the only format available and will be mounted to /mnt/drive/boot/efi.
# Use parted
{{{
parted /dev/sda
}}}
# Inside parted, if on UEFI label the disk "gpt", but if on BIOS label it "msdos"
{{{
mklabel <LABEL>
unit mb
mkpart primary 0g 128
mkpart primary 128 -1
toggle 1 boot
p free
quit
}}}
# Make boot filesystem according to supported bootloader or just "mkfs.vfat" if on UEFI
{{{
mkfs.<BOOTLOADER_FILESYSTEM> /dev/sda1
}}}
# Make root filesystem according to your personal preference
{{{
mkfs.<ROOT_FILESYSTEM> /dev/sda2
mkdir /mnt/drive
mount /dev/sda2 /mnt/drive
}}}
# If on BIOS
{{{
mkdir /mnt/drive/boot
mount /dev/sda1 /mnt/drive/boot
}}}
# If on UEFI
{{{
mkdir -p /mnt/drive/boot/efi
mount /dev/sda1 /mnt/drive/boot/efi
cd /mnt/drive
mount --bind /dev /mnt/drive/dev
mount --bind /sys /mnt/drive/sys
mount -t proc none /mnt/drive/proc
mount -t devpts none /mnt/drive/dev/pts
}}}
== SETUP
# On CRUX run setup, and if on UEFI select on setup grub2-efi (if using GRUB 2), efibootmgr, and elfutils from opt (only select core, and say yes when you're asked if you want to select individual packages). And if you are not using LILO de-select it from core.
# On CRUX uncomment the lines referring to devpts, tmp, and shm as some programs require it (Firefox), also USB and or cdrom if using those
# If on UEFI replace /boot with /boot/efi
# On CRUX change the font, keyboard, timezone, hostname and services
{{{
ls /usr/share/kbd/keymaps/
nano /etc/rc.conf
}}}
# On Source Mage GNU/Linux change the keymaps
{{{
ls /usr/share/keymaps/i386/qwerty
nano /etc/sysconfig/keymap
}}}
# On CRUX generate locales (change interface language)
{{{
localedef -i <LOCALE> -f ISO-<CODE><LOCALE>
}}}
# On Source Mage GNU/Linux generate locales (change interface language)
{{{
cast -r locale
}}}
== BOOTLOADER
* The drive where bootloaders and OSes are installed on these examples is /dev/sda, bu could be anywhere.
* The bootloader installation IS inside chroot AND with drives mounted, so this guides assumes you are inside "/mnt/drive".
* The "vmlinuz" makes reference to the kernel image, you can rename it or simlink to it in all cases, the only rule is you have to make sure the name is referenced correctly in the bootloader. By default it can have names like vmlinuz-linux, vmlinuz-<KERNEL_VERSION> and so on. The same with initramfs.img, it can be initramfs-<KERNEL_VERSION>.img and such.
* All bootloader examples have included other OS inside what is called "stanzas".
* FreeDOS and Windows stanzas are OPTIONAL.
* If dualbooting with Windows remember that it likes to be in the first partition.
* If on UEFI check if module is loaded by issuing {{{modprobe efivars}}}.
* On CRUX do {{{prt-get remove lilo}}} if you dont use LILO.
* On Source Mage GNU/Linux do {{{cast <BOOTLOADER>}}} to install the preferred bootloader.
=== LILO
# If on UEFI use elilo and change names to /etc/elilo.conf instead of /etc/lilo.conf and elilo instead of lilo in commands
{{{
nano /etc/lilo.conf
}}}
# Inserting password=<PASSWORD> inside an OS stanza will protect with a password the that OS, but inserting password=<PASSWORD> just before the stanzas will protect with a password the bootloader instead (notice the space inside stanzas)
{{{
boot = /dev/sda
image = /boot/vmlinuz
Label = CRUX
root = /dev/sda<PARTITION_NUMBER_OF_DISTRO>
other = /dev/sda<PARTITION_NUMBER_OF_FREEDOS>
table = /dev/sda
Label = FreeDos
other = /dev/sda<PARTITION_NUMBER_OF_WINDOWS>
table = /dev/sda
Label = Windows7
}}}
{{{
lilo -A /dev/sda 1
lilo
}}}
# In case you used a password prevent anyone but root of reading the config file
{{{
chmod 600 /etc/lilo.conf
}}}
=== SYSLINUX
# If on BIOS make directory and copy files accordingly
{{{
mkdir -p /boot/syslinux
cp /usr/lib/syslinux/bios/*.c32 /boot/syslinux/
}}}
# If on UEFI make directory and copy files accordingly