kernel-install: Reuse $BOOT/Default if it already exists

Avoids duplicate installation problems when the machine ID is
initialized after a kernel is already installed under $BOOT/Default.
This commit is contained in:
Daan De Meyer 2020-08-18 20:16:48 +01:00
parent 6426c98ac5
commit 2c46d523ac
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@ fi
KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"
if [[ -f /etc/machine-id ]]; then
# Reuse directory created without a machine ID present if it exists.
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -f /etc/machine-id ]]; then
read MACHINE_ID < /etc/machine-id
else
MACHINE_ID="Default"