summaryrefslogtreecommitdiff
path: root/src/kernel-install
diff options
context:
space:
mode:
authorMarcus Schäfer <marcus.schaefer@gmail.com>2022-11-16 16:25:08 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-11-17 07:45:25 +0900
commit305dd91adfde332e7e5c1b2470edb32774f9a032 (patch)
treeffb37cbdd734d04fdf68431d5f92df1b77060dff /src/kernel-install
parent6337be0a4ec2d3cf3268b51aa705ee58cfb2b394 (diff)
downloadsystemd-305dd91adfde332e7e5c1b2470edb32774f9a032.tar.gz
Handle MACHINE_ID=uninitialized
systemd supports /etc/machine-id to be set to: uninitialized In this case the expectation is that systemd creates a new machine ID and replaces the value 'uninitialized' with the effective machine id. In the scope of kernel-install we should also enforce the creation of a new machine id in this condition
Diffstat (limited to 'src/kernel-install')
-rwxr-xr-xsrc/kernel-install/kernel-install.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in
index bba22f8a20..fa2c0d5276 100755
--- a/src/kernel-install/kernel-install.in
+++ b/src/kernel-install/kernel-install.in
@@ -160,6 +160,7 @@ if [ -z "$MACHINE_ID" ] && [ -f /etc/machine-info ]; then
fi
if [ -z "$MACHINE_ID" ] && [ -s /etc/machine-id ]; then
read -r MACHINE_ID </etc/machine-id
+ [ "$MACHINE_ID" = "uninitialized" ] && unset MACHINE_ID
[ -n "$MACHINE_ID" ] && \
log_verbose "machine-id $MACHINE_ID acquired from /etc/machine-id"
fi