From 6426c98ac5e581e888332ac3d29b407a44f4c5bf Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 24 Aug 2020 19:22:11 +0100 Subject: [PATCH 1/2] kernel-install: Use "Default" as fallback instead of "Linux" "Linux" conflicts /efi/Linux when /efi is the install location. /efi/Linux is already reserved for unified kernel images so we can't use it for type #1 images. Instead, we use "Default". --- src/kernel-install/kernel-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install index ca21be7e61..3359ec227c 100755 --- a/src/kernel-install/kernel-install +++ b/src/kernel-install/kernel-install @@ -88,7 +88,7 @@ KERNEL_IMAGE="$2" if [[ -f /etc/machine-id ]]; then read MACHINE_ID < /etc/machine-id else - MACHINE_ID="Linux" + MACHINE_ID="Default" fi if [[ ! $COMMAND ]] || [[ ! $KERNEL_VERSION ]]; then From 2c46d523ac3574f1902846c707ae7c76bb71b1d9 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 18 Aug 2020 20:16:48 +0100 Subject: [PATCH 2/2] 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. --- src/kernel-install/kernel-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install index 3359ec227c..0ae07fcf32 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"