Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkvk/502bbf638a6372c077e1695a520e3953 to your computer and use it in GitHub Desktop.
Save pkvk/502bbf638a6372c077e1695a520e3953 to your computer and use it in GitHub Desktop.
Install Archlinux on XPS 13 9370 DualBoot
# Resource
# https://gist.github.com/brammitch/281e9a2f3aca57ae4a333fc63732f602
# https://wiki.archlinux.org/index.php/Installation_guide
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9370)
# Enter BIOS with F2 and configure:
# - "System Configuration" > "SATA Operation": "AHCI"
# - "Secure Boot" > "Secure Boot Enable": "Disabled"
# Set the keyboard layout and font
# loadkeys it
setfont latarcyrheb-sun32
# Verify the boot mode
ls /sys/firmware/efi/efivars
# Connect to the Internet
# If you have a WPA2 Enterprise (user+password) setup netctl or easly use NetShare android app (wifi bridge)
wifi-menu -o
# if you need to use a proxy (e.g. NetShare)
# export http_proxy=172.25.21.6:44355
# Update the system clock
timedatectl set-ntp true
# Check service status
timedatectl status
# if under a proxy (e.g. NetShare app), set the date manually: date +%T -s "11:14:00" and execute timedatectl after installation
# Resizing partitions
# parted resize documentation
# Partition the disks
# EFI partition will not be created since we are dual booting
# Existing EFI partition will be mounted to /boot
# Identify disks
lsblk
cgdisk /dev/nvme0n1
# Create a swap partition
# Create 100% LVM partition
# Exit cgdisk
# List devices for LVM
lvmdiskscan
# Create physical volume
pvcreate /dev/nvme0n1p5
# Verify physical volumes
pvdisplay
# Create volume group
vgcreate xps_vg /dev/nvme0n1p5
# Verify volume groups
vgdisplay
# Create logical volumes
lvcreate -l100%FREE xps_vg -n lv_root
#lvcreate -L 40G xps_vg -n lv_home
# Verify logical volumes
lvdisplay
# Format the partitions
# Format /root and /home as ext4
mkfs.ext4 /dev/xps_vg/lv_root
#mkfs.ext4 /dev/xpsvg/lvhome
# Setup swap partition
mkswap /dev/nvme0n1p4
swapon /dev/nvme0n1p4
# Mount the file systems
# Mount /root
mount /dev/xps_vg/lv_root /mnt
# Mount /home
mkdir /mnt/home
# mount /dev/xps_gv/lv_home /mnt/home
# Mount existing EFI partition
mkdir /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
# Select mirrors
# Edit mirros list
vim /etc/pacman.d/mirrorlist
# Install the base packages
pacstrap /mnt base vim git efibootmgr wpa_supplicant iw zsh dialog binutils make base-devel
# Configure the system
# Fstab
# Generate an fstab file
genfstab -L /mnt >> /mnt/etc/fstab
# Verify and adjust /mnt/etc/fstab
# Chroot
# Change root into the new system
arch-chroot /mnt
pacman -S sudo
# Time zone
# Set the time zone
ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
# Generate /etc/adjtime
hwclock --systohc
# Locale
# Uncomment en_US.UTF-8 UTF-8 in /etc/locale.gen and generate them with
locale-gen
# Set the LANG variable in /etc/locale.conf
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
# Set keyboard font
echo 'FONT=latarcyrheb-sun32' > /etc/vconsole.conf
# Set keyboard layout
# echo 'KEYMAP=it' >> /etc/vconsole.conf
# 3.5 Hostname
echo 'arch-xps' > /etc/hostname
vi /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch-xps.localdomain arch-xps
# Initramfs
# Get rid of errors for psmouse
echo 'blacklist psmouse' >> /etc/modprobe.d/modprobe.conf
# Configure mkinitcpio
vi /etc/mkinitcpio.conf
# Update HOOKS=(...) to add: systemd sd-vconsole sd-lvm2
# note: s/udev/systemd/ and sd-lvm2 before filesystem
# Update FILES=(/etc/modprobe.d/modprobe.conf)
# Generate initrd image
mkinitcpio -p linux
# Add user
useradd -m -g users -G wheel -s /bin/zsh <username>
# Set password
passwd <username>
# Enable wheel group as sudoers
visudo
# Uncomment %wheel ALL=(ALL) ALL
# Disable root user
passwd -l root
# Boot loader
# Setup systemd-boot
bootctl --path=/boot install
# Enable Intel microcode updates
pacman -S intel-ucode
# Create bootloader entry
vi /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=/dev/xps_vg/lv_root rw quiet mem_sleep_default=deep
# mem_sleep_default=deep solves the problem with battery drain
# while in sleep mode
# Set default bootloader entry
vi /boot/loader/loader.conf
timeout 8
default arch
editor 0
# Reboot
exit
umount -R /mnt
reboot
# Post-installation
# zsh home-end key fix
# http://zshwiki.org/home/zle/bindkeys#reading_terminfo
# ...and ctrl+r
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
# Connect to wifi
sudo wifi-menu -o
# if you need to use a proxy (e.g. NetShare)
export http_proxy=172.25.21.6:44355
# Install Intel graphic drivers (-E if you use http_proxy)
sudo -E pacman -S xf86-video-intel
sudo -E pacman -S xorg-server
# sudo -E plasma-meta kde-applications-meta
sudo systemctl enable --now sddm.service
sudo systemctl enable --now NetworkManager.service
# Install pacaur
su - <username>
mkdir aur
cd aur
git clone https://aur.archlinux.org/cower.git
cd cower
makepkg -si --skipinteg
cd ..
git clone https://aur.archlinux.org/pacaur.git
cd pacaur
makepkg -si
# Enable fstrim
sudo systemctl enable --now fstrim.timer
# set issue_discards=1 in /etc/lvm/lvm.conf
# Firmware update
sudo pacman -S fwupd
fwupdmgr refresh
fwupdmgr get-updates
fwupdmgr update
# /etc/sddm.conf
# [X11]
# ServerArguments=-nolisten tcp -dpi 276
# Useful programs
pacaur -S chromium
pacaur -S libreoffice-fresh hunspell hunspell-it hunspell-en_US
pacaur -S breeze-gtk kde-gtk-config
pacaur -S ttf-bitstream-vera ttf-croscore ttf-dejavu ttf-droid ttf-roboto noto-fonts ttf-liberation ttf-ubuntu-font-family
pacaur -S cups cups-pdf
pacaur -S copyqp
pacaur -S kdeconnect
pacaus -S keeweb-desktop
pacaur -S syncthing
# TODO:
https://github.com/systemd/systemd/issues/2750
https://bbs.archlinux.org/viewtopic.php?pid=1775108#p1775108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment