]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Install sd-boot using postinst script instead of in build script 21487/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 23 Nov 2021 18:57:18 +0000 (19:57 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 25 Nov 2021 12:54:03 +0000 (13:54 +0100)
This allows us to reuse bootctl install instead of replicating the
logic in the build script.

mkosi.build
mkosi.postinst [new file with mode: 0755]

index bb04d5edaadc20610707a4180794eabb5d64ccf1..fe3688d6ae98f246ef65de6dfd5bc1afc1e92faf 100755 (executable)
@@ -110,12 +110,3 @@ if [ -n "$IMAGE_VERSION" ] ; then
     cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release
     rm /tmp/os-release.tmp
 fi
-
-# Manually update the boot loader from the one we just built
-mkdir -p "$DESTDIR"/boot/efi/EFI/systemd "$DESTDIR"/boot/efi/EFI/BOOT
-cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/boot/efi/EFI/systemd/systemd-bootx64.efi
-cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/boot/efi/EFI/BOOT/bootx64.efi
-
-mkdir -p "$DESTDIR"/efi/EFI/systemd "$DESTDIR"/efi/EFI/BOOT
-cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/efi/EFI/systemd/systemd-bootx64.efi
-cp "$DESTDIR"/usr/lib/systemd/boot/efi/systemd-bootx64.efi "$DESTDIR"/efi/EFI/BOOT/bootx64.efi
diff --git a/mkosi.postinst b/mkosi.postinst
new file mode 100755 (executable)
index 0000000..feb8203
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+if [ "$1" = "final" ] && command -v bootctl > /dev/null; then
+    bootctl install
+fi