add systemd service to set default system SMT mode

This commit is contained in:
Than Ngo 2019-12-19 17:04:29 +01:00
parent 5624d93971
commit 7b1c3b56e9
2 changed files with 57 additions and 8 deletions

View File

@ -0,0 +1,25 @@
diff -up powerpc-utils-1.3.4/systemd/smt_off.service.in.me powerpc-utils-1.3.4/systemd/smt_off.service.in
--- powerpc-utils-1.3.4/systemd/smt_off.service.in.me 2019-12-19 06:16:11.130247649 -0500
+++ powerpc-utils-1.3.4/systemd/smt_off.service.in 2019-12-19 06:16:26.790578489 -0500
@@ -1,6 +1,6 @@
[Unit]
Description=ppc64 set SMT off
-Before=libvirt-bin.service
+Before=libvirtd.service
[Service]
Type=oneshot
diff -up powerpc-utils-1.3.4/Makefile.am.me powerpc-utils-1.3.4/Makefile.am
--- powerpc-utils-1.3.4/Makefile.am.me 2019-12-19 07:25:40.658126337 -0500
+++ powerpc-utils-1.3.4/Makefile.am 2019-12-19 07:26:38.429345149 -0500
@@ -191,7 +191,7 @@ src_drmgr_lsslot_LDADD = -lrtas
if WITH_SYSTEMD
install-data-hook: systemd/smt_off.service
- $(MKDIR_P) @prefix@${systemd_unit_dir}
- $(INSTALL_SCRIPT) $< @prefix@${systemd_unit_dir}/
- sed -i -e 's,$${exec_prefix},@sbindir@,g' @prefix@${systemd_unit_dir}/smt_off.service
+ $(MKDIR_P) ${systemd_unit_dir}
+ $(INSTALL_SCRIPT) $< ${systemd_unit_dir}/
+ sed -i -e 's,$${exec_prefix},@sbindir@,g' ${systemd_unit_dir}/smt_off.service
endif

View File

@ -1,6 +1,6 @@
Name: powerpc-utils Name: powerpc-utils
Version: 1.3.7 Version: 1.3.7
Release: 1%{?dist} Release: 2%{?dist}
Summary: Utilities for PowerPC platforms Summary: Utilities for PowerPC platforms
License: GPLv2 License: GPLv2
@ -18,16 +18,23 @@ BuildRequires: librtas-devel >= 1.4.0
BuildRequires: libservicelog-devel >= 1.0.1-2 BuildRequires: libservicelog-devel >= 1.0.1-2
BuildRequires: perl-generators BuildRequires: perl-generators
Requires: /usr/bin/which Requires: which
# rtas_dump explicit dependency # rtas_dump explicit dependency
Requires: perl(Data::Dumper) Requires: perl(Data::Dumper)
Requires: %{name}-core = %{version}-%{release} Requires: %{name}-core = %{version}-%{release}
Requires: systemd
Requires: kmod
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Patch1: powerpc-utils-1.2.15-man.patch Patch1: powerpc-utils-1.2.15-man.patch
Patch2: powerpc-utils-1.2.27-makefile.patch Patch2: powerpc-utils-1.2.27-makefile.patch
Patch3: powerpc-utils-1.3.5-pseries_platform-man.patch Patch3: powerpc-utils-1.3.5-pseries_platform-man.patch
Patch4: powerpc-utils-1.3.5-update_flash_nv.patch Patch4: powerpc-utils-1.3.5-update_flash_nv.patch
Patch5: powerpc-utils-1.3.5-install-man.patch Patch5: powerpc-utils-1.3.5-install-man.patch
# systemd to set default system SMT mode
Patch6: powerpc-utils-1.3.4-systemd.patch
%description %description
Utilities for PowerPC platforms. Utilities for PowerPC platforms.
@ -63,11 +70,12 @@ Utilities needed when installing Fedora on PowerPC systems.
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1 -b .systemd
%build %build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
./autogen.sh ./autogen.sh
%configure %configure --with-systemd=$RPM_BUILD_ROOT%{_unitdir}
make %{?_smp_mflags} make %{?_smp_mflags}
@ -90,10 +98,25 @@ rm -rf $RPM_BUILD_ROOT/etc/init.d/ibmvscsis.sh $RPM_BUILD_ROOT/usr/sbin/vscsisad
# nvsetenv is just a wrapper to nvram # nvsetenv is just a wrapper to nvram
ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz
ln -s serv_config %{buildroot}%{_sbindir}/uspchrp
ln -s serv_config.8 %{buildroot}%{_mandir}/man8/uspchrp.8
# deprecated, use sosreport instead
rm -f $RPM_BUILD_ROOT%{_sbindir}/snap $RPM_BUILD_ROOT%{_mandir}/man8/snap.8*
%post
%systemd_post smt_off.service
%preun
%systemd_preun smt_off.service
%postun
%systemd_postun_with_restart smt_off.service
%files %files
%doc README Changelog %doc README Changelog
%attr(644, -, -) %{_unitdir}/smt_off.service
%{_bindir}/amsstat %{_bindir}/amsstat
%{_sbindir}/activate_firmware %{_sbindir}/activate_firmware
%{_sbindir}/bootlist %{_sbindir}/bootlist
@ -119,10 +142,7 @@ ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz
%{_sbindir}/uesensor %{_sbindir}/uesensor
%{_sbindir}/update_flash %{_sbindir}/update_flash
%{_sbindir}/update_flash_nv %{_sbindir}/update_flash_nv
%{_sbindir}/uspchrp
# use sosreport from sos instead
%exclude %{_sbindir}/snap
%exclude %{_mandir}/man8/snap.8*
%{_mandir}/man1/amsstat.1* %{_mandir}/man1/amsstat.1*
%{_mandir}/man5/lparcfg.5* %{_mandir}/man5/lparcfg.5*
@ -151,6 +171,7 @@ ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz
%{_mandir}/man8/update_flash.8* %{_mandir}/man8/update_flash.8*
%{_mandir}/man8/pseries_platform.8* %{_mandir}/man8/pseries_platform.8*
%{_mandir}/man8/update_flash_nv.8* %{_mandir}/man8/update_flash_nv.8*
%{_mandir}/man8/uspchrp.8*
%files core %files core
%license COPYING %license COPYING
@ -164,6 +185,9 @@ ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz
%changelog %changelog
* Thu Dec 19 2019 Than Ngo <than@redhat.com> - 1.3.7-2
- add systemd service to set default system SMT mode
* Wed Dec 18 2019 Than Ngo <than@redhat.com> - 1.3.7-1 * Wed Dec 18 2019 Than Ngo <than@redhat.com> - 1.3.7-1
- update to 1.3.7 - update to 1.3.7