1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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.
This commit is contained in:
Daan De Meyer 2021-11-23 19:57:18 +01:00
parent 49ae9d91f9
commit 1b6f9b9880
2 changed files with 6 additions and 9 deletions

View File

@ -110,12 +110,3 @@ if [ -n "$IMAGE_VERSION" ] ; then
cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release cat /tmp/os-release.tmp > "$DESTDIR"/usr/lib/os-release
rm /tmp/os-release.tmp rm /tmp/os-release.tmp
fi 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

6
mkosi.postinst Executable file
View File

@ -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