diff --git a/Makefile b/Makefile index 59c212c9..f977008b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/contrib/packaging/bootupd-static-grub-migration.service b/contrib/packaging/bootupd-static-grub-migration.service new file mode 100644 index 00000000..5f726f17 --- /dev/null +++ b/contrib/packaging/bootupd-static-grub-migration.service @@ -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 diff --git a/contrib/packaging/bootupd.spec b/contrib/packaging/bootupd.spec index b6db508f..6d096c15 100644 --- a/contrib/packaging/bootupd.spec +++ b/contrib/packaging/bootupd.spec @@ -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