Merge branch 'upstream'
[automated-distro-installer] / fai / config / class / 50-host-classes
index 6f2e407979c754706c1eecbcd2b6facccdb463f6..61a55934d0054397c6c89c073942d5aca3f3e7ee 100755 (executable)
@@ -5,6 +5,9 @@
 # do not use this if a menu will be presented
 [ "$flag_menu" ] && exit 0
 
+# set these early so they are lowest priority.
+echo FAIBASE STANDARD DEBIAN
+
 
 # For multi-boot system.
 # We check that we aren't in a pxe boot environment.
@@ -17,7 +20,7 @@
 #
 # Each host defines following:
 # The base distro:
-# UBUNTU, DEBIAN
+# UBUNTU or nothing. DEBIAN is always defined as a base.
 #
 # The base disto version, only use so far is the basefile name if it exists.
 # Debian stable basefile gets built by faisetup and gets used otherwise.
 if [[ ! -e /a/bin/fai/fai-wrapper || $FAI_ACTION == dirinstall ]]; then
   case $HOSTNAME in
     # stretch based minimal recovery / bootstraping os:
-    _) echo DEBIAN STRETCH64 VOL_STRETCH_BOOTSTRAP STRETCH_FREE ;;
+    _) echo STRETCH64 VOL_STRETCH_BOOTSTRAP STRETCH_FREE ;;
     # flidas
     _) echo UBUNTU FLIDAS64 VOL_FLIDAS FLIDAS ;;
     # etiona
     _) echo UBUNTU ETIONA64 VOL_ETIONA ETIONA ;;
     # stretch
-    _) echo DEBIAN STRETCH64 VOL_STRETCH STRETCH_FREE ;;
+    _) echo STRETCH64 VOL_STRETCH STRETCH_FREE ;;
     # buster
-    _) echo DEBIAN BUSTER64 VOL_BUSTER BUSTER_FREE ;;
+    _) echo BUSTER64 VOL_BUSTER BUSTER_FREE ;;
     # testing
-    _) echo DEBIAN STRETCH64 VOL_TESTING TESTING_FREE ;;
+    _) echo STRETCH64 VOL_TESTING TESTING_FREE ;;
     # xenial
     _) echo UBUNTU XENIAL64 VOL_XENIAL XENIAL_FREE ;;
     # bionic
@@ -98,21 +101,29 @@ fi
 
 if [[ -e /a/bin/fai/fai-wrapper ]]; then
   source /a/bin/distro-functions/src/identify-distros
-  if isdebian; then
-    echo "DEBIAN"
-    tmp=$(debian-codename)
-    echo ${tmp^^}
-    # nonfree repo is not going away any time soon due to
-    # gcc-doc being in nonfree
-    echo ${tmp^^}_NONFREE
+  if isdeb; then
+    codename=$(debian-codename)
+    echo ${codename^^}
+    distro=$(distro-name)
+    case $distro in
+      debian)
+        echo ${distro^^}
+        # nonfree repo is not going away any time soon due to
+        # gcc-doc being in nonfree
+        echo ${codename^^}_NONFREE
+        ;;
+      trisquel)
+        # easier to stay with fai example config if we just call it ubuntu
+        echo UBUNTU
+        ;;
+    esac
   fi
   case $HOSTNAME in
     li|lj) echo "LINODE" ;;
-    bk) echo "NOCRYPT" ;;
+    bk|je) echo "NOCRYPT" ;;
   esac
 fi
 
-echo FAIBASE STANDARD
 
 #echo "PARTITION_PROMPT"
 #echo REPARTITION