#26 Use presets and macros to enable systemd units in tools
Closed 9 months ago by lorbus. Opened 10 months ago by lorbus.
rpms/ lorbus/grub2 use-presets-and-macros  into  rawhide

file modified
+23 -15
@@ -17,7 +17,7 @@ 

  Name:		grub2

  Epoch:		1

  Version:	2.06

- Release:	98%{?dist}

+ Release:	99%{?dist}

  Summary:	Bootloader with support for Linux, Multiboot and more

  License:	GPLv3+

  URL:		http://www.gnu.org/software/grub/
@@ -62,8 +62,8 @@ 

  BuildRequires:	texinfo

  BuildRequires:	xz-devel

  

- # For %%_userunitdir macro

- BuildRequires:	systemd

+ # For %%_userunitdir and %%systemd_* macros

+ BuildRequires:	systemd-rpm-macros

  

  %ifarch %{efi_arch}

  BuildRequires:	pesign >= 0.99-8
@@ -114,6 +114,7 @@ 

  Requires(pre):	dracut

  Requires(pre):	grep

  Requires(pre):	sed

+ %{?systemd_requires}

  

  %description tools

  %{desc}
@@ -271,17 +272,8 @@ 

  # Install systemd user service to set the boot_success flag

  install -D -m 0755 -t %{buildroot}%{_userunitdir} \

  	docs/grub-boot-success.{timer,service}

- install -d -m 0755 %{buildroot}%{_userunitdir}/timers.target.wants

- ln -s ../grub-boot-success.timer \

- 	%{buildroot}%{_userunitdir}/timers.target.wants

  # Install systemd system-update unit to set boot_indeterminate for offline-upd

  install -D -m 0755 -t %{buildroot}%{_unitdir} docs/grub-boot-indeterminate.service

- install -d -m 0755 %{buildroot}%{_unitdir}/system-update.target.wants

- install -d -m 0755 %{buildroot}%{_unitdir}/reboot.target.wants

- ln -s ../grub-boot-indeterminate.service \

- 	%{buildroot}%{_unitdir}/system-update.target.wants

- ln -s ../grub2-systemd-integration.service \

- 	%{buildroot}%{_unitdir}/reboot.target.wants

  

  # Don't run debuginfo on all the grub modules and whatnot; it just

  # rejects them, complains, and slows down extraction.
@@ -332,6 +324,21 @@ 

      fi

  fi

  

+ %post tools

+ %systemd_post grub-boot-indeterminate.service

+ %systemd_post grub-systemd-integration.service

+ %systemd_user_post grub-boot-success.timer

+ 

+ %preun tools

+ %systemd_preun grub-boot-indeterminate.service

+ %systemd_preun grub-systemd-integration.service

+ %systemd_user_preun grub-boot-success.timer

+ 

+ %postun tools

+ %systemd_postun_with_restart grub-boot-indeterminate.service

+ %systemd_postun_with_restart grub-systemd-integration.service

+ %systemd_user_postun_with_restart grub-boot-success.timer

+ 

  %posttrans common

  set -eu

  
@@ -427,11 +434,8 @@ 

  %{_sysconfdir}/grub.d/README

  %{_userunitdir}/grub-boot-success.timer

  %{_userunitdir}/grub-boot-success.service

- %{_userunitdir}/timers.target.wants

  %{_unitdir}/grub-boot-indeterminate.service

- %{_unitdir}/system-update.target.wants

  %{_unitdir}/grub2-systemd-integration.service

- %{_unitdir}/reboot.target.wants

  %{_unitdir}/systemd-logind.service.d

  %{_infodir}/grub2*

  %{_datarootdir}/grub/*
@@ -544,6 +548,10 @@ 

  %endif

  

  %changelog

+ * Fri Sep 01 2023 Christian Glombek <cglombek@redhat.com> - 2.06-99

+ - spec: Use systemd presets and macros for units in tools package

+ - Resolves: #2230575

+ 

  * Thu Aug 31 2023 Nicolas Frayer <nfrayer@redhat.com> - 2.06-98

  - spec: Modified posttrans to harden grub config detection

  - Resolves: #2235692

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/7b6518ede1564984ac838839bd6db525

rebased onto 1bbb5060d22b904320f43974c7fa93e95f974e3c

10 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/73d1ccfe747743a798ce61a0c2a04af1

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/81a8560d325f4ffb9ca50b4759592626

We might also need

%postun
%systemd_postun_with_restart grub-boot-indeterminate.service
%systemd_postun_with_restart grub-systemd-integration.service
%systemd_postun_with_restart grub-boot-success.timer

edit: added

rebased onto f0c986661e448137d8d954672b2eacaec4993abb

9 months ago

rebased onto c952733940a96ee4b747b6b0f572d7bdbf9ae482

9 months ago

rebased onto db002fd1da853ee2643fb80afb995ffb51392ed3

9 months ago

rebased onto 08b56b9

9 months ago

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/1def523a17754fca9d58d4798a806fb4

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/860be66cc6f74f9292fe4554fb987ddd

Pull-Request has been closed by lorbus

9 months ago
Metadata