summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-09 13:39:15 +0200
committerSimon Rettberg2019-04-09 13:39:15 +0200
commit8ceae4880a11fab56629047a558c5171128f6968 (patch)
tree0c13b450f00bb9f0ff3cf2ecae0961c454343942 /core
parent[pam-slx-plug] Stop execution early if not run as root (diff)
downloadmltk-8ceae4880a11fab56629047a558c5171128f6968.tar.gz
mltk-8ceae4880a11fab56629047a558c5171128f6968.tar.xz
mltk-8ceae4880a11fab56629047a558c5171128f6968.zip
[hardware-stats] Remove UUID fallback; require /etc/system-uuid
Diffstat (limited to 'core')
-rwxr-xr-xcore/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index b93b2edb..423bbe64 100755
--- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -79,16 +79,11 @@ fi
MAC=${BOOTIF:3}
echo "Determined MAC=$MAC"
-# 2) Get machine UUID, with fallback to MAC address if it fails for some reason, or if the UUID is blacklisted
+# 2) Get machine UUID written in stage3.1
UUID=$(cat /etc/system-uuid)
if [ -z "$UUID" ] || [ "${#UUID}" -ne "36" ]; then
- UUID=$(dmidecode -q -s system-uuid | grep -v '^#' | head -n 1 | tr '[a-z]' '[A-Z]')
- echo "$UUID" > /etc/system-uuid
-fi
-if [ "${#UUID}" -ne "36" ]; then
- echo "Determined UUID (${UUID}) has not expected length of 36, falling back to MAC..."
- UUID="000000000000001-$BOOTIF"
- echo "$UUID" > /etc/system-uuid
+ echo "No/malformed UUID, aborting" >&2
+ exit 1
fi
echo "UUID=$UUID"