@@ -290,9 +290,11 @@ cp client/target/lib/*jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/lib/
290290rm -rf ${RPM_BUILD_ROOT}%{_datadir }/%{name }-management/webapps/client/WEB-INF/classes/scripts
291291rm -rf ${RPM_BUILD_ROOT}%{_datadir }/%{name }-management/webapps/client/WEB-INF/classes/vms
292292
293- for name in db.properties server.properties log4j-cloud.xml environment.properties java.security.ciphers
293+ for name in db.properties server.properties log4j-cloud.xml uefi.properties environment.properties java.security.ciphers
294294do
295- cp client/target/conf/$name ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/management/$name
295+ if [ -f "client/target/conf/$name" ] ; then
296+ cp client/target/conf/$name ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/management/$name
297+ fi
296298done
297299
298300ln -sf log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/management/log4j2.xml
@@ -358,6 +360,7 @@ install -D packaging/systemd/cloudstack-agent.service ${RPM_BUILD_ROOT}%{_unitdi
358360install -D packaging/systemd/
[email protected] ${RPM_BUILD_ROOT}%{
_unitdir }/%{
name }
[email protected] 359361install -D packaging/systemd/cloudstack-agent.default ${RPM_BUILD_ROOT}%{_sysconfdir }/default/%{name }-agent
360362install -D agent/target/transformed/agent.properties ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/agent.properties
363+ install -D agent/target/transformed/uefi.properties ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/uefi.properties
361364install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/environment.properties
362365install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir }/%{name }/agent/log4j-cloud.xml
363366install -D agent/target/transformed/cloud-setup-agent ${RPM_BUILD_ROOT}%{_bindir }/%{name }-setup-agent
@@ -525,14 +528,22 @@ mkdir -m 0755 -p /usr/share/cloudstack-agent/tmp
525528/usr/bin/systemctl enable cloudstack-rolling-maintenance@p > /dev/null 2> &1 || true
526529/usr/bin/systemctl enable --now rngd > /dev/null 2> &1 || true
527530
528- # if saved configs from upgrade exist, copy them over
531+ # if saved agent.properties from upgrade exist, copy them over
529532if [ -f "%{_sysconfdir }/cloud.rpmsave/agent/agent.properties" ]; then
530533 mv %{_sysconfdir }/%{name }/agent/agent.properties %{_sysconfdir }/%{name }/agent/agent.properties.rpmnew
531534 cp -p %{_sysconfdir }/cloud.rpmsave/agent/agent.properties %{_sysconfdir }/%{name }/agent
532535 # make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall
533536 mv %{_sysconfdir }/cloud.rpmsave/agent/agent.properties %{_sysconfdir }/cloud.rpmsave/agent/agent.properties.rpmsave
534537fi
535538
539+ # if saved uefi.properties from upgrade exist, copy them over
540+ if [ -f "%{_sysconfdir }/cloud.rpmsave/agent/uefi.properties" ]; then
541+ mv %{_sysconfdir }/%{name }/agent/uefi.properties %{_sysconfdir }/%{name }/agent/uefi.properties.rpmnew
542+ cp -p %{_sysconfdir }/cloud.rpmsave/agent/uefi.properties %{_sysconfdir }/%{name }/agent
543+ # make sure we only do this on the first install of this RPM, don't want to overwrite on a reinstall
544+ mv %{_sysconfdir }/cloud.rpmsave/agent/uefi.properties %{_sysconfdir }/cloud.rpmsave/agent/uefi.properties.rpmsave
545+ fi
546+
536547systemctl daemon-reload
537548
538549# Print help message
@@ -603,6 +614,7 @@ pip3 install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
603614%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir }/%{name }/management/config.json
604615%config(noreplace) %{_sysconfdir }/%{name }/management/log4j-cloud.xml
605616%config(noreplace) %{_sysconfdir }/%{name }/management/log4j2.xml
617+ %config(noreplace) %{_sysconfdir }/%{name }/management/uefi.properties
606618%config(noreplace) %{_sysconfdir }/%{name }/management/environment.properties
607619%config(noreplace) %{_sysconfdir }/%{name }/management/java.security.ciphers
608620%config(noreplace) %attr(0644,root,root) %{_sysconfdir }/logrotate.d/%{name }-management
0 commit comments