Last active
May 14, 2019 22:23
-
-
Save kvnxiao/2b9843476497fb5bdabbc69b2b9c8a86 to your computer and use it in GitHub Desktop.
arch-linux-install-xps-15-9550-2019-02-18
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
# Arch Linux wiki for Dell XPS 15 9550 | |
# https://wiki.archlinux.org/index.php/Dell_XPS_15_(9550) | |
### INTRODUCTION | |
# A simple dual-boot UEFI installation for Arch Linux without any file system encryption. | |
# Assumes that Windows has already been installed beforehand | |
# Follows the official installation guide: (https://wiki.archlinux.org/index.php/installation_guide) | |
# Uses rEFInd boot manager as the UEFI boot manager (https://wiki.archlinux.org/index.php/REFInd) | |
### 1. DOWNLOAD TO USB | |
# a. Download the official Arch Linux ISO from https://www.archlinux.org/download/ | |
# b. Copy to a USB drive | |
# Windows users: use Rufus with default settings in ISO mode (https://rufus.ie/) | |
### 2. BIOS SETTINGS | |
# a. Disable secure boot on XPS 15 | |
# b. Ensure that the NVMe SSD is set to AHCI mode instead of RAID | |
# c. Boot from the USB | |
### 3. PRE-INSTALLATION | |
# a. Set keyboard layout if necessary. Defaults to US keyboard layout. | |
ls /usr/share/kbd/keymaps/**/*.map.gz # list available keyboard layouts | |
loadkeys $LAYOUT # loads keyboard layout -- replace $LAYOUT with layout | |
# b. Connect to WiFi | |
wifi-menu # (verify internet connection by pinging wiki.archlinux.org or google.com) | |
# c. Update system clock | |
timedatectl set-ntp true | |
# d. Disk Partitioning | |
fdisk -l # Find the main disk drive for partitioning | |
cgdisk $MAIN_DISK_DRIVE # e.g. cgdisk /dev/nvme0n1 | |
# example partitioning for dual-boot setup on a 512GB SSD | |
# swap - about 8GB - hex code 8200 (for Linux swap) | |
# root - about 64 GB - hex code 8304 (for Linux x86-64 root(/)) | |
# home - about 100 GB - hex code 8302 (for Linux /home) | |
# rest of drive already taken up by Windows install | |
# e. Format and initialize partitions | |
mkfs.ext4 $ROOT_PARTITION # e.g. /dev/nvme0n1p1 | |
mkfs.ext4 $HOME_PARTITION # e.g. /dev/nvme0n1p2 | |
mkswap $SWAP_PARTITION # e.g. /dev/nvme0n1p3 | |
swapon $SWAP_PARTITION | |
# f. Mount the file systems | |
mount $ROOT_PARTITION /mnt | |
mount $HOME_PARTITION /mnt/home | |
mkdir -p /mnt/boot/efi | |
# Mount the boot EFI partition. This is the drive partition that shows up with EFI label from fdisk -l | |
mount $EFI_PARTITION /mnt/boot/efi | |
### 4. INSTALLATION | |
# a. Install to mounted partitions | |
pacstrap /mnt base base-devel zsh vim git efibootmgr refind-efi dialog wpa_supplicant | |
# b. Generate fstab | |
genfstab -U /mnt >> /mnt/etc/fstab | |
# Ensure that the fstab contains declarations in /mnt/etc/fstab | |
# c. Enter the new system with chroot | |
arch-chroot /mnt /bin/bash # use bash in chroot | |
# d. Setup system clock and timezone | |
ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime # set time zone | |
# e.g. ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime | |
hwclock --systohc # generates /etc/adjtime for UTC | |
# e. Localization | |
# uncomment en_US.UTF-8 UTF-8 and other locales in /etc/locale.gen, then run: | |
locale-gen | |
echo LANG=en_US.UTF-8 >> /etc/locale.conf | |
echo LC_ALL=C >> /etc/locale.conf | |
# f. Hostname | |
echo $HOSTNAME > /etc/hostname | |
# g. Recreate initramfs (if necessary) | |
mkinitcpio -p linux | |
# e. Set root password | |
passwd | |
# f. Add a real user (use /bin/zsh for shell) | |
useradd -m -g users -G wheel -s /bin/zsh $USER_NAME | |
passwd $USER_NAME # set user password | |
### 5. REFIND-EFI SETUP | |
## NOTICE: When refind-install is run in chroot, /boot/refind_linux.conf is populated with kernel options from the live USB, not the one on which it is installed. | |
## The below steps are to install refind and fix the boot parameters | |
# a. Run refind-install script | |
refind-install | |
# b. Edit refind_linux.conf in /boot/ folder | |
# ensure that /boot/refind_linux.conf has the correct entries | |
# e.g. | |
# "Boot using default options" "root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw add_efi_memmap" | |
# c. Exit chroot | |
exit | |
# d. Unmount and reboot to new system (remember to unplug the USB) | |
umount -R /mnt | |
swapoff -a | |
reboot | |
### 6. NEW SYSTEM SETUP | |
## TODO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment