Last active
January 6, 2021 08:13
-
-
Save emersion/0dc5ca593224bbe2598d9a40fc5235b7 to your computer and use it in GitHub Desktop.
Arch Linux installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Arch Linux installation | |
# - EFI with systemd-boot | |
# - LUKS encryption | |
# - BTRFS with two subvolumes: @root and @home | |
# - Intel/AMD ucode | |
# See https://wiki.archlinux.org/index.php/Installation_guide | |
# Connect to the Internet | |
ls /sys/firmware/efi/efivars # Check EFI | |
timedatectl set-ntp true | |
cgdisk /dev/sda # Create partitions: ESP (type EFI, min 512MiB), cryptroot (type Linux) | |
fdisk -l | |
# Setup root | |
cryptsetup luksFormat /dev/sda2 | |
cryptsetup open /dev/sda2 root | |
mkfs.btrfs -L root /dev/mapper/root | |
mount /dev/mapper/root /mnt | |
btrfs subvolume create /mnt/@root | |
btrfs subvolume create /mnt/@home | |
umount /mnt | |
mount /dev/mapper/root /mnt -o subvol=/@root | |
mkdir /mnt/home | |
mount /dev/mapper/root /mnt/home -o subvol=/@home | |
# Setup ESP, see https://wiki.archlinux.org/index.php/EFI_System_Partition | |
mkfs.fat -F32 /dev/sda1 | |
mkdir /mnt/boot | |
mount /dev/sda1 /mnt/boot | |
vim /etc/pacman.d/mirrorlist # Select mirrors | |
pacstrap /mnt base linux linux-firmware base-devel | |
genfstab -U /mnt >> /mnt/etc/fstab | |
vim /mnt/etc/fstab | |
arch-chroot /mnt | |
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime | |
hwclock --systohc | |
vim /etc/locale.gen | |
locale-gen | |
vim /etc/locale.conf # LANG=en_US.UTF-8 | |
vim /etc/hostname | |
pacman -S intel-ucode # or amd-ucode | |
bootctl --path=/boot install | |
# TODO: install systemd-boot-pacman-hook? | |
vim /boot/loader/entries/arch.conf | |
# title Arch Linux | |
# linux /vmlinuz-linux | |
# initrd /intel-ucode.img | |
# initrd /initramfs-linux.img | |
# options cryptdevice=PARTLABEL=cryptroot:root:allow-discards root=/dev/mapper/root quiet rw rootflags=subvol=@root | |
pacman -S btrfs-progs | |
vim /etc/mkinitcpio.conf # Add "encrypt" to HOOKS | |
mkinitcpio -P | |
passwd | |
pacman -S fish | |
useradd -m -g wheel -s /usr/bin/fish simon | |
passwd simon | |
pacman -S opendoas | |
echo "permit :wheel" >> /etc/doas.conf | |
# https://wiki.archlinux.org/index.php/Getty#Automatic_login_to_virtual_console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment