Skip to content

Commit e86b791

Browse files
committed
packaging: add a systemd unit to run every boot
This enables bootloader updates automatically on boot. Note that the service is intentionally not enabled by default, it should be up to the distribution to add a systemd preset if auto-update for the bootloader is desired. Right now RAID setups are not supported but see [1] for an example in coreos. [1] coreos/fedora-coreos-config#3042
1 parent 0f3de09 commit e86b791

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Update Bootloader on boot
3+
Documentation=https://github.com/coreos/bootupd
4+
ConditionPathExists=/dev/disk/by-label/EFI-SYSTEM
5+
6+
[Service]
7+
Type=oneshot
8+
ExecStart=/usr/bin/bootupctl update
9+
RemainAfterExit=yes
10+
MountFlags=slave
11+
12+
[Install]
13+
WantedBy=multi-user.target

contrib/packaging/bootupd.spec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ BuildRequires: cargo
2121
BuildRequires: git
2222
BuildRequires: openssl-devel
2323
BuildRequires: systemd-devel
24+
BuildRequires: systemd-rpm-macros
2425

2526
%description
2627
%{summary}
@@ -31,6 +32,7 @@ BuildRequires: systemd-devel
3132
%{_bindir}/bootupctl
3233
%{_libexecdir}/bootupd
3334
%{_prefix}/lib/bootupd/grub2-static/
35+
%{_unitdir}/bootupctl-update.service
3436

3537
%prep
3638
%autosetup -n %{crate}-%{version} -p1 -Sgit
@@ -53,4 +55,4 @@ make install-grub-static DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
5355

5456
%changelog
5557
* Tue Oct 18 2022 Colin Walters <[email protected]> - 0.2.8-3
56-
- Dummy changelog
58+
- Dummy changelog

0 commit comments

Comments
 (0)