10. Setting up a Linux OS from scratch often like building a house
Often it is very trivial a.k.a. mafan
11. So instead of building one, we often choose to purchase one.
We choose to install a Linux OS with packages pre-installed.
Often it is a bloated, gluten OS.
14. Let’s do it!
1. Storage
ps +/n 10 ste
i
○ Partition
○ Format
○ Mount
2. OS
○
○
○
○
○
Base system
File system table
Initial Ramdisk Env
Initial configurations
Boot loader
3. Moooooore
○ New user account
○ Windows (not that WindowsTM)
15. 0. Set Up VM
● Create a new VM
● Attach ISO to the VM as storage
● Start!
16. 1. Storage
Partition
$ cfdisk <Storage-Device-Name>
$ cfdisk /dev/sda
Format
$ mkfs.ext4 <StoragePartition-Name>
$ mkfs.ext4 /dev/sda1
$ mkswap <Storage-PartitionName>
$ mkswap /dev/sda2
Mount
$ mount <From> <To>
$ mount /dev/sda1 /mnt
$ swapon <Storage-PartitionName>
$ swapon /dev/sda2
More: https://wiki.archlinux.org/index.php/Partitioning
17. 2. OS (Part 1 of 3)
Base System
$ pacstrap -i <OS-Drive>
base
$ pacstrap -i /mnt base
File system table
$ genfstab -U -p /mnt >>
/mnt/etc/fstab
$ genfstab -U -p <OS-Drive>
>> <OS-Drive>/etc/fstab
“Enter the OS”
$ arch-chroot /mnt
$ arch-chroot <OS-Drive>
Initial Ramdisk Environment
$ mkinitcpio -p linux
fstab: https://wiki.archlinux.org/index.php/Fstab
chroot: https://wiki.archlinux.org/index.php/Chroot
initrd: https://wiki.archlinux.org/index.php/mkinitcpio
$ mkinitcpio -p linux
18. 2. OS (Part 2 of 3)
Initial configurations
# Set timezone
$ ln -s
/usr/share/zoneinfo/<Continent>
/<City>
$ ln -s
/usr/share/zoneinfo/Asia/Kual
a_Lumpur /etc/localtime
# Set clock
$ hwclock --systohc --utc
$ hwclock --systohc --utc
# Set hostname
$ echo archieVM > /etc/hostname
# Enable dhcp client
$ systemctl enable dhcpcd
$ $ echo archieVM >
/etc/hostname
$ systemctl enable dhcpcd
# Set password for root
$ passwd
$ passwd
21. 3. More (Part 2 of 2)
Windows
<logged in as non-root>
<logged in as sianlerk>
$ echo exec openbox-session >
~/.xinitrc
$ echo exec openbox-session
> ~/.xinitrc
$ startx
$ startx