install smt.state as config file

drop nvsetenv which is included in upstream
This commit is contained in:
Than Ngo 2022-06-08 09:55:00 +02:00
parent 09dcdb9862
commit cbd4e8bc94
2 changed files with 8 additions and 26 deletions

View File

@ -1,14 +0,0 @@
#!/bin/sh
if [ "$1" = "--version" ]; then
echo This version of nvsetenv is just a wrapper to invoke nvram
exit 0
fi
if [ -z "$1" ]; then
nvram --print-config
elif [ -z "$2" ]; then
nvram --print-config="$1"
else
nvram --update-config "$1"="$2"
fi
exit $?

View File

@ -1,12 +1,11 @@
Name: powerpc-utils
Version: 1.3.10
Release: 1%{?dist}
Release: 2%{?dist}
Summary: PERL-based scripts for maintaining and servicing PowerPC systems
License: GPLv2
URL: https://github.com/ibm-power-utilities/powerpc-utils
Source0: https://github.com/ibm-power-utilities/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: nvsetenv
Patch0: powerpc-utils-1.3.10-manpages.patch
Patch1: powerpc-utils-1.3.10-distro.patch
@ -61,15 +60,13 @@ Core utilities for maintaining and servicing PowerPC systems.
%autosetup -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
./autogen.sh
%configure --with-systemd=%{_unitdir} --disable-werror
make %{?_smp_mflags}
make %{?_smp_mflags} V=1
%install
make install DESTDIR=$RPM_BUILD_ROOT FILES= RCSCRIPTS=
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/nvsetenv
#define pkgdocdir {_datadir}/doc/{name}-{version}
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
@ -95,11 +92,6 @@ rm -f $RPM_BUILD_ROOT%{_sbindir}/snap $RPM_BUILD_ROOT%{_mandir}/man8/snap.8*
%post core
%systemd_post hcn-init.service
# add default SMT_VALUE=1 in smt.state
SMTSTATE=/var/lib/powerpc-utils/smt.state
if [ ! -f $SMTSTATE ] ; then
echo SMT_VALUE=1 > $SMTSTATE
fi
# update the smt.state file with current SMT
/usr/sbin/smtstate --save >/dev/null 2>&1 || :
@ -124,8 +116,8 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || :
%files core
%license COPYING
%dir /var/lib/powerpc-utils
%ghost %config(missingok,noreplace) /var/lib/powerpc-utils/smt.state
%dir %{_localstatedir}/lib/powerpc-utils
%config(noreplace) %{_localstatedir}/lib/powerpc-utils/smt.state
%{_unitdir}/smtstate.service
%{_unitdir}/smt_off.service
%{_unitdir}/hcn-init.service
@ -200,6 +192,10 @@ systemctl enable hcn-init.service >/dev/null 2>&1 || :
%changelog
* Wed Jun 08 2022 Than Ngo <than@redhat.com> - 1.3.10-2
- install smt.state as config file
- drop nvsetenv which is included in upstream
* Fri Jun 03 2022 Than Ngo <than@redhat.com> - 1.3.10-1
- update to 1.3.10