set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-cd $(dirname $(readlink -f "$BASH_SOURCE"))
+x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*}
export HOSTNAME="$1"
mirror=$2
# to be idempotent if we fail after partitioning
already_partitioned=true
mount_out=$(mount)
-for dir in /mnt{,/home,/boot,/q}; do
+for dir in /mnt{,/home,/boot,/a}; do
regex=" on $dir "
if [[ ! $mount_out =~ $regex ]]; then
already_partitioned=false
if ! $already_partitioned; then
mount -o subvol=root_$DISTRO $ROOT_PARTITION /mnt
- mkdir -p /mnt/{q,home,boot}
- mount -o subvol=q $ROOT_PARTITION /mnt/q
+ mkdir -p /mnt/{a,home,boot}
+ mount -o subvol=a $ROOT_PARTITION /mnt/a
mount -o subvol=boot_$DISTRO $BOOT_PARTITION /mnt/boot
fi
mkdir -p $mountpoint
mount -o bind $source $mountpoint
}
-bindmount /a /mnt/a
bindmount /root/shadow /mnt/q/root/shadow
mkdir -p /mnt/etc/ssh