#!/bin/bash -x set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR for x in /etc/*.pacorig; do # This started breaking immediately when I stoped doing genfstab. # It's probably not needed anymore [[ -e $x ]] || break mv $x ${x%.pacorig} done echo $hostname > /etc/hostname [[ -L /etc/localtime ]] || ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime l=en_US.UTF-8 echo "$l UTF-8" > /etc/locale.gen locale-gen echo "LANG=$l" > /etc/locale.conf # if coming from windows, and you had to set the time, do this # hwclock --systohc --utc # A password is required to access the volume: # Command requires device and ampped name as arguments # If we were using btrfs raid, we supposedly would need this. # # add btrfs as module instead of hook due to # # https://wiki.archlinux.org/index.php/Btrfs, # # https://bugs.archlinux.org/task/42884 # # disabled, as with just the module, startup spammed something about # # command takes a device name and something else. # sed -ri '/^ *MODULES *=.*btrfs/!s/^( *MODULES *=.*)"/\1 btrfs"/' /etc/mkinitcpio.conf # # remove extra space # sed -ri 's/^( *MODULES *=[^"]*)" */\1"/' /etc/mkinitcpio.conf # for desktop without full fs encryption, use this: #cat > /etc/crypttab <<'EOF' #tmp /dev/lvm/tmp /dev/urandom tmp,cipher=aes-xts-plain64,size=256 # otgherwise ERROR: file not found: `fsck.btrfs' pacman -S --noconfirm btrfs-progs pacman -S --noconfirm grub gptfdisk shopt -s extglob echo "$0: fstab:" cat /etc/fstab # https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#Boot_loader # if cryptdevice was lvm, it woulde be in this format, # where x2-vg is from lvdisplay, VG Name field. # cryptdevice=/dev/disk/by-uuid/585dff23-136f-446f-815f-01053b70c957:x2-vg # but, if you are using your own fstab, it seems you just give it a name, # which will be the crypt device name under /dev/mapper/ # https://wiki.archlinux.org/index.php/GRUB#Additional_arguments root_devs=( ${ROOT_PARTITIONS} ) first_root_dev=${root_devs[0]} k_args=( cryptdevices=${ROOT_PARTITIONS// /,} root=/dev/mapper/crypt_dev_${first_root_dev##*/} resume=${first_root_dev%[0-9]}$swapn ) extra_encrypt_hooks=() # If we have more than 1 to decrypt, arch wiki lead me onto # a sort of hacky way run the encrypt hook multiple times. base=/usr/lib/initcpio # https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio_2 # used to have lvm2 after encrypt for lvm, but not using lvm anymore for x in encrypt btrfs; do sed -ri -f - /etc/mkinitcpio.conf < /etc/systemd/network/wired.network < /etc/systemd/network/br0.network < /etc/systemd/network/br0.netdev <