small fixes and config changes
[automated-distro-installer] / fai / config / hooks / partition.DEFAULT
index c2b73cbc5f63217d83bde84187428a32231cd669..fac3155a98e03cb3f08e25eb32f1f1d24b4f8bb5 100755 (executable)
@@ -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`)