Skip to content

Commit 04b905b

Browse files
authored
Merge pull request #803 from travier/main-bootupd-update-service
packaging: Add systemd unit to trigger updates on boot
2 parents 26c5852 + a62fcbc commit 04b905b

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ install-grub-static:
4141
install -m 644 -D -t ${DESTDIR}$(PREFIX)/lib/bootupd/grub2-static src/grub2/*.cfg
4242
install -m 755 -d ${DESTDIR}$(PREFIX)/lib/bootupd/grub2-static/configs.d
4343

44+
install-systemd-unit:
45+
install -m 644 -D -t "${DESTDIR}$(PREFIX)/lib/systemd/system/" contrib/packaging/bootloader-update.service
46+
4447
bin-archive:
4548
rm target/inst -rf
4649
$(MAKE) install install-grub-static DESTDIR=$$(pwd)/target/inst
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Update bootloader on boot
3+
Documentation=https://github.com/coreos/bootupd
4+
5+
[Service]
6+
Type=oneshot
7+
ExecStart=/usr/bin/bootupctl update
8+
RemainAfterExit=yes
9+
MountFlags=slave
10+
11+
[Install]
12+
WantedBy=multi-user.target

contrib/packaging/bootupd.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ BuildRequires: cargo
2424
BuildRequires: git
2525
BuildRequires: openssl-devel
2626
BuildRequires: systemd-devel
27+
BuildRequires: systemd-rpm-macros
2728

2829
%description
2930
%{summary}
@@ -34,6 +35,7 @@ BuildRequires: systemd-devel
3435
%{_bindir}/bootupctl
3536
%{_libexecdir}/bootupd
3637
%{_prefix}/lib/bootupd/grub2-static/
38+
%{_unitdir}/bootloader-update.service
3739

3840
%prep
3941
%autosetup -n %{crate}-%{version} -p1 -Sgit
@@ -53,7 +55,8 @@ cargo build --release
5355
%install
5456
%make_install INSTALL="install -p -c"
5557
make install-grub-static DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
58+
make install-systemd-unit DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
5659

5760
%changelog
5861
* Tue Oct 18 2022 Colin Walters <[email protected]> - 0.2.8-3
59-
- Dummy changelog
62+
- Dummy changelog

0 commit comments

Comments
 (0)