From: Daan De Meyer Date: Tue, 18 Aug 2020 19:16:48 +0000 (+0100) Subject: kernel-install: Reuse $BOOT/Default if it already exists X-Git-Tag: v247-rc1~371^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F16777%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install index 3359ec227c9..0ae07fcf325 100755 --- a/src/kernel-install/kernel-install +++ b/src/kernel-install/kernel-install @@ -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"