-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathplatform-update-agent.spec
More file actions
332 lines (247 loc) · 11.7 KB
/
platform-update-agent.spec
File metadata and controls
332 lines (247 loc) · 11.7 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# Macros needed by SELinux
%global selinuxtype targeted
Summary: An agent for updating the OS and bare metal agents packages
Name: platform-update-agent
Version: 1.9.1
Release: 1%{?dist}
License: Apache-2.0
Vendor: Intel Corporation
Distribution: Edge Microvisor Toolkit
Group: Applications/Text
URL: https://github.com/open-edge-platform/edge-node-agents
Source0: %{url}/archive/refs/tags/%{name}/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}.service
Source2: env_wrapper.sh
Source3: %{name}.conf
Source4: platform-update-agent.te
Source5: platform-update-agent.fc
%global debug_package %{nil}
%global _build_id_links none
BuildRequires: golang < 1.26
BuildRequires: golang >= 1.25.5
BuildRequires: systemd-rpm-macros
BuildRequires: selinux-policy-devel
Requires(pre): %{_bindir}/systemd-sysusers
Requires: dmidecode
Requires: (%{name}-selinux if selinux-policy-targeted)
%description
Platform Update Agent serves the purpose to update OS and bare metal agents packages.
%package selinux
Summary: SELinux security policy for platform-update-agent
Requires(post): platform-update-agent = %{version}-%{release}
Requires: fluent-bit-selinux
Requires: otelcol-contrib-selinux
BuildArch: noarch
%{?selinux_requires}
%description selinux
SELinux security policy for platform-update-agent.
%prep
%setup -q
%build
export GOEXPERIMENT=nosystemcrypto
GOSUMDB=off GO_MOD_MODE=vendor BUILD_DIR=$(pwd)/build/artifacts make puabuild
mkdir selinux
cp -p %{SOURCE4} selinux/
cp -p %{SOURCE5} selinux/
make -f %{_datadir}/selinux/devel/Makefile %{name}.pp
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sysconfdir}/edge-node/node/confs
mkdir -p %{buildroot}%{_sysconfdir}/sudoers.d
mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}%{_sysusersdir}
cp build/artifacts/platform-update-agent %{buildroot}%{_bindir}/platform-update-agent
install -d -m 755 %{buildroot}%{_sysconfdir}/edge-node/node/confs
install -m 644 configs/platform-update-agent.yaml %{buildroot}%{_sysconfdir}/edge-node/node/confs/platform-update-agent.yaml
cp configs/sudoers.d/platform-update-agent %{buildroot}%{_sysconfdir}/sudoers.d/platform-update-agent
cp %{SOURCE1} %{buildroot}%{_unitdir}
install -m 744 %{SOURCE2} %{buildroot}%{_sysconfdir}/edge-node/node/confs/%{name}
cp %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}
cp copyright %{buildroot}%{_defaultlicensedir}/%{name}
mkdir -p %{buildroot}%{_datadir}/selinux/packages
install -m 644 %{name}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}.pp
%files selinux
%{_datadir}/selinux/packages/%{name}.pp
%post selinux
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{name}.pp
# Apply the file contexts
/sbin/restorecon -Rv /usr/bin/platform-update-agent
/sbin/restorecon -Rv /etc/edge-node/node/confs/platform-update-agent.yaml
/sbin/restorecon -Rv /etc/intel_edge_node/tokens/platform-update-agent/access_token
%postun selinux
%selinux_modules_uninstall -s %{selinuxtype} %{name}
%files
%{_bindir}/platform-update-agent
%config(noreplace) %attr(-, -, bm-agents) %{_sysconfdir}/edge-node/node/confs
%config %attr(-, platform-update-agent, bm-agents) %{_sysconfdir}/edge-node/node/confs/%{name}.yaml
%config %attr(-, platform-update-agent, bm-agents) %{_sysconfdir}/edge-node/node/confs/%{name}
%{_sysconfdir}/sudoers.d/platform-update-agent
%{_unitdir}/platform-update-agent.service
%{_sysusersdir}/%{name}.conf
%license %{_defaultlicensedir}/%{name}/copyright
%pre
%sysusers_create_package %{name} %{SOURCE3}
%post
#!/bin/sh
set -e
# Commands to run after installation
echo "Running post-installation script..."
echo "Assigning permission..."
mkdir -p %{_var}/edge-node/pua
chmod 740 %{_var}/edge-node/pua
chown platform-update-agent:bm-agents %{_var}/edge-node/pua
mkdir -p %{_sysconfdir}/default/grub.d
touch %{_sysconfdir}/default/grub.d/90-platform-update-agent.cfg
chown platform-update-agent:bm-agents %{_sysconfdir}/default/grub.d/90-platform-update-agent.cfg
echo "Assigning permission complete."
echo "Post-installation complete."
# Reload systemd manager configuration
%systemd_post platform-update-agent.service
%preun
# Before uninstallation, stop the service
%systemd_preun platform-update-agent.service
%postun
#!/bin/sh -e
echo "Running post-uninstallation script"
# If this is an uninstall (not an upgrade), disable the service
%systemd_postun platform-update-agent.service
userdel platform-update-agent
rm -f %{_sysconfdir}/default/grub.d/90-platform-update-agent.cfg %{_sysconfdir}/edge-node/node/confs/platform-update-agent.yaml
rm -rf %{_var}/edge-node/pua
echo "Successfully purged platform-update-agent"
%changelog
* Fri Feb 20 2026 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.9.1-1
- Update to golang 1.25.7
* Fri Feb 06 2026 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.9.0-1
- Update to golang 1.25.5
* Mon Dec 01 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.8.4-1
- Update agent version
* Thu Nov 20 2025 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.8.1-1
- Update to golang 1.24.9
- Fix CVE-2025-47913
* Mon Nov 10 2025 Niket Kumar <niket.kumar@intel.com> - 1.7.3-1
- PUA changes to update kernel paramter
* Wed Nov 5 2025 Kishan Mochi <kishan.mochi@intel.com> - 1.7.2-1
- PUA changes to start inbd svc
* Thu Oct 23 2025 Kishan Mochi <kishan.mochi@intel.com> - 1.7.0-1
- remove provision-tc step from PUA
- build with golang <= 1.24.7
* Tue Sep 2 2025 Polmoorx shiva kumar <polmoorx.shiva.kumar@intel.com> - 1.5.2-2
- Update go version to use above 1.24.4
* Wed Jun 04 2025 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.5.2-1
- Add backoff/retry on northbound grpc interfaces
* Wed May 28 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.5.1-1
- Upgrade agent version to 1.5.1
- Improve the PUA startup time
* Thu Apr 03 2025 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.4.1-1
- Update common to 1.6.8
* Wed Apr 02 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.4.0-1
- Upgrade agent version
* Tue Mar 25 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.3.7-1
- Update configuration and agent binary paths to use edge-node/
* Mon Mar 24 2025 Rajeev Ranjan <rajeev2.ranjan@intel.com> - 1.3.6-1
- Conditional import on common.mk
* Fri Mar 21 2025 Anuj Mittal <anuj.mittal@intel.com> - 1.3.5-3
- Bump Release to rebuild
* Tue Mar 18 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.3.5-2
- Fix PUA build error
* Mon Mar 17 2025 Gavin Lewis <gavin.b.lewis@intel.com> - 1.3.5-1
- Update PUA to v1.3.5
* Mon Mar 10 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.2.20-4
- Fix typo in URL
* Fri Feb 28 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.2.20-3
- Update URL for agents
* Wed Feb 19 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.20-2
- Update service file for systemd hardening
* Wed Jan 22 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.20-1
- Update PUA to v1.2.20
* Wed Jan 22 2025 Anuj Mittal <anuj.mittal@intel.com> - 1.2.19-19
- Revert systemd service hardening changes
* Tue Jan 21 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-18
- Update service file for systemd hardening
* Fri Jan 17 2025 Jia Yong Tan <jia.yong.tan@intel.com> - 1.2.19-17
- Add SELinux policy for root access.
* Wed Jan 15 2025 Tadeusz Matenko <tadeusz.matenko@intel.com> - 1.2.19-16
- Fix SELinux policy
* Tue Jan 14 2025 Jia Yong Tan <jia.yong.tan@intel.com> - 1.2.19-15
- Update SELinux policy to connect to otelcol_contrib
- Update SELinux policy for etc_t, sysfs_t, urandom_device_t, var_run_t
- Add dependency for otelcol-contrib-selinux
* Mon Jan 13 2025 Christopher Nolan <christopher.nolan@intel.com> - 1.2.19-14
- Update ownership of agent configuration files
* Mon Jan 13 2025 Jia Yong Tan <jia.yong.tan@intel.com> - 1.2.19-13
- Update SELinux policy to read udp_socket, getattr fixed_disk_device_t and sys_admin capbility
* Fri Jan 10 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-12
- Add write access to udp_socket
* Fri Jan 10 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-11
- Add missing SELinux policy for accessing platform_update_agent_conf_rw_t
* Thu Jan 09 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-10
- Update config file ownership
- Update SELinux policy for accessing platform_update_agent_conf_rw_t
* Wed Jan 08 2025 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-9
- Update env_wrapper to fix file permission issue
* Mon Jan 06 2025 Naveen Saini <naveen.kumar.saini@intel.com> - 1.2.19-8
- Update Source URL.
* Mon Dec 30 2024 Tan Jia Yong <jia.yong.tan@intel.com> - 1.2.19-7
- Add SELinux policy to allow root to read platform_update_agent_conf_rw_t
* Tue Dec 24 2024 Tan Jia Yong <jia.yong.tan@intel.com> - 1.2.19-6
- Update permission to allow write access for confs directory and platform-update-agent.yaml
* Mon Dec 23 2024 Anuj Mittal <anuj.mittal@intel.com> - 1.2.19-5
- Fix permissions for confs directory
* Fri Dec 20 2024 Tan Jia Yong <jia.yong.tan@intel.com> - 1.2.19-4
- Fix SELinux policy
* Thu Dec 19 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-3
- Update file permission
* Thu Dec 19 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-2
- Add missing SELinux policy for PUA
* Wed Dec 18 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.19-1
- Update PUA to v1.2.19
- Set permission correctly for platform-update-agent.yaml
* Tue Dec 17 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.18-3
- Add missing SELinux policy for PUA
* Wed Dec 4 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.18-2
- Add SELinux policy for PUA
* Mon Dec 2 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.18-1
- Update PUA to v1.2.18
* Wed Nov 20 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.17-1
- Update PUA to v1.2.17
* Thu Nov 14 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.16-1
- Update PUA to v1.2.16
* Fri Nov 8 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.15-1
- Update PUA to v1.2.15
* Thu Nov 7 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.14-1
- Update PUA to v1.2.14
* Wed Nov 6 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.13-1
- Update PUA to v1.2.13
* Fri Oct 25 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.12-1
- Update PUA to v1.2.12
* Fri Oct 18 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.11-1
- Update PUA to v1.2.11
* Fri Oct 18 2024 Naveen Saini <naveen.kumar.saini@intel.com> - 1.2.10-3
- Remove missing dependency on cloud-init
* Tue Oct 15 2024 Naveen Saini <naveen.kumar.saini@intel.com> - 1.2.10-2
- Remove dependency on cloud-init
* Fri Oct 11 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.10-1
- Update PUA to v1.2.10
* Tue Oct 08 2024 Gavin Lewis <gavin.b.lewis@intel.com> - 1.2.9-1
- Update PUA to v1.2.9
* Fri Oct 04 2024 Anuj Mittal <anuj.mittal@intel.com> - 1.2.7-2
- Add dependency on cloud-init before the service is started
* Fri Sep 06 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.7-1
- Update PUA to v1.2.7
- Add copyright to license directory
- Add dmidecode to get the uuid
* Fri Sep 06 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.6-4
- Update method to get uuid
* Thu Sep 05 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.6-3
- Update postinst, add service file and environment wrapper
- Fix incorrect agent name
* Thu Sep 05 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.6-2
- Enable and start PUA after installation. Stop and disable PUA during uninstallation.
* Wed Sep 04 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.6-1
- Move binary to /usr/bin and update service file
* Thu Aug 29 2024 Tadeusz Matenko <tadeusz.matenko@intel.com> - 1.2.0-2
- Add sysusers
* Fri Jul 26 2024 Yeng Liong Wong <yeng.liong.wong@intel.com> - 1.2.0-1
- Original version for Edge Microvisor Toolkit. License verified.