]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
kernel-install: Reuse $BOOT/Default if it already exists 16777/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 18 Aug 2020 19:16:48 +0000 (20:16 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 24 Aug 2020 18:24:19 +0000 (19:24 +0100)
Avoids duplicate installation problems when the machine ID is
initialized after a kernel is already installed under $BOOT/Default.

src/kernel-install/kernel-install

index 3359ec227c9685600f7a90fbf763ea707c7cf5a5..0ae07fcf325be7aff64f28948c11b89b418f3729 100755 (executable)
@@ -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"