Skip to content

Commit

Permalink
fix: grub config path and bootc symlink
Browse files Browse the repository at this point in the history
* Moved greenboot config to /etc/grub.d.
* %post symlink greenboot.cfg to bootupd if present
* %postun remove symlink from bootupd if present

Signed-off-by: saypaul <[email protected]>
  • Loading branch information
say-paul committed Sep 10, 2024
1 parent f1fe7ea commit 2b36530
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
File renamed without changes.
13 changes: 9 additions & 4 deletions greenboot.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Name: greenboot
Version: 0.15.5
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Generic Health Check Framework for systemd
License: LGPL-2.1-or-later

Expand All @@ -19,7 +19,6 @@ BuildRequires: systemd-rpm-macros
Requires: systemd >= 240
Requires: grub2-tools-minimal
Requires: rpm-ostree
Requires: bootupd
# PAM is required to programatically read motd messages from /etc/motd.d/*
# This causes issues with RHEL-8 as the fix isn't there an el8 is on pam-1.3.x
Requires: pam >= 1.4.0
Expand Down Expand Up @@ -66,7 +65,6 @@ mkdir -p %{buildroot}%{_prefix}/lib/%{name}/check/required.d
mkdir %{buildroot}%{_prefix}/lib/%{name}/check/wanted.d
mkdir %{buildroot}%{_prefix}/lib/%{name}/green.d
mkdir %{buildroot}%{_prefix}/lib/%{name}/red.d
install -D -t %{buildroot}%{_prefix}/lib/bootupd/grub2-static/configs.d grub2/greenboot.cfg
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_unitdir}/greenboot-healthcheck.service.d
mkdir -p %{buildroot}%{_tmpfilesdir}
Expand All @@ -79,6 +77,7 @@ install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_
install -DpZm 0755 usr/lib/greenboot/check/required.d/* %{buildroot}%{_prefix}/lib/%{name}/check/required.d
install -DpZm 0755 usr/lib/greenboot/check/wanted.d/* %{buildroot}%{_prefix}/lib/%{name}/check/wanted.d
install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{name}/greenboot.conf
install -DpZm 0644 etc/grub.d/greenboot.cfg %{buildroot}%{_sysconfdir}/grub.d/greenboot.cfg

%post
%systemd_post greenboot-healthcheck.service
Expand All @@ -91,6 +90,9 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%systemd_post greenboot-grub2-set-success.service
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
%systemd_post redboot-auto-reboot.service
if [ -d /usr/lib/bootupd/grub2-static/configs.d ]; then
cp /etc/grub.d/greenboot.cfg /usr/lib/bootupd/grub2-static/configs.d
fi

%post default-health-checks
%systemd_post greenboot-loading-message.service
Expand Down Expand Up @@ -119,6 +121,9 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%systemd_postun greenboot-grub2-set-counter.service
%systemd_postun greenboot-grub2-set-success.service
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
if [ -f /usr/lib/bootupd/grub2-static/configs.d/greenboot.cfg ]; then
rm -f /usr/lib/bootupd/grub2-static/configs.d/greenboot.cfg
fi

%postun default-health-checks
%systemd_postun greenboot-loading-message.service
Expand All @@ -143,7 +148,7 @@ install -DpZm 0644 etc/greenboot/greenboot.conf %{buildroot}%{_sysconfdir}/%{nam
%dir %{_prefix}/lib/%{name}/red.d
%{_exec_prefix}/lib/motd.d/boot-status
%{_tmpfilesdir}/greenboot-status-motd.conf
%{_prefix}/lib/bootupd/grub2-static/configs.d/*.cfg
%{_sysconfdir}/grub.d/*.cfg
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/%{name}
%{_libexecdir}/%{name}/greenboot-grub2-set-success
Expand Down

0 comments on commit 2b36530

Please sign in to comment.