From 50b211f58997fae56b3fcfb45a289b37c421ef56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= Date: Wed, 4 Sep 2024 15:54:06 +0200 Subject: [PATCH] bootupd: Trigger a bootloader update on boot See: https://gitlab.com/fedora/ostree/sig/-/issues/1 See: https://github.com/coreos/bootupd/pull/716 --- bootupd.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bootupd.yaml b/bootupd.yaml index 85e740b..f1692b2 100644 --- a/bootupd.yaml +++ b/bootupd.yaml @@ -8,5 +8,25 @@ postprocess: - | #!/bin/bash set -xeuo pipefail + # Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload /usr/bin/bootupctl backend generate-update-metadata + + # Trigger a bootloader update on boot + cat > /usr/lib/systemd/system/bootloader-update.service << 'EOF' + [Unit] + Description=Update bootloader on boot + Documentation=https://github.com/coreos/bootupd + ConditionFirmware=uefi + + [Service] + Type=oneshot + ExecStart=/usr/bin/bootupctl update + RemainAfterExit=yes + MountFlags=slave + + [Install] + WantedBy=multi-user.target + EOF + chmod 644 /usr/lib/systemd/system/bootloader-update.service + echo "enable bootloader-update.service" > /usr/lib/systemd/system-preset/81-atomic-desktop.preset