From: Daan De Meyer Date: Tue, 23 Nov 2021 18:57:18 +0000 (+0100) Subject: mkosi: Install sd-boot using postinst script instead of in build script X-Git-Tag: v250-rc1~155^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F21487%2Fhead;p=thirdparty%2Fsystemd.git mkosi: Install sd-boot using postinst script instead of in build script This allows us to reuse bootctl install instead of replicating the logic in the build script. --- diff --git a/mkosi.build b/mkosi.build index bb04d5edaad..fe3688d6ae9 100755 --- a/mkosi.build +++ b/mkosi.build @@ -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 index 00000000000..feb8203126d --- /dev/null +++ b/mkosi.postinst @@ -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