sisyphus/System-Installation-Guide.md

171 lines
2.7 KiB
Markdown
Raw Normal View History

2022-04-20 22:24:20 +02:00
# System Installation Guide
Attach ArchLinux boot key. Boot.
2022-04-20 22:24:20 +02:00
Set the keyboard layout.
```
2022-04-16 02:39:17 +02:00
# loadkeys be-latin1
2022-04-20 22:24:20 +02:00
```
Connect to the internet.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# iwctl
[iwd]# station wlan0 connect <network>
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
Escape the menu with ^D. Automatically update the time.
```
2022-04-16 02:39:17 +02:00
# timedatectl set-ntp true
2022-04-20 22:24:20 +02:00
```
Format the disk.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# fdisk -l
# fdisk /dev/sda
: g
: n, 1, _, +1G
: t, 1, 1
2022-04-20 22:24:20 +02:00
: n, 2, _, +8G
2022-04-16 15:47:59 +02:00
: t, 2, 19
: n, 3, _, _
2022-04-16 02:39:17 +02:00
: w
# pvcreate /dev/sda3
# vgcreate MyGroup /dev/sda3
# lvcreate -l +100%FREE MyGroup -n MyVolume
# mkfs.ext4 /dev/MyGroup/MyVolume
# mkswap /dev/sda2
# mkfs.fat -F 32 /dev/sda1
# mount /dev/MyGroup/MyVolume /mnt
# mkdir /mnt/boot
# mount /dev/sda1 /mnt/boot
2022-04-20 22:24:20 +02:00
```
Enable swap.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# swapon /dev/sda2
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
Install the kernel. Also install keyring because keys will be needed.
```
2022-04-16 02:39:17 +02:00
# pacman -Sy archlinux-keyring
# pacstrap /mnt base linux linux-firmware
2022-04-20 22:24:20 +02:00
```
Make the mounts persistent.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# genfstab -U /mnt >> /mnt/etc/fstab
2022-04-20 22:24:20 +02:00
```
Configure the system.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# arch-chroot /mnt
# ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime
# hwclock --systohc
# locale-gen
# echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
# echo "KEYMAP=be-latin1" >> /etc/vconsole.conf
2022-04-16 15:47:59 +02:00
# echo "Laptop-Tibo" >> /etc/hostname
2022-04-20 22:24:20 +02:00
```
Enable hibernation.
```
2022-04-18 11:39:39 +02:00
# echo "8:2" > /sys/power/resume
2022-04-20 22:24:20 +02:00
```
Create initial ramdisk environment.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# pacman -S vim lvm2
# vim /etc/mkinitcpio.conf
2022-04-20 22:24:20 +02:00
```
2022-04-20 22:25:30 +02:00
2022-04-20 22:24:20 +02:00
Change the file to match the following line:
2022-04-20 22:25:30 +02:00
2022-04-20 22:24:20 +02:00
`HOOKS=(base udev autodetect modconf block lvm2 filesystems resume keyboard fsck)`
```
2022-04-16 02:39:17 +02:00
# mkinitcpio -P
2022-04-20 22:24:20 +02:00
```
Generate root password.
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
# passwd
2022-04-20 22:24:20 +02:00
```
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
Configure boot manager. Also enable hibernation.
```
2022-04-16 02:39:17 +02:00
# pacman -S grub efibootmgr
2022-04-16 03:34:17 +02:00
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
# vim /etc/default/grub
2022-04-20 22:24:20 +02:00
```
Change the file to match the following lines:
`GRUB_TIMEOUT=0`
2022-04-20 22:25:30 +02:00
2022-04-20 22:24:20 +02:00
`GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=/dev/sda2"`
2022-04-20 22:25:30 +02:00
2022-04-20 22:24:20 +02:00
`GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"`
```
2022-04-16 02:39:17 +02:00
# grub-mkconfig -o /boot/grub/grub.cfg
2022-04-20 22:24:20 +02:00
```
Add the default user (me).
2022-04-16 02:39:17 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-20 22:26:52 +02:00
# useradd -m -G wheel,users,input,video tdpeuter
2022-04-16 15:47:59 +02:00
# passwd tdpeuter
2022-04-20 22:24:20 +02:00
```
2022-04-16 15:47:59 +02:00
2022-04-20 22:24:20 +02:00
Make the system automatically log into that user.
```
2022-04-16 21:45:50 +02:00
# sudo mkdir -p /etc/systemd/system/getty@tty1.service.d
# sudo vim /etc/systemd/system/getty@tty1.service.d/autologin.conf
2022-04-20 22:24:20 +02:00
```
Contents of the file:
```
2022-04-16 21:45:50 +02:00
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin tdpeuter - $TERM
2022-04-20 22:24:20 +02:00
```
Install sudo.
2022-04-16 21:45:50 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 15:47:59 +02:00
# pacman -S sudo
# visudo
2022-04-20 22:24:20 +02:00
```
2022-04-16 03:57:03 +02:00
2022-04-20 22:25:30 +02:00
In the file that comes up, uncomment the following line: `%wheel ALL=(ALL:ALL) ALL`
2022-04-20 22:24:20 +02:00
Install a networkmanager so you have bloody internet when you reboot (otherwise rendering your device utterly useless).
```
2022-04-16 15:47:59 +02:00
# pacman -S networkmanager
2022-04-20 22:24:20 +02:00
```
Escape fakeroot with ^D.
2022-04-16 03:57:03 +02:00
2022-04-20 22:24:20 +02:00
Finally,
2022-04-16 15:47:59 +02:00
2022-04-20 22:24:20 +02:00
```
2022-04-16 15:47:59 +02:00
# reboot
2022-04-20 22:24:20 +02:00
```