Skip to content

Instantly share code, notes, and snippets.

@flohw
Last active July 11, 2024 15:15
Show Gist options
  • Save flohw/2b42b9b154a9365661615d61751fb05e to your computer and use it in GitHub Desktop.
Save flohw/2b42b9b154a9365661615d61751fb05e to your computer and use it in GitHub Desktop.
ArchLinux installation

ArchLinux installation

Keyboard

loadkeys fr-latin1 # Select fr-latin1 keymap

Installation process

Partitioning

lsblk -Sp # list all available disks
parted -a optimal -s /dev/sda \
        mklabel gpt \
        mkpart primary 0% 128MiB \
            name 1 boot \
	    set 1 esp on \
	mkpart primary 128MiB 100% \
	    name 2 root
mkfs.fat -F32 -n BOOT /dev/sda1

# If no encrypted partition is needed
mkfs.btrfs -L root /dev/sda2

# If encrypted partition is needed
cryptsetup luksFormat /dev/sda2 # Type YES the a passphrase
cryptsetup open /dev/sda2 root # Open ecrypted partition.
mkfs.btrfs -L root /dev/mapper/root

Mounting partition

# If partition has been encrypted
mount /dev/mapper/root /mnt
# else 
mount /dev/sda2 /mnt
# endif
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

Update mirrorlist and install packages

cd /etc/pacman.d
pacman -Sy pacman-contrib # In order to get rankmirrors command
curl -L archlinux.org/mirrorlist/\?country=FR | sed 's/^#//' > mirrorlist.bak # Get fr mirrorlist
rankmirrors mirrorlist.bak > mirrorlist
pacstrap /mnt base base-devel linux linux-firmware iwd zsh git stow

Generate fstab file

genfstab -p -U /mnt > /mnt/etc/fstab

Installing the system

arch-chroot /mnt /bin/bash

Localization

echo KEYMAP=fr-latin1 > /etc/vconsole.conf # Keymap fr persistent for tty
echo fr_FR.UTF-8 UTF-8 > /etc/locale.gen
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
echo LANG=fr_FR.UTF-8 > /etc/locale.conf
locale-gen

Set date

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime # Create symlink to right tz
hwclock --systohc --utc # Setup harware clock
systemctl enable systemd-timesyncd

Set hostname and hosts

echo arch-flohw > /etc/hostname
vim /etc/hosts
# 127.0.0.1 localhost.localdomain localhost arch-flohw
# ::1       localhost.localdomain localhost arch-flohw

Setup network connection

ip link # List all available network hardwares. What starts with an "e" is for ethernet connection. What starts with a "w" is for wireless connection.

# Starting with ethernet connection
# systemctl enable iwd systemd-networkd systemd-resolved

iwctl station <wlan> get-networks
iwctl station <wlan> connect <ssid>

# /etc/systemd/network/20-ethernet.network
# [Match] # Only one of the rules because an AND is made between lines
# Name=en*
# Name=eth*
#
# [Network]
# DHCP=yes
# IPv6PrivacyExtensions=yes
#
# [DHCP]
# RouteMetric=512

# /etc/systemd/network/20-wireless.conf
# [Match] # Only one of the rules because an AND is made between lines
# Name=wlp*
# Name=wlan*
#
# [Network]
# DHCP=yes
# IPv6PrivacyExtensions=yes
#
# [DHCP]
# RouteMetric=1024

# /etc/resolv.conf
# nameserver 127.0.0.53
# options edns0 trust-ad

Configure users

passwd # Password for root user
useradd -m -g users -s /bin/zsh flohw # m option to create homedir. g for group. s for shell. Then username
passwd flohw # Password for flohw user
vim /etc/sudoers # Find line starting with root ALL=(ALL) ALL
# Add new line : "flohw ALL=(ALL) ALL" to allow flohw user to use sudo command

Install and configure bootloader

pacman -S syslinux efibootmgr
mkdir -p /boot/EFI/
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/gptmbr.bin of=/dev/sda
cp -r /usr/lib/syslinux/efi64/* /boot/EFI/.
vim /boot/syslinux/syslinux.cfg
# DEFAULT arch
# LABEL arch
#     LINUX ../vmlinuz-linux
#     INITRD ../initramfs-linux.img
# If partition has been encrypted use this line
#     APPEND cryptdevice=/dev/sda2:root root=/dev/mapper/root rw
# If not use this one
#     APPEND root=/dev/sda2 rw

# If necessary : EFI entry may not exist or outdated in case of reformatting
efibootmgr --create --disk /dev/sda --part 1 \
           --loader /EFI/syslinux.efi \
           --label "ArchLinux" --verbose

# If partition has been encrypted
vim /etc/mkinitcpio.conf
# Into HOOKS section
# Add encrypt between block and filesystems
mkinitcpio -p linux # Rebuild boot loader images with new parameters and right filesystem configuration

Post installation

# For laptop
sudo pacman -S nvidia xf86-video-intel bumblebee mesa # Xorg will be faster
sudo systemctl enable bumblebeed
sudo systemctl start bumblebeed
alsactl init # sound will be operationnal

# For chromebook
sudo pacman -S libva-intel-driver mesa
alsactl init

# yay
git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin
makepkg -si && cd .. && rm -rf yay-bin

# If vlc stream to chromcast don't work out of the box
pacman  -Sy  libmicrodns protobuf

Boot installation

bootctl install

Configuration

vim /boot/loader/loader.conf

# #timeout 3
# #console-mode keep
# default arch.conf

vim /boot/loader/entries/arch.conf

# title ArchLinux on Chromebook
# linux /vmlinuz-linux
# initrd /intel-ucode.img
# initrd /initramfs-linux.img

# # If partition has been encrypted use this line
# options cryptdevice=/dev/sda2:root root=/dev/mapper/root rw
# # If not use this one
# # options root=/dev/sda2 rw
enpass-bin
pam_u2f-git
yay-bin
acpi
alsa-utils
autoconf
automake
base
bat
bison
docker-compose
dunst
fakeroot
firefox
flex
i3-gaps
i3blocks
iwd
jq
make
numlockx
openssh
patch
picom
pkgconf
stow
sxiv
syslinux
tmux
tree
# udiskie ?
vim
vlc
xbindkeys
xf86-video-vesa
xorg-bdftopcf
xorg-docs
xorg-font-util
xorg-fonts-100dpi
xorg-fonts-75dpi
xorg-iceauth
xorg-mkfontscale
xorg-server
xorg-server-devel
xorg-server-xephyr
xorg-server-xnest
xorg-server-xvfb
xorg-sessreg
xorg-smproxy
xorg-x11perf
xorg-xbacklight
xorg-xcmsdb
xorg-xcursorgen
xorg-xdpyinfo
xorg-xdriinfo
xorg-xev
xorg-xgamma
xorg-xhost
xorg-xinit
xorg-xinput
xorg-xkbevd
xorg-xkbutils
xorg-xkill
xorg-xlsatoms
xorg-xlsclients
xorg-xpr
xorg-xrefresh
xorg-xsetroot
xorg-xvinfo
xorg-xwayland
xorg-xwd
xorg-xwud
xsel
zsh
osf-firmware # Pour le son à priori...
https://git.mehalter.com/mehalter/dotfiles
- Makefile
- Scripts
- i3blocks scripts
https://github.com/flohw/arch-setup (forked)
- For setup arch
- Rework on it needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment