Skip to content

Commit 2181f67

Browse files
committed
bootupd: Trigger a bootloader update on boot
See: https://gitlab.com/fedora/ostree/sig/-/issues/1 See: coreos/bootupd#716
1 parent d77dc78 commit 2181f67

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

bootupd.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,25 @@ postprocess:
88
- |
99
#!/bin/bash
1010
set -xeuo pipefail
11+
1112
# Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload
1213
/usr/bin/bootupctl backend generate-update-metadata
14+
15+
# Trigger a bootloader update on boot
16+
cat > /usr/lib/systemd/system/bootloader-update.service << 'EOF'
17+
[Unit]
18+
Description=Update bootloader on boot
19+
Documentation=https://github.com/coreos/bootupd
20+
ConditionFirmware=uefi
21+
22+
[Service]
23+
Type=oneshot
24+
ExecStart=/usr/bin/bootupctl update
25+
RemainAfterExit=yes
26+
MountFlags=slave
27+
28+
[Install]
29+
WantedBy=multi-user.target
30+
EOF
31+
chmod 644 /usr/lib/systemd/system/bootloader-update.service
32+
echo "enable bootloader-update.service" > /usr/lib/systemd/system-preset/81-atomic-desktop.preset

0 commit comments

Comments
 (0)