From 1b6f9b9880348be939d354e8506a2424e88776c8 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 23 Nov 2021 19:57:18 +0100 Subject: [PATCH] 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. --- mkosi.build | 9 --------- mkosi.postinst | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100755 mkosi.postinst 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 -- 2.47.3