You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

236 lines
4.7 KiB
Markdown

# How to install arch on the hp omen
## Disk Layout
We're using the following disks
```
/dev/nvme0n1 - 500GiB m.2 SSD
/dev/sda - 2TB SATA SSD
```
## Partitioning
We're creating three partitions. One EFI, one root and one home partition.
The root and home partition are to be encrypted with dm-crypt.
```sh
fdisk /dev/nvme0n1
> g # gpt partition table
> n
> <Enter> # starting from the beginning
> +500M # 500 MiB
> t 1 # EFI partition
> n # new partition
> <Enter> #
> <Enter> # use the remaining size of the disk
> w
> q
fdisk /dev/sda
> g
> n
> <Enter>
> <Enter> # use the whole disk
> w
> q
# Create the encrypted root partition
cryptsetup -cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/nvme0n1p2
# Create the encrypted home partition
cryptsetup -cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/sda1
# Open the devices
cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
cryptsetup luksOpen /dev/sda1 crypthome
# Create the filesystems
mkfs.fat -F 32 /dev/nvme0n1p1
mkfs.btrfs /dev/mapper/cryptroot
mkfs.btrfs /dev/mapper/crypthome
# mount the partitions in the correpsonding paths
mount /dev/mapper/cryptroot /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
mkdir /mnt/home
mount /dev/mapper/crypthome /mnt/home
```
## Pacstrap
```sh
# install base, kernels, firmware and utils
pacstrap -i /mnt base base-devel linux linux-zen linux-firmware intel-ucode vim nushell
```
## Steps in Chroot
```sh
# enter new root
arch-chroot /mnt
```
### Timezone and Time
```sh
# Uncomment at least one desired locale
vim /etc/locale.gen
locale-gen
# Use your main locale
echo LANG=en_GB.UTF-8 /etc/locale.conf
export LANG=en_GB.UTF-8
# Timezone info
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localetime
# Configure hwclock to utc
hwclock --systohc --utc
# Set the keyboard layout
echo KEYMAP=de > /etc/vconsole.conf
```
### Pacman
Open `/etc/pacman.conf` and uncomment `Color` and `ParallelDownlods=5` as well
as the section containing the `multilib` repository
### Users
```sh
# set the root password
passwd
# Add a user (this one is called trivernis)
useradd -m -G wheel -s /bin/nu trivernis
# Change the user's password
passwd trivernis
# Enable the wheel group
EDITOR=/bin/vim visudo # uncomment the corresponding line
```
### Bootloader (systemd-boot)
Add mkinitcpio hooks
```sh
# TODO
```
```sh
# Generate initrds
mkinitcpio -P
bootctl install
```
Create records in /boot/loader/entries/
```sh
# arch-zen.conf
title Arch Linux (linux-zen)
linux /vmlinuz-linux-zen
initrd /intel-ucode.img
initrd /initramfs-linux-zen.img
options cryptdevice=/dev/nvme0n1p2:cryptroot root=/dev/mapper/cryptroot zswap.enabled=1 intel_pstate=no_hwp rootfstype=btrfs
```
```sh
# arch.conf
title Arch Linux (linux)
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options cryptdevice=/dev/nvme0n1p2:cryptroot root=/dev/mapper/cryptroot zswap.enabled=1 intel_pstate=no_hwp rootfstype=btrfs
```
```sh
# arch-fallback.conf
title Fallback Arch Linux (linux)
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux-fallback.img
options cryptdevice=/dev/nvme0n1p2:cryptroot root=/dev/mapper/cryptroot zswap.enabled=1 intel_pstate=no_hwp rootfstype=btrfs
```
Configure the bootloader with `/boot/loader/loader.conf`
```sh
timeout 2
default arch-zen.conf
console-mode max
````
### Disks
```sh
# Create key for /home cryptdevice
mkdir /etc/keys
chmod 700 /etc/keys
dd bs=512 count=4 if=/dev/random of=/etc/keys/crypthome.key iflag=fullblock
chmod 600 /etc/key/crypthome.key
cryptsetup luksAddKey /dev/sda1 /etc/keys/crypthome.key
```
Edit `/etc/cryptab` And add the device with the created key
### Networking
```sh
# set the hostname
echo archomen > /etc/hostname
# Install the networkmanager
pacman -S networkmanager
systemctl enable NetworkManager.service --now
```
### Desktop Environment (KDE)
```sh
# Install audio support
pacman -S pulseaudio
# install KDE. Choose
# > noto-fonts
# > pipewire-jack
# > wireplumber
# > phonon-qt5-gstreamer
# in the selection prompts
pacman -S sddm plasma plasma-wayland-session xorg-xwayland xdg-desktop-portal-kde plasma-nm plasma-pa kwallet5 kwallet-pam kwalletmanager
# Enable sddm on startup
systemd enable sddm
```
### PRIME Offloading
Make sure to remove `kms` from the `/etc/mkinitcpio.conf` HOOKS section
```sh
# Install nvidia drivers
pacman -S linux-headers linux-zen-headers dkms nvidia-dkms prime nvidia-utils lib32-nvidia-utils
```
### Yay
```sh
pacman -S git
git clone https://aur.archlinux.org/yay.gi
cd yay
makepkg -si
```
### Swap
See [BTRFS Swap](https://wiki.archlinux.org/title/Btrfs#Swap_file)