-
-
Save chowdhary/f5dc4a8a2d04e21c26ae509641e0415f to your computer and use it in GitHub Desktop.
Install Arch Linux on XPS 13 9360
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_(9360) | |
# https://wiki.archlinux.org/index.php/Dell_XPS_15_(9550) | |
# 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_CH-latin1 | |
# Set large font | |
setfont latarcyrheb-sun32 | |
# Connect to Internet | |
wifi-menu | |
# Sync clock | |
timedatectl set-ntp true | |
# Create two partitions: | |
# 1 1000MB EFI partition # Hex code ef00 | |
# 2 100% Linux partiton (to be encrypted) # Hex code 8300 | |
cgdisk /dev/nvme0n1 | |
# Formatting and encyption | |
mkfs.fat -F32 /dev/nvme0n1p1 | |
cryptsetup luksFormat /dev/nvme0n1p2 | |
cryptsetup open /dev/nvme0n1p2 luks | |
mkfs.btrfs -L luks /dev/mapper/luks | |
# Create btrfs subvolumes | |
mount -t btrfs /dev/mapper/luks /mnt | |
btrfs subvolume create /mnt/@root | |
btrfs subvolume create /mnt/@var | |
btrfs subvolume create /mnt/@home | |
btrfs subvolume create /mnt/@snapshots | |
# Mount btrfs subvolumes | |
umount /mnt | |
mount -o subvol=@root /dev/mapper/luks /mnt | |
mkdir /mnt/{var,home,.snapshots} | |
mount -o subvol=@var /dev/mapper/luks /mnt/var | |
mount -o subvol=@home /dev/mapper/luks /mnt/home | |
mount -o subvol=@snapshots /dev/mapper/luks /mnt/.snapshots | |
# Mount EFI partition | |
mkdir /mnt/boot | |
mount /dev/nvme0n1p1 /mnt/boot | |
# Change pacman mirror priority, move closer mirror to the top | |
vi /etc/pacman.d/mirrorlist | |
# Install the base system plus a few packages | |
pacstrap /mnt base btrfs-progs zsh vim git sudo efibootmgr wpa_supplicant dialog iw | |
# Generate fstab | |
genfstab -L /mnt >> /mnt/etc/fstab | |
# Verify and adjust /mnt/etc/fstab | |
# For all btrfs filesystems consider: | |
# - Change "relatime" to "noatime" to reduce wear on SSD | |
# - Adding "discard" to enable continuous TRIM for SSD | |
# - Adding "autodefrag" to enable online defragmentation | |
# Enter the new system | |
arch-chroot /mnt | |
# Setup time | |
ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime | |
hwclock --systohc | |
# Generate required locales | |
vi /etc/locale.gen # Uncomment desired locales, e.g. "en_US.UTF-8", "de_CH.UTF-8" | |
locale-gen | |
# Set desired locale | |
echo 'LANG=en_US.UTF-8' > /etc/locale.conf | |
# Set desired keymap and font | |
echo 'KEYMAP=us' > /etc/vconsole.conf | |
echo 'FONT=latarcyrheb-sun32' >> /etc/vconsole.conf | |
# Set the hostname | |
echo '<hostname>' > /etc/hostname | |
# Add to hosts | |
echo '127.0.1.1 <hostname>.localdomain <hostname>' >> /etc/hosts | |
# Set password for root | |
passwd | |
# Add real user | |
useradd -m -g users -G wheel -s /bin/zsh <username> | |
passwd <username> | |
echo '<username> ALL=(ALL) ALL' > /etc/sudoers.d/<username> | |
# Configure mkinitcpio with modules needed for the initrd image | |
vi /etc/mkinitcpio.conf | |
# Change: HOOKS="base systemd autodetect modconf block keyboard sd-vconsole 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 rootflags=subvol=@root | |
--- | |
# Set default bootloader entry | |
--- | |
/boot/loader/loader.conf | |
--- | |
default arch | |
--- | |
# Exit and reboot | |
exit | |
reboot |
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
# Disable the Nvidia GPU on the XPS 15 | |
# Install intel graphics driver | |
sudo pacman -S xf86-video-intel | |
# Blacklist nvidia/nouveau drivers | |
--- | |
/etc/modprobe.d/nvidia.conf | |
--- | |
blacklist nvidia | |
blacklist nouveau | |
--- | |
# Install acpi_call: | |
pacaur -S acpi_call-dkms linux-headers | |
# Follow the docu to "power down discrete GPU": | |
# https://wiki.archlinux.org/index.php/hybrid_graphics | |
sudo modprobe acpi_call | |
sudo /usr/share/acpi_call/examples/turn_off_gpu.sh 2>/dev/null | grep works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment