minor fixes, dns, new os versions
[automated-distro-installer] / fai / config / hooks / partition.DEFAULT
index 3d024af5dbcc789939423f3afa2fc14089677d86..ea8d2378039860719cd3e46da40f30d19d979425 100755 (executable)
@@ -25,12 +25,12 @@ if [[ $EUID != 0 ]]; then
 fi
 
 # for calling outside of FAI:
-# # need to redep and set that location so that we get luks keys
-# export FAI=/srv/fai/config
 # fai-redep
+# s
 # source /b/fai/fai-wrapper
 # - set any appropriate classes with: fai-setclass OPT1... which sets CLASS_OPT1=true...
 #   or run eval-fai-classfile FILE
+# export luks_dir=/q/root/luks
 #
 # OPTIONS:
 #
@@ -325,6 +325,8 @@ if [[ ! $DISTRO ]]; then
     DISTRO=trisquelflidas
   elif ifclass VOL_ETIONA; then
     DISTRO=trisqueletiona
+  elif ifclass VOL_NABIA; then
+    DISTRO=trisquelnabia
   else
     echo "PARTITIONER ERROR: no distro class/var set" >&2
     exit 1
@@ -342,33 +344,33 @@ bpart() { # btrfs a partition
 }
 
 
-if [[ ! -e /a/bin/fai/fai-wrapper ]]; then
+if [[ ! $luks_dir ]]; then
   # see README for docs about how to create these
   luks_dir=$FAI/distro-install-common/luks
+fi
 
-  luks_file=$luks_dir/host-$HOSTNAME
-  if [[ ! -e $luks_file ]]; then
-    hostkeys=($luks_dir/host-*)
-    # if there is only one key, we might be deploying somewhere
-    # where dhcp doesnt give us a proper hostname, so use that.
-    if [[ ${#hostkeys[@]} == 1 && -e ${hostkeys[0]} ]]; then
-      luks_file=${hostkeys[0]}
-    else
-      echo "$0: error: no key for hostname at $luks_file" >&2
-      exit 1
-    fi
-  fi
-
-  # # note, corresponding changes in /b/ds/keyscript-{on,off}
-  if ifclass demohost; then
-    lukspw=x
-  elif [[ -e $luks_dir/$HOSTNAME ]]; then
-    lukspw=$(cat $luks_dir/$HOSTNAME)
+luks_file=$luks_dir/host-$HOSTNAME
+if [[ ! -e $luks_file ]]; then
+  hostkeys=($luks_dir/host-*)
+  # if there is only one key, we might be deploying somewhere
+  # where dhcp doesnt give us a proper hostname, so use that.
+  if [[ ${#hostkeys[@]} == 1 && -e ${hostkeys[0]} ]]; then
+    luks_file=${hostkeys[0]}
   else
-    lukspw=$(cat $luks_dir/iank)
+    echo "$0: error: no key for hostname at $luks_file" >&2
+    exit 1
   fi
 fi
 
+# # note, corresponding changes in /b/ds/keyscript-{on,off}
+if ifclass demohost; then
+  lukspw=x
+elif [[ -e $luks_dir/$HOSTNAME ]]; then
+  lukspw=$(cat $luks_dir/$HOSTNAME)
+else
+  lukspw=$(cat $luks_dir/iank)
+fi
+
 
 first_root_crypt=$(root-cryptdev ${devs[0]})
 
@@ -471,7 +473,7 @@ if $partition; then
     # This is just a bit more robust, and it could work for booting
     # into ipxe which can't persist data, if we ever got that working.
     mkfs.ext2 $(grub_extdev)
-    # when we move to newer than trisquel 8, we can remove
+    # when we move to newer than trisquel 9, we can remove
     # --type luks1. We can also check on cryptsetup --help | less /compil
     # to see about the other settings. Default in debian 9 is luks2.
     # You can convert from luks2 to luks 1 by adding a temporary key: