Skip to content

Instantly share code, notes, and snippets.

@brunopagno
Last active June 23, 2024 18:49
Show Gist options
  • Save brunopagno/b395acb60f76df659480f0ef0dd5deb7 to your computer and use it in GitHub Desktop.
Save brunopagno/b395acb60f76df659480f0ef0dd5deb7 to your computer and use it in GitHub Desktop.

Installing this thing

https://wiki.archlinux.org/title/Installation_guide

Connect to the internet! Cable should detect automatically, but wifi needs a few steps:

iwctl
device list
station wlan0 connect <SSID>

Then test by pinging somewhere

ping archlinux.org

Next is partitioning and setting up disks

fdisk -l
fdisk /dev/sda
  • Create an EFI partition with at least 1GB (maybe 2)
  • Create a Linux Partition with whatever size
  • Swapfile we will create later
mkfs.btrfs /dev/sda2
mkfs.fat -F 32 /dev/sda1

Then mount things and install

mount /dev/sda2 /mnt
mount --mkdir /dev/sda1 /mnt/boot
pacstrap -K /mnt base linux linux-firmware

Config things

genfstab -U /mnt > /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
nvim /etc/locale.gen # uncomment the locale (probably en_US...)
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo gastly >> /etc/hostname
mkinitcpio -P
passwd

Now we are at the bootloader shenanigans. We'll use systemd-boot because yes.

https://wiki.archlinux.org/title/Systemd-boot

bootctl install
# /boot/loader/loader.conf

default arch.conf
timeout 2
console-mode max
editor no

blkid /dev/sda2 should print the UUID of the disk

# /boot/loader/entries/arch.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw

# /boot/loader/entries/arch-fallback.conf
title   Arch Linux (fallback initramfs)
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux-fallback.img
options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw

This ucode thing can be a thing as well

pacman -S amd-ucode / pacman -S intel-ucode

User so we don't use root all the time

pacman -S zsh
useradd -m -G wheel -s /bin/zsh bp
passwd bp

pacman -S sudo
EDITOR=nvim visudo
# search for `wheel` and uncomment the appropriate one

Enable the network manager because otherwise no internet

pacman -S networkmanager
systemctl enable NetworkManager
exit
umount -R /mnt
reboot now

After install

# connect to wi-fi
nmcli device wifi connect <SSID> password <PASS>

Setup swapfile with btrfs

pacman -S btrfs-progs
btrfs subvolume create /swap
btrfs filesystem mkswapfile --size 4g --uuid clear /swap/swapfile
swapon /swap/swapfile
nvim /etc/fstab
# /swap/swapfile none swap defaults 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment