summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>2022-11-04 09:57:24 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2022-11-04 16:53:40 +0100
commit981502c5cc9ce32c3f77ff74aad87cd6f0da3b16 (patch)
tree5021342b7e8cd7c91b9d3aa3ab74c714cb88263c
parenttmpfiles.d: do not fail if provision.conf fails (diff)
downloadsystemd-981502c5cc9ce32c3f77ff74aad87cd6f0da3b16.tar.xz
systemd-981502c5cc9ce32c3f77ff74aad87cd6f0da3b16.zip
kernel-install/90-loaderentry: do not add multiple systemd.machine_id options
Do not unconditionally add a new systemd.machine_id command line option, first check if it already exists with the expected value. Fixes #25203
-rwxr-xr-xsrc/kernel-install/90-loaderentry.install2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
index 743af33aa9..ea75e1b0d8 100755
--- a/src/kernel-install/90-loaderentry.install
+++ b/src/kernel-install/90-loaderentry.install
@@ -85,7 +85,7 @@ BOOT_OPTIONS="${BOOT_OPTIONS% }"
# command line with the machine ID we use, so that the machine ID remains
# stable, even during factory reset, in the initrd (where the system's machine
# ID is not directly accessible yet), and if the root file system is volatile.
-if [ "$ENTRY_TOKEN" = "$MACHINE_ID" ]; then
+if [ "$ENTRY_TOKEN" = "$MACHINE_ID" ] && ! echo "$BOOT_OPTIONS" | grep -q "systemd.machine_id=$MACHINE_ID"; then
BOOT_OPTIONS="$BOOT_OPTIONS systemd.machine_id=$MACHINE_ID"
fi