X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fpartition.DEFAULT;h=fac3155a98e03cb3f08e25eb32f1f1d24b4f8bb5;hb=4c0b3d508093cd1561f6ae887f154f06383b67d3;hp=317eb6d3b9b149069fcc3b0f8fce4c94da0ef93c;hpb=d3d495af167adba91b190e8dcb95649c34fa04c7;p=automated-distro-installer diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 317eb6d..fac3155 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -1,7 +1,7 @@ #!/bin/bash -x set -eE -o pipefail -trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR +trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR # # fai's setup-storage won't do btrfs on luks, # # so we do it ourself :) @@ -173,6 +173,12 @@ first_boot_dev=$(bootdev ${devs[0]}) # keyfiles generated like: # head -c 2048 /dev/urandom | od | s dd of=/q/root/luks/host-demohost luks_dir=${LUKS_DIR:-/var/lib/fai/config/distro-install-common/luks} + +if [[ ! -e $luks_dir/host-$HOSTNAME ]]; then + echo "$0: error: no key for hostname at $luks_dir/host-$HOSTNAME" >&2 + exit 1 +fi + if ifclass tp; then lukspw=$(cat $luks_dir/traci) else @@ -317,6 +323,13 @@ $first_root_crypt /home btrfs noatime,subvol=home_$DISTRO 0 0 $first_boot_dev /boot btrfs noatime,subvol=boot_$DISTRO 0 0 EOF + +if ifclass treetowl; then + cat >> /tmp/fai/fstab <<'EOF' +UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2 +EOF +fi + swaps=() for dev in ${devs[@]}; do swaps+=(`swap-cryptname`)