naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
ac3a84
From 89adb54468aff192fccc9dce793e24d98b26d994 Mon Sep 17 00:00:00 2001
ac3a84
From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= <marcus.schaefer@gmail.com>
ac3a84
Date: Wed, 16 Nov 2022 16:25:08 +0100
ac3a84
Subject: [PATCH] Handle MACHINE_ID=uninitialized
ac3a84
ac3a84
systemd supports /etc/machine-id to be set to: uninitialized
ac3a84
In this case the expectation is that systemd creates a new
ac3a84
machine ID and replaces the value 'uninitialized' with the
ac3a84
effective machine id. In the scope of kernel-install we
ac3a84
should also enforce the creation of a new machine id in this
ac3a84
condition
ac3a84
ac3a84
(cherry picked from commit 305dd91adfde332e7e5c1b2470edb32774f9a032)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 src/kernel-install/kernel-install.in | 1 +
ac3a84
 1 file changed, 1 insertion(+)
ac3a84
ac3a84
diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in
ac3a84
index bba22f8a20..fa2c0d5276 100755
ac3a84
--- a/src/kernel-install/kernel-install.in
ac3a84
+++ b/src/kernel-install/kernel-install.in
ac3a84
@@ -160,6 +160,7 @@ if [ -z "$MACHINE_ID" ] && [ -f /etc/machine-info ]; then
ac3a84
 fi
ac3a84
 if [ -z "$MACHINE_ID" ] && [ -s /etc/machine-id ]; then
ac3a84
     read -r MACHINE_ID 
ac3a84
+    [ "$MACHINE_ID" = "uninitialized" ] && unset MACHINE_ID
ac3a84
     [ -n "$MACHINE_ID" ] && \
ac3a84
         log_verbose "machine-id $MACHINE_ID acquired from /etc/machine-id"
ac3a84
 fi