Last active
April 2, 2022 15:12
-
-
Save mordax7/50337dab53770893dd93b4738507b48e to your computer and use it in GitHub Desktop.
Install Arch Linux on Dell XPS 13 9300
This file contains 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
# Installation on Dell XPS | |
# Please also consult official documentation: | |
# https://wiki.archlinux.org/index.php/Installation_Guide | |
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9300) | |
# Enter BIOS with F2 and configure: | |
# - "System Configuration" > "SATA Operation": "AHCI" | |
# - "Secure Boot" > "Secure Boot Enable": "Disabled" | |
# Enter boot menu with F12, and boot the Arch USB medium | |
# Set desired keymap | |
loadkeys de | |
# Connect to Internet | |
iwctl | |
# First, if you do not know your wireless device name, list all Wi-Fi devices: | |
[iwd]# device list | |
# Then, to scan for networks: | |
[iwd]# station device scan | |
# You can then list all available networks: | |
[iwd]# station device get-networks | |
# Finally, to connect to a network: | |
[iwd]# station device connect SSID | |
# Sync clock | |
timedatectl set-ntp true | |
# Create three partitions: | |
# 1 1024MB EFI partition # Hex code ef00 | |
# 2 4096MB SWAP partition # Hex code 8200 | |
# 3 100% Linux partition (to be encrypted) # Hex code 8300 | |
# CAUTION: Find the correct disk/partition names for yourself using `lsblk`. From here on I am using mine as an example. | |
# Do not blindly copy paste these, it might not work or you might destroy partitions you don't want to destroy. | |
cgdisk /dev/nvme0n1 | |
# Install f2fs-tools(I am using f2fs throughout the whole guide as my file system type) | |
pacman -Sy f2fs-tools | |
# Formatting and encryption | |
# Boot partition | |
mkfs.fat -F32 /dev/nvme0n1p1 | |
# SWAP partition | |
mkswap /dev/nvme0n1p2 | |
swapon /dev/nvme0n1p2 | |
# Root partition | |
cryptsetup luksFormat --type=luks2 /dev/nvme0n1p3 | |
cryptsetup open /dev/nvme0n1p3 luks | |
mkfs.f2fs -l luks /dev/mapper/luks | |
# Mount root and boot partition | |
mount /dev/mapper/luks /mnt | |
mkdir /mnt/boot && mount /dev/nvme0n1p1 /mnt/boot | |
# Change pacman mirror priority, move closer mirror to the top | |
vim /etc/pacman.d/mirrorlist | |
# Install the base system plus a few packages | |
pacstrap /mnt base linux linux-firmware sudo efibootmgr dialog f2fs-tools neovim fish yadm | |
# Generate fstab | |
genfstab -L /mnt >> /mnt/etc/fstab | |
# Enter the new system | |
arch-chroot /mnt | |
# Setup time | |
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime | |
hwclock --systohc | |
# Generate required locales | |
nvim /etc/locale.gen # Uncomment desired locales, e.g. "en_US.UTF-8", "de_DE.UTF-8" | |
locale-gen | |
# Set desired locale | |
echo 'LANG=en_US.UTF-8' > /etc/locale.conf | |
# Set desired keymap | |
echo 'KEYMAP=de-latin1-nodeadkeys' > /etc/vconsole.conf | |
# Set the hostname | |
echo '<hostname>' > /etc/hostname | |
# Add hostname to /etc/hosts: | |
--- | |
/etc/hosts | |
--- | |
127.0.0.1 localhost | |
::1 localhost | |
127.0.1.1 <hostname>.localdomain <hostname> | |
--- | |
# Set password for root | |
passwd | |
# Add real user | |
useradd -m -g users -s /bin/fish <username> | |
passwd <username> | |
# Configure mkinitcpio with modules needed for the initrd image | |
nvim /etc/mkinitcpio.conf | |
# Add: MODULES=(crypto-crc32) | |
# Change: HOOKS=(base systemd autodetect modconf block keyboard keymap sd-encrypt filesystems) | |
# Regenerate initrd image | |
mkinitcpio -p linux | |
# Setup systemd-boot | |
bootctl --path=/boot install | |
# Enable Intel microcode updates | |
pacman -S intel-ucode | |
# Create bootloader entry | |
# Get luks-uuid with: `cryptsetup luksUUID /dev/nvme0n1p2` | |
--- | |
/boot/loader/entries/arch.conf | |
--- | |
title Arch Linux | |
linux /vmlinuz-linux | |
initrd /intel-ucode.img | |
initrd /initramfs-linux.img | |
options rw luks.uuid=<uuid> luks.name=<uuid>=luks root=/dev/mapper/luks | |
--- | |
# Set default bootloader entry | |
--- | |
/boot/loader/loader.conf | |
--- | |
default arch | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment