aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-14 08:23:08 +0200
committerMike Gabriel <sunweaver@debian.org>2023-09-19 18:41:43 +0000
commit666aa66efad1a1871cad6b6233dfd09ea0399980 (patch)
treea811d1c0de49716c9c5b9e98fb580536088131c6
parent5a319c03d554c26271624e859a485056a7ca06af (diff)
downloaddebian-edu-fai+itzks-666aa66efad1a1871cad6b6233dfd09ea0399980.tar.gz
debian-edu-fai+itzks-666aa66efad1a1871cad6b6233dfd09ea0399980.tar.bz2
debian-edu-fai+itzks-666aa66efad1a1871cad6b6233dfd09ea0399980.zip
fai/config/class: Add OS detection code to 40-parse-profiles.sh to support OS + version specific installation profiles (detect from FAI nfsroot OS + version).
-rwxr-xr-xfai/config/class/40-parse-profiles.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/fai/config/class/40-parse-profiles.sh b/fai/config/class/40-parse-profiles.sh
index c80cf7a..010b186 100755
--- a/fai/config/class/40-parse-profiles.sh
+++ b/fai/config/class/40-parse-profiles.sh
@@ -4,6 +4,8 @@
#
# (c) 2015 by Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
+# (c) 2023 by Mike Gabriel, mike.gabriel@das-netzwerkteam.de
+# Fre(i)e Software GmbH
if [ X$FAI_ACTION = Xinstall -o X$FAI_ACTION = Xdirinstall -o X$FAI_ACTION = X ]; then
:
@@ -114,6 +116,14 @@ prtresult() {
newclasses="${arclasses[$res]}"
}
+# a very simple OS + version detection mechanism, only usable on Debian
+# nfsroots for now...
+OS_SUFFIX=""
+if [ -e "/etc/debian_version" ]; then
+ OS_SUFFIX+="DEBIAN"
+ OS_VERSION_MAJOR=$(cat /etc/debian_version | head -n1 | cut -d"." -f1)
+ OS_SUFFIX+="_${OS_VERSION_MAJOR}"
+fi
# read all files with name matching *.profile
_parsed=0
@@ -122,6 +132,12 @@ for _f in *.profile; do
parse_profile $_f
_parsed=1
done
+
+# additionally read all files with name matching *.profile.<OS_SUFFIX>
+for _f in *.profile.${OS_SUFFIX}; do
+ parse_profile $_f
+ _parsed=1
+done
unset _f
# do nothing if no profile was read