From db5dccf3325bf366642be1556d71e2fabccef496 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Fri, 15 Jun 2018 15:06:00 +0200 Subject: [PATCH] Make 20-grub.install to exit if there is no machine ID set The kernel-install plugins are called with an environment variable named $KERNEL_INSTALL_MACHINE_ID, which is set to the machine ID read from the /etc/machine-id file. If the file doesn't exist or is empty, the variable is empty and $BOOT_DIR_ABS is set to a temporary directory that's removed after all the plugins exit. So if $KERNEL_INSTALL_MACHINE_ID is not set, just exit the script since installing a kernel BootLoaderSpec fragment won't be possible anyways. Resolves: rhbz#1576573 Signed-off-by: Javier Martinez Canillas --- 20-grub.install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/20-grub.install b/20-grub.install index 8c6ae68..a6959c5 100755 --- a/20-grub.install +++ b/20-grub.install @@ -1,5 +1,9 @@ #!/bin/bash +if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then + exit 0 +fi + [[ -f /etc/default/grub ]] && . /etc/default/grub [[ -f /etc/os-release ]] && . /etc/os-release