Skip to content

Latest commit

 

History

History
312 lines (277 loc) · 6.82 KB

installation.md

File metadata and controls

312 lines (277 loc) · 6.82 KB

Arch linux installation

Troubleshooting

  • issue on virtualbox, efi was not enabled. Check with:
efivar-tester
setxkbmap -print -verbose 10

Beginning

setfont ter-112n
  • setup wifi connection: see iwd utility
  • list available layouts
localectl list-keymaps | grep fr
  • change keyboard layout
loadkeys fr-latin9
  • set correct date through ntp
timedatectl set-ntp true
  • use reflector to update pacman mirror list: see reflector
reflector -c France -a 6 --sort rate --save /etc/pacman.d/mirrorlist
# -c: Country
# -a: servers synchronized since 6 hours
# --sort: sort by some predicate (here rate but could be speed)
# --save: the file to save (already present in arch linux iso)
  • resynchronize the servers
pacman -Syy

Create partitions

  • list block devices to find the disk name
lsblk

Partitions will be created using gdisk

gdisk /dev/$DISK_NAME

EFI

See EFI system partition

Command: n
Partition number: # <default: press ENTER>
First sector: # <default: press ENTER>
Last sector: +512M # arch linux recommends 300MB or for early/buggy UEFI implementations 512M https://wiki.archlinux.org/title/EFI_system_partition
Hex code: ef00

Swap (optional ?)

Command: n
Partition number: # <default: press ENTER>
First sector: # <default: press ENTER>
Last sector: +4G # rule of thumb is to make twice of the RAM until 2G, otherwise create 4G
Hex code: 8200

Root

Command: n
Partition number: # <default: press ENTER>
First sector: # <default: press ENTER>
Last sector: # <default: press ENTER>
Hex code: # <default: press ENTER> (8300)

Then we can write it:

Command: w

Format partitions

lsblk

EFI

EFI partition must be FAT 32

mkfs.fat -F32 /dev/$EFI_PARTITION

Swap

mkswap /dev/$SWAP_PARTITION
swapon /dev/$SWAP_PARTITION

Root

  • create the encryption and type passphrase
cryptsetup -y -v luksFormat /dev/$ROOT_PARTITION
  • open the partition
cryptsetup open /dev/$ROOT_PARTITION cryptroot # cryptroot is a mapper to refer later
  • format it
mkfs.ext4 /dev/mapper/cryptroot

Mount partitions

  • root
mount /dev/mapper/cryptroot /mnt
  • efi
mkdir /mnt/boot
mount /dev/$EFI_PARTITION /mnt/boot

Install basic dependencies

Using pacstrap

pacstrap /mnt base linux linux-firmware vim intel-ucode

Generate file system table

Good documentation here

genfstab -U /mnt >> /mnt/etc/fstab # -U for UUID

Installation

see arch-chroot

arch-chroot /mnt

Set timezone

timedatectl

timedatectl list-timezones | grep Paris
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
hwclock --systohc # synchronize clocks
timedatectl status # to check if result is correct

Set locale

  • uncomment the desired line in the following file:
vim /etc/locale.gen
> en_US.UTF8 UTF-8
  • synchronize the locale:
locale-gen
  • write the locale in the conf file:
vim /etc/locale.conf
> LANG=en_US.UTF-8

Keyboard

Set the default keyboard layout:

vim /etc/vconsole.conf
KEYMAP=fr-latin9

Host

  • hostname called here archcrypt:
vim /etc/hostname
> archcrypt
  • hosts
vim /etc/hosts
127.0.0.1	localhost
::1		localhost
127.0.1.1	archcrypt.localdomain	archcrypt

Update password

passwd

Install dependencies

pacman -S grub efibootmgr networkmanager network-manager-applet dialog wpa_supplicant mtools dosfstools base-devel linux-headers bluez bluez-utils cups xdg-utils xdg-user-dirs alsa-utils pulseaudio pulseaudio-bluetooth git reflector terminus-font

Modify mkinitcpio.conf

Because we are using encrypted partition, we need to modify the image loaded initially at startup, see mkinitcpio

  • add keyboard, keymap and encrypt in the HOOKS section
vim /etc/mkinitcpio.conf
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt filesystems fsck)
  • recreate the image
mkinitcpio -p linux

GRUB bootloader

see grub

  • install it
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
  • generate config and write it into /boot/grub/grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg
  • change configuration file because we use encryption: UUID of our root partition
blkid # find UUID_ROOT_PARTITION (the 8300 type)
vim /etc/default/grub
>> GRUB_CMDLINE_LINUX="cryptdevice=UUID=$UUID_ROOT_PARTITION:cryptroot root=/dev/mapper/cryptroot"
  • regenerate config
grub-mkconfig -o /boot/grub/grub.cfg

End of basic install

  • enable some services
systemctl enable NetworkManager
systemctl enable bluetooth
systemctl enable cups
  • create user
useradd -mG wheel foobar
passwd foobar
  • enable sudo priviledges for group wheel:
EDITOR=vim visudo
# uncomment line %wheel ALL=(ALL) ALL
  • exit
exit
umount -a
reboot

Connect wifi

nmcli device wifi # display available wifi networks
nmcli device wifi connect $WIFI_SSID --ask
sudo pacman -S archlinux-keyring

Global

timedatectl set-ntp true
sudo hwclock --systohc # synchronize clocks
sudo reflector -c France -a 6 --sort rate --save /etc/pacman.d/mirrorlist
sudo pacman -Syy
sudo pacman -S bash-completion
sudo systemctl enable --now reflector.timer
sudo systemctl enable --now fstrim.timer
  • install graphic
sudo pacman -S xf86-video-intel xorg i3 dmenu lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings ttf-dejavu ttf-liberation noto-fonts firefox nitrogen picom lxappearance pcmanfm materia-gtk-theme papirus-icon-theme xfce4-terminal archlinux-wallpaper
  • enable lightdm
sudo systemctl enable lightdm

Keyboard X11

Either:

  • create /etc/X11/xorg.conf.d/00-keyboard.conf and change it according to previous config for XkbModel
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "fr"
        Option "XkbModel" "pc105"
EndSection

Or: (to test)

localectl set-x11-keymap fr

reboot