forked from fedora-iot/greenboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greenboot.spec
196 lines (155 loc) · 6.44 KB
/
greenboot.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Name: greenboot
Version: 0.8
Release: 1%{?dist}
Summary: Generic Health Check Framework for systemd
License: LGPLv2+
%global repo_owner LorbusChris
%global repo_name %{name}
%global repo_tag v%{version}
URL: https://github.com/%{repo_owner}/%{repo_name}
Source0: https://github.com/%{repo_owner}/%{repo_name}/archive/%{repo_tag}.tar.gz
BuildArch: noarch
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
Requires: systemd
%description
%{summary}.
%package auto-update-fallback
Summary: Automatic updates and failure fallback for rpm-ostree-based system
Requires: %{name} = %{version}-%{release}
Requires: %{name}-reboot = %{version}-%{release}
Requires: %{name}-rpm-ostree-grub2 = %{version}-%{release}
%description auto-update-fallback
%{summary}.
%package status
Summary: Message of the Day updater for greenboot
Requires: %{name} = %{version}-%{release}
# PAM is required to programatically read motd messages from /etc/motd.d/*
Requires: pam >= 1.3.1-15
# While not strictly necessary to generate the motd, the main use-case of this package is to display it on SSH login
Recommends: openssh
%description status
%{summary}.
%package rpm-ostree-grub2
Summary: Scripts for greenboot on rpm-ostree-based systems using the Grub2 bootloader
Requires: %{name} = %{version}-%{release}
Requires: %{name}-grub2 = %{version}-%{release}
%description rpm-ostree-grub2
%{summary}.
%package grub2
Summary: Grub2 specific scripts for greenboot
Requires: %{name} = %{version}-%{release}
%description grub2
%{summary}.
%package reboot
Summary: Reboot on red status for greenboot
Requires: %{name} = %{version}-%{release}
%description reboot
%{summary}.
%prep
%setup
%build
%install
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/check/required.d
mkdir %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d
mkdir %{buildroot}%{_sysconfdir}/%{name}/green.d
mkdir %{buildroot}%{_sysconfdir}/%{name}/red.d
mkdir -p %{buildroot}%{_unitdir}
install -DpZm 0755 usr/libexec/greenboot/greenboot %{buildroot}%{_libexecdir}/%{name}/%{name}
install -DpZm 0755 usr/libexec/greenboot/greenboot-grub2-set-counter %{buildroot}%{_libexecdir}/%{name}/greenboot-grub2-set-counter
install -DpZm 0755 usr/libexec/greenboot/greenboot-rpm-ostree-grub2-check-fallback %{buildroot}%{_libexecdir}/%{name}/greenboot-rpm-ostree-grub2-check-fallback
install -DpZm 0755 usr/libexec/greenboot/greenboot-status %{buildroot}%{_libexecdir}/%{name}/greenboot-status
install -DpZm 0755 usr/libexec/greenboot/redboot-auto-reboot-check %{buildroot}%{_libexecdir}/%{name}/redboot-auto-reboot-check
install -DpZm 0644 usr/lib/motd.d/boot-status %{buildroot}%{_exec_prefix}/lib/motd.d/boot-status
install -DpZm 0644 usr/lib/systemd/system/* %{buildroot}%{_unitdir}
install -DpZm 0644 usr/lib/tmpfiles.d/greenboot-status-motd.conf %{buildroot}%{_tmpfilesdir}/greenboot-status-motd.conf
install -DpZm 0755 etc/greenboot/check/required.d/* %{buildroot}%{_sysconfdir}/%{name}/check/required.d
install -DpZm 0755 etc/greenboot/check/wanted.d/* %{buildroot}%{_sysconfdir}/%{name}/check/wanted.d
%post
%systemd_post greenboot-healthcheck.service
%systemd_post greenboot.service
%systemd_post redboot.service
%systemd_post redboot.target
%post grub2
%systemd_post greenboot-grub2-set-counter.service
%systemd_post greenboot-grub2-set-success.service
%post reboot
%systemd_post redboot-auto-reboot.service
%post rpm-ostree-grub2
%systemd_post greenboot-rpm-ostree-grub2-check-fallback.service
%post status
%systemd_post greenboot-status.service
%preun
%systemd_preun greenboot-healthcheck.service
%systemd_preun greenboot.service
%systemd_preun redboot.service
%systemd_preun redboot.target
%preun grub2
%systemd_preun greenboot-grub2-set-counter.service
%systemd_preun greenboot-grub2-set-success.service
%preun rpm-ostree-grub2
%systemd_preun greenboot-rpm-ostree-grub2-check-fallback.service
%preun status
%systemd_preun greenboot-status.service
%postun
%systemd_postun greenboot-healthcheck.service
%systemd_postun greenboot.service
%systemd_postun redboot.service
%systemd_postun redboot.target
%postun grub2
%systemd_postun greenboot-grub2-set-counter.service
%systemd_postun greenboot-grub2-set-success.service
%postun rpm-ostree-grub2
%systemd_postun greenboot-rpm-ostree-grub2-check-fallback.service
%postun status
%systemd_postun greenboot-status.service
%files
%doc README.md
%license LICENSE
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/%{name}
%{_unitdir}/greenboot-healthcheck.service
%{_unitdir}/greenboot.service
%{_unitdir}/redboot.service
%{_unitdir}/redboot.target
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/check
%dir %{_sysconfdir}/%{name}/check/required.d
%{_sysconfdir}/%{name}/check/required.d/00_required_scripts_start.sh
%dir %{_sysconfdir}/%{name}/check/wanted.d
%{_sysconfdir}/%{name}/check/wanted.d/00_wanted_scripts_start.sh
%dir %{_sysconfdir}/%{name}/green.d
%dir %{_sysconfdir}/%{name}/red.d
%files status
%{_exec_prefix}/lib/motd.d/boot-status
%{_libexecdir}/%{name}/greenboot-status
%{_tmpfilesdir}/greenboot-status-motd.conf
%{_unitdir}/greenboot-status.service
%files rpm-ostree-grub2
%{_libexecdir}/%{name}/greenboot-rpm-ostree-grub2-check-fallback
%{_unitdir}/greenboot-rpm-ostree-grub2-check-fallback.service
%files grub2
%{_libexecdir}/%{name}/greenboot-grub2-set-counter
%{_unitdir}/greenboot-grub2-set-success.service
%{_unitdir}/greenboot-grub2-set-counter.service
%files reboot
%{_libexecdir}/%{name}/redboot-auto-reboot-check
%{_unitdir}/redboot-auto-reboot.service
%changelog
* Wed Feb 05 2020 Christian Glombek <lorbus@fedoraproject.org> - 0.8-1
- Update to v0.8
- Add guard against bootlooping in redboot-auto-reboot.service
* Mon Apr 01 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.7-1
- Update to v0.7
- Rename ostree-grub2 subpackage to rpm-ostree-grub2 to be more explicit
- Add auto-update-fallback meta subpackage
* Wed Feb 13 2019 Christian Glombek <lorbus@fedoraproject.org> - 0.6-1
- Update to v0.6
- Integrate with systemd's boot-complete.target
- Rewrite motd sub-package and rename to status
* Fri Oct 19 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.5-1
- Update to v0.5
* Tue Oct 02 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-2
- Spec Review
* Thu Jun 14 2018 Christian Glombek <lorbus@fedoraproject.org> - 0.4-1
- Initial Package