Skip to content

Instantly share code, notes, and snippets.

@dnldsht
Forked from njam/arch-linux
Last active April 16, 2018 04:15
Show Gist options
  • Save dnldsht/6a9486efef71ba878f78d0c915983dc9 to your computer and use it in GitHub Desktop.
Save dnldsht/6a9486efef71ba878f78d0c915983dc9 to your computer and use it in GitHub Desktop.
Install Arch Linux on XPS 13 9360
# Installation on Dell XPS
# Please also consult official docu:
# 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)
# Boot from the usb.
# F12 to enter boot menu
# Connect to Internet
wifi-menu
# Sync clock
timedatectl set-ntp true
# Create two partitions:
# 1 512MB EFI partition # Hex code ef00
# 2 100% Linux partiton (to be encrypted) # Hex code 8300
cgdisk /dev/nvme0n1
mkfs.fat -F32 /dev/nvme0n1p1
# Setup the encryption of the system
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 luks
# Create LVM partitions
# This creates partitions for root and /home, no /swap.
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate -L 50G vg0 --name root
lvcreate -l +100%FREE vg0 --name home # 80% leaves some space for snapshots
mkfs.ext4 /dev/mapper/vg0-root
mkfs.ext4 /dev/mapper/vg0-home
# Mount the new system
# /mnt is the system to be installed
mount /dev/mapper/vg0-root /mnt
mkdir /mnt/home
mount /dev/mapper/vg0-home /mnt/home
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
# Install the base system plus a few packages
pacstrap /mnt base zsh vim git sudo efibootmgr wpa_supplicant dialog iw
# Generate fstab
genfstab -L /mnt >> /mnt/etc/fstab
# Verify and adjust /mnt/etc/fstab
# Change relatime on all non-boot partitions to noatime (reduces wear if using an SSD)
# 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 # Comment out "en_US.UTF-8", "de_CH.UTF-8"
locale-gen
# Set locale
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
# Set keyboard layout and font
echo 'KEYMAP=de_CH-latin1' > /etc/vconsole.conf
echo 'FONT=latarcyrheb-sun32' >> /etc/vconsole.conf
# Set the hostname
echo '<hostname>' > /etc/hostname
# 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
# Add 'ext4 dm_snapshot' to MODULES
# https://wiki.archlinux.org/index.php/LVM#Configure_mkinitcpio
# Change: HOOKS="base udev autodetect keyboard keymap consolefont modconf block encrypt lvm2 filesystems fsck"
# 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 cryptdevice=UUID=<device-UUID>:root root=/dev/mapper/vg0-root rw
---
# Set default bootloader entry
---
/boot/loader/loader.conf
---
default arch
---
# Exit and reboot
exit
reboot
# 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
---
# Follow the docu to "power down discrete GPU":
# https://wiki.archlinux.org/index.php/hybrid_graphics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment