Skip to content

Commit

Permalink
migrate: Add systemd service unit to trigger on boot
Browse files Browse the repository at this point in the history
Note that the service is intentionally not enabled by default as it
should be up to the distribution to add a systemd preset if the
migration to a static GRUB config is needed.

This will be used on Atomic Desktops & IoT systems to migrate systems to
a static GRUB config before enabling composefs as GRUB curently does not
interact well with it:
https://bugzilla.redhat.com/show_bug.cgi?id=2308594

See: #789
See: https://fedoraproject.org/wiki/Changes/ComposefsAtomicDesktops
  • Loading branch information
travier committed Dec 18, 2024
1 parent 868dc3f commit 4a65f3b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ install-grub-static:

install-systemd-unit:
install -m 644 -D -t "${DESTDIR}$(PREFIX)/lib/systemd/system/" contrib/packaging/bootloader-update.service
install -m 644 -D -t "${DESTDIR}$(PREFIX)/lib/systemd/system/" contrib/packaging/bootupd-static-grub-migration.service

bin-archive:
rm target/inst -rf
Expand Down
17 changes: 17 additions & 0 deletions contrib/packaging/bootupd-static-grub-migration.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=bootupd static GRUB config migration
Documentation=https://github.com/coreos/bootupd
ConditionPathExists=!/boot/.bootupd-static-migration-complete
RequiresMountsFor=/sysroot /boot
# Only run after a successful bootloader update
After=bootloader-update.service
Requires=bootloader-update.service

[Service]
Type=oneshot
ExecStart=/usr/bin/bootupctl migrate
RemainAfterExit=yes
MountFlags=slave

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions contrib/packaging/bootupd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ BuildRequires: systemd-rpm-macros
%{_libexecdir}/bootupd
%{_prefix}/lib/bootupd/grub2-static/
%{_unitdir}/bootloader-update.service
%{_unitdir}/bootupd-static-grub-migration.service

%prep
%autosetup -n %{crate}-%{version} -p1 -Sgit
Expand Down

0 comments on commit 4a65f3b

Please sign in to comment.