mayfrost-guides/INITIATION.md

175 lines
9.2 KiB
Markdown
Raw Normal View History

2018-02-26 01:35:51 +00:00
# Initiation Rite
2018-02-26 03:56:06 +00:00
This guide is for those wanting one of the two most beautiful source based distros, either __CRUX__ or __Source Mage GNU/Linux__. It was written so it can be used by both, only diverging on particular details.
2018-02-26 04:31:55 +00:00
* __CRUX__: A ports based, BSD style init scripts, distro following true KISS principles (Keep It Simple).
* __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.
2018-02-26 04:32:36 +00:00
2018-03-07 04:10:30 +00:00
__NOTE__:
* This guide attempts to describe __UEFI__ in detail side by side with __BIOS__. Also describes dualbooting (and triple booting) with the bootloader. If you feel overwhelmed for the amount of information don't be afraid, most of it is __OPTIONAL__, like password protection of the bootloader and the different filesystems the bootloaders can use.
* For __CRUX__ you should be using their "_iso_".
* For __Source Mage GNU/Linux__ you can use any "_iso_" provided they have the commands here mentioned.
2018-02-26 01:37:22 +00:00
## TOC
1. [START](#start)
2018-02-26 03:52:35 +00:00
2. [PARTITIONING](#partitioning)
2018-03-11 21:22:36 +00:00
3. [FILESYSTEM](#filesystem)
2018-03-13 17:32:26 +00:00
4. [CREATING (AND MOUNTING) MAIN DIRECTORIES](#creating-and-mounting-main-directories)
2018-03-13 17:34:06 +00:00
5. [SETUP](#setup)
5.1. [CHROOT](#chroot)
5.2. [CHANGE NETWORK INTERFACES](#change-network-interfaces)
5.3. [EDIT FSTAB](#edit-fstab)
5.4. [SET THE ENVIRONMENT](#setup-the-environment)
6. [KERNEL](#kernel)
7. [BOOTLOADER](#bootloader)
2018-03-13 17:39:54 +00:00
7.1. [LILO](#lilo)
8. [THE END](#the-end)
## START
2018-02-26 01:35:51 +00:00
Boot in UEFI mode if on UEFI, BIOS if on BIOS, and select installation media.
2018-03-07 04:10:30 +00:00
* Make sure your network is up (OPTIONAL).
2018-03-13 17:23:49 +00:00
`dhcpcd <NIC>`
2018-03-13 17:34:06 +00:00
2018-03-13 17:24:16 +00:00
In the case you need to use Wi-Fi please refer to https://github.com/mayfrost/guides/blob/master/WIFI.md
2018-03-13 17:25:03 +00:00
* Temporarily change keyboard to your mapping (available configurations can be found in the directories "_/usr/share/kbd/keymaps/_" for __CRUX__ and "_/usr/share/keymaps/i386/qwerty_" for __Source Mage GNU/Linux__).
2018-03-13 17:23:49 +00:00
`loadkeys <KEYMAP>`
2018-02-26 01:35:51 +00:00
## PARTITIONING
2018-02-26 01:35:51 +00:00
2018-02-26 02:33:45 +00:00
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_" with "_mkfs.<ROOT_FILESYSTEM>_" format, and one boot partition, later mounted to "_/mnt/drive/boot_" and with "_mkfs.<BOOTLOADER_FILESYSTEM>_" format unless is __UEFI__ in which case "_mkfs.vfat_" is the only format available and will be mounted to "_/mnt/drive/boot/efi_" instead.
2018-02-26 01:35:51 +00:00
2018-03-07 04:10:30 +00:00
* Use parted.
2018-02-26 01:45:06 +00:00
`parted /dev/sda`
2018-03-07 04:10:30 +00:00
* Inside parted, if on UEFI label the disk "_gpt_", but if on BIOS label it "_msdos_".
2018-02-26 03:22:28 +00:00
`mklabel <LABEL>`
`unit mb`
`mkpart primary 0g 128`
`mkpart primary 128 -1`
`toggle 1 boot`
`p free`
`quit`
2018-02-26 01:35:51 +00:00
2018-03-11 21:22:36 +00:00
## FILESYSTEM
Choose your preferred filesystem. Common filesystem types are:
2018-03-11 21:25:51 +00:00
* __JFS__: Good read/write performance and crash recovery, reliable for low end computers like laptops and old computers.
2018-03-11 21:24:43 +00:00
* __Reiser4__: High performance filesystem for use in performance intensive environments like multimedia workstations and gaming rigs.
2018-03-11 21:22:36 +00:00
* __EXT4__: The newest version of the classic Linux filesystem and the one with most support, excels at a high quantity of files and nested directories. Ideal for FTP and fileservers.
* __XFS__: Popular for its good handling of large files, its best use is in big, enterprise level databases.
2018-03-11 21:26:34 +00:00
* __VFAT__: Most recent version of the filesystem from the time of DOS, most suitable for EFI partitions than anything else.
2018-03-11 21:22:36 +00:00
Look into each one and decide for your use case. Next are the commands used for installation, remember to install the appropiate tools for your filesystem, like "_jfsutils_" for __JFS__.
2018-03-07 04:10:30 +00:00
* Make root filesystem according to your personal preference.
2018-02-26 03:22:28 +00:00
`mkfs.<ROOT_FILESYSTEM> /dev/sda2`
2018-03-07 04:10:30 +00:00
* Make boot filesystem according to supported bootloader or just "_mkfs.vfat_" if on UEFI.
2018-03-11 21:22:36 +00:00
`mkfs.<BOOTLOADER_FILESYSTEM> /dev/sda1`
2018-03-13 17:32:26 +00:00
## CREATING (AND MOUNTING) MAIN DIRECTORIES
The two most important are the root directory ("_/_") and the boot directory ("_/boot_"), both of which need at the end of this step to be mounted. However, if you are an experienced user you may have created other partitions for other directories like "_/home_" or "_var_", those need to be mounted too by the end of this step.
2018-03-11 21:22:36 +00:00
* Make a directory for the new root directory.
`mkdir /mnt/drive`
* Mount the new root directory.
`mount /dev/sda2 /mnt/drive`
* If on BIOS make boot directory and mount.
2018-02-26 03:22:28 +00:00
`mkdir /mnt/drive/boot`
`mount /dev/sda1 /mnt/drive/boot`
2018-03-11 21:22:36 +00:00
* If on UEFI make boot directory and mount.
2018-02-26 03:22:28 +00:00
`mkdir -p /mnt/drive/boot/efi`
`mount /dev/sda1 /mnt/drive/boot/efi`
2018-03-11 21:22:36 +00:00
* Create other directories under the new root directory.
2018-03-07 04:02:09 +00:00
`mkdir -p /mnt/drive/{dev,sys,proc,tmp,usr/src,var}`
2018-03-13 17:32:26 +00:00
2018-03-13 17:34:06 +00:00
Don't forget to create and mount the extra directories in the case you had created them.
2018-03-13 17:32:26 +00:00
## SETUP
2018-03-07 04:04:29 +00:00
* On __CRUX__ run "_setup_", and if on UEFI during the setup select 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.
2018-03-07 04:02:09 +00:00
`setup`
2018-03-11 21:22:36 +00:00
* On __Source Mage GNU/Linux__ download and uncompress the tarball inside the new root directory.
2018-02-26 03:22:28 +00:00
`cd /mnt/drive`
`wget -c "http://download.sourcemage.org/image/official/smgl-stable-<version>-basesystem-x86_64.<compression>"`
2018-03-07 04:02:09 +00:00
`tar xvf smgl-stable-<version>-basesystem-x86_64.<compression>`
2018-02-26 01:35:51 +00:00
2018-02-26 03:52:35 +00:00
### CHROOT
2018-03-13 17:43:36 +00:00
* On __CRUX__ you can issue the next command to mount everything else and chroot automatically.
2018-03-07 04:02:09 +00:00
`setup-chroot`  
2018-03-07 04:10:30 +00:00
* On __Source Mage GNU/Linux__ mount everything else manually.
2018-03-07 04:02:09 +00:00
`mount --bind /dev /mnt/drive/dev`
`mount --bind /tmp /mnt/drive/tmp`
`mount --bind /sys /mnt/drive/sys`
`mount -t proc none /mnt/drive/proc`
`mount -t devpts none /mnt/drive/dev/pts`
2018-03-07 04:10:30 +00:00
* On __Source Mage GNU/Linux__ chroot manually specifying Bash in case live media has another shell.
2018-03-07 04:02:09 +00:00
`chroot /mnt/drive /bin/bash`
2018-03-07 04:10:30 +00:00
* Change root password in chroot (TEST IF YOUR KEYBOARD HAS ALL THE CORRECT MAPPINGS before you change the password).
2018-03-07 04:02:09 +00:00
`passwd root`
2018-02-26 03:52:35 +00:00
### CHANGE NETWORK INTERFACES
2018-03-07 04:10:30 +00:00
* On __CRUX__ modify "_/etc/rc.d/net_" with the rules you want (IP, gateway, domain, etc).
* On __Source Mage GNU/Linux__ add preferred interfaces to "_/etc/network/interfaces_" for example.
2018-02-26 03:22:28 +00:00
`auto eth0`
`allow-hotplug eth0`
2018-03-07 04:04:29 +00:00
`iface eth0 inet dhcp`
2018-03-07 04:10:30 +00:00
* On the "_/etc/resolv.conf.head_" file set your preferred DNS provider (this example is from OpenNIC).
2018-03-07 04:04:29 +00:00
`nameserver 193.41.79.236`
2018-03-07 04:10:30 +00:00
* Or copy "_/etc/resolv.conf_" to "_/mnt/etc/resolv.conf_" __BEFORE__ chrooting.
2018-02-26 01:35:51 +00:00
2018-02-26 03:52:35 +00:00
### EDIT FSTAB
2018-03-07 04:10:30 +00:00
* Change the "_/etc/fstab_" file with appropriate filesystems.
2018-02-26 03:22:28 +00:00
`/dev/sda1 /boot <BOOTLOADER_FILESYSTEM> defaults 0 2`
2018-03-07 04:04:29 +00:00
`/dev/sda2 / <ROOT_FILESYSTEM> noatime 0 1`
2018-03-07 04:10:30 +00:00
* 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_".
2018-02-26 01:35:51 +00:00
2018-02-26 03:53:21 +00:00
### SET THE ENVIRONMENT
2018-03-07 04:10:30 +00:00
* On __CRUX__ change the font, keyboard, timezone, hostname and services on the "_/etc/rc.conf_" file.
2018-03-07 04:04:29 +00:00
`ls /usr/share/kbd/keymaps/`
2018-03-07 04:10:30 +00:00
* On __Source Mage GNU/Linux__ change keymaps on the "_/etc/sysconfig/keymap_" file.
2018-03-07 04:04:29 +00:00
`ls /usr/share/keymaps/i386/qwerty`
2018-03-07 04:10:30 +00:00
* On __CRUX__ generate locales (change interface language).
2018-03-07 04:04:29 +00:00
`localedef -i <LOCALE> -f ISO-<CODE> <LOCALE>`
2018-03-07 04:10:30 +00:00
* On __Source Mage GNU/Linux__ generate locales (change interface language).
2018-03-07 04:04:29 +00:00
`cast -r locale`
2018-02-26 01:35:51 +00:00
2018-02-26 03:10:58 +00:00
## KERNEL
2018-03-07 04:10:30 +00:00
Next are simple examples of compiling the kernel, for a more in depth view see: https://github.com/mayfrost/guides/blob/master/KERNEL.md
* On __CRUX__.
2018-02-26 03:22:28 +00:00
`cd /usr/src/linux-<VERSION>`
2018-03-03 07:35:55 +00:00
`make all modules_install install`
2018-02-26 03:10:58 +00:00
2018-03-07 04:10:30 +00:00
* On __Source Mage GNU/Linux__ (__OPTIONAL__).
2018-02-26 03:10:58 +00:00
`cast -r linux`
## BOOTLOADER
2018-03-07 04:10:30 +00:00
Next is a simple example of setting the bootloader, for a more in depth view see: https://github.com/mayfrost/guides/blob/master/BOOTLOADER.md
2018-02-26 01:35:51 +00:00
### LILO
2018-03-07 04:02:09 +00:00
* On __Source Mage GNU/Linux__ do "_cast \<BOOTLOADER>_" to install lilo or elilo.
2018-03-07 04:10:30 +00:00
* If on UEFI use __elilo__ and change names to "_/etc/elilo.conf_" instead of "_/etc/lilo.conf_" and "_elilo_" instead of "_lilo_" in commands.
2018-02-26 01:45:06 +00:00
`nano /etc/lilo.conf`
2018-03-07 04:10:30 +00:00
* Inserting "_password=\<PASSWORD>_" inside an OS stanza will protect with a password that OS, but inserting "_password=\<PASSWORD>_" just before the stanzas and outside any of them will protect with a password the bootloader itself (notice the space inside stanzas).
2018-02-26 03:22:28 +00:00
`boot = /dev/sda`
`image = /boot/vmlinuz`
` Label = <DISTRO_NAME>`
` root = /dev/sda<PARTITION_NUMBER_OF_DISTRO>`
`other = /dev/sda<PARTITION_NUMBER_OF_FREEDOS>`
` table = /dev/sda`
2018-02-26 22:09:17 +00:00
` Label = FreeDOS`
2018-02-26 03:22:28 +00:00
`other = /dev/sda<PARTITION_NUMBER_OF_WINDOWS>`
` table = /dev/sda`
2018-02-26 21:56:29 +00:00
` Label = Windows7`
2018-03-07 04:10:30 +00:00
* Set boot entry.
2018-02-26 03:22:28 +00:00
`lilo -A /dev/sda 1`
`lilo`
2018-03-07 04:10:30 +00:00
* Prevent anyone but root of reading the config file (in case you used a password).
2018-02-26 01:45:06 +00:00
`chmod 600 /etc/lilo.conf`
2018-02-26 01:35:51 +00:00
2018-02-26 02:56:14 +00:00
## THE END
2018-03-07 04:10:30 +00:00
* Exit the chroot.
2018-02-26 02:56:14 +00:00
`exit`
2018-03-07 04:10:30 +00:00
* Shutdown the machine.
2018-02-26 03:24:46 +00:00
`shutdown -h now`
2018-03-13 17:43:36 +00:00
And done. For more information on both distros and what to do next see: https://github.com/mayfrost/guides/blob/master/DISTROS.md
Also check the list of software alternative to bloatware and support minimalism https://github.com/mayfrost/guides/blob/master/ALTERNATIVES.md