#!/bin/bash -x # Copyright (C) 2016 Ian Kelling # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR # note, when I did genfstab, i # neeeded to to do for x in mv /etc/*.pacorig; do mv $x ${x%.pacorig}; done pacman -Syu [[ -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 --follow-symlinks '/^ *MODULES *=.*btrfs/!s/^( *MODULES *=.*)"/\1 btrfs"/' /etc/mkinitcpio.conf # # remove extra space # sed -ri --follow-symlinks '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 ) # If we have more than 1 to decrypt, arch wiki lead me onto # a sort of hacky way run the encrypt hook multiple times. # 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 --follow-symlinks -f - /etc/mkinitcpio.conf < /etc/systemd/network/wired.network < /etc/systemd/network/br0.network < /etc/systemd/network/br0.netdev <