summaryrefslogtreecommitdiff
path: root/src/kernel-install
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-19 14:43:03 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-05-19 15:38:25 +0200
commitb21ba8ac6bf6a5856cf1a939d3609c4d680d1dcb (patch)
treed610fdd0c394674612f31805a9679c7066c5f8af /src/kernel-install
parent94cbddf43922e9da4b94d25552d002e0aa9f7077 (diff)
downloadsystemd-b21ba8ac6bf6a5856cf1a939d3609c4d680d1dcb.tar.gz
kernel-install: bail if machine id generation fails
The call is unlikely to fail, but systemd-id128 might not be installed. We shouldn't continue with the empty string.
Diffstat (limited to 'src/kernel-install')
-rwxr-xr-xsrc/kernel-install/kernel-install.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kernel-install/kernel-install.in b/src/kernel-install/kernel-install.in
index 0428c88fb3..48072e346b 100755
--- a/src/kernel-install/kernel-install.in
+++ b/src/kernel-install/kernel-install.in
@@ -114,7 +114,9 @@ fi
# compatibility).
[ -z "$MACHINE_ID" ] && [ -r /etc/machine-info ] && . /etc/machine-info && MACHINE_ID="$KERNEL_INSTALL_MACHINE_ID"
[ -z "$MACHINE_ID" ] && [ -r /etc/machine-id ] && read -r MACHINE_ID </etc/machine-id
-[ -z "$MACHINE_ID" ] && MACHINE_ID="$(systemd-id128 new)"
+if [ -z "$MACHINE_ID" ]; then
+ MACHINE_ID="$(systemd-id128 new)" || exit 1
+fi
# Now that we determined the machine ID to use, let's determine the "token" for
# the boot loader entry to generate. We use that for naming the directory below