Provides: oracleasm = 2.0.5\
%ifnarch sparc64\
Provides: x86_energy_perf_policy = %{KVERREL}%{?1:.%{1}}\
+Provides: turbostat = %{KVERREL}%{?1:.%{1}}\
%endif\
Provides: perf = %{KVERREL}%{?1:.%{1}}\
#Provides: libperf.a = %{KVERREL}%{?1:.%{1}}\
Source17: kabitool
Source18: check-kabi
Source20: x86_energy_perf_policy
+Source21: turbostat
Source1000: config-x86_64
Source1001: config-x86_64-debug
install -m 755 x86_energy_perf_policy $RPM_BUILD_ROOT/usr/libexec/x86_energy_perf_policy.$KernelVer
cd ../../../../
fi
+
+# build tools/power/x86/turbostat:
+ if [ -d tools/power/x86/turbostat ]; then
+ cd tools/power/x86/turbostat
+ make
+# and install it:
+ mkdir -p $RPM_BUILD_ROOT/usr/libexec/
+ install -m 755 turbostat $RPM_BUILD_ROOT/usr/libexec/turbostat.$KernelVer
+ cd ../../../../
+ fi
%endif
%endif
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
cp $RPM_SOURCE_DIR/x86_energy_perf_policy $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
chmod 0755 $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
+# turbostat shell wrapper
+mkdir -p $RPM_BUILD_ROOT/usr/sbin/
+cp $RPM_SOURCE_DIR/turbostat $RPM_BUILD_ROOT/usr/sbin/turbostat
+chmod 0755 $RPM_BUILD_ROOT/usr/sbin/turbostat
%endif
%ifnarch sparc64\
/usr/libexec/x86_energy_perf_policy.%{KVERREL}%{?2:.%{2}}\
/usr/sbin/x86_energy_perf_policy\
+/usr/libexec/turbostat.%{KVERREL}%{?2:.%{2}}\
+/usr/sbin/turbostat\
%endif\
%ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\
%{expand:%%files %{?2:%{2}-}devel}\
--- /dev/null
+#!/bin/sh
+
+# In pathological situations, this will print some error about uname.
+kverrel="`uname -r`" || exit
+
+exec "/usr/libexec/turbostat.$kverrel" ${1+"$@"}
+rc=$?
+
+# We're still here, so the exec failed.
+echo >&2 "Sorry, your kernel ($kverrel) doesn't support turbostat."
+
+exit $rc
Provides: oracleasm = 2.0.5\
%ifnarch sparc64\
Provides: x86_energy_perf_policy = %{KVERREL}%{?1:.%{1}}\
+Provides: turbostat = %{KVERREL}%{?1:.%{1}}\
%endif\
Provides: perf = %{KVERREL}%{?1:.%{1}}\
#Provides: libperf.a = %{KVERREL}%{?1:.%{1}}\
Source20: x86_energy_perf_policy
Source21: securebootca.cer
Source22: secureboot.cer
+Source23: turbostat
Source1000: config-x86_64
Source1001: config-x86_64-debug
install -m 755 x86_energy_perf_policy $RPM_BUILD_ROOT/usr/libexec/x86_energy_perf_policy.$KernelVer
cd ../../../../
fi
+# build tools/power/x86/turbostat:
+ if [ -d tools/power/x86/turbostat ]; then
+ cd tools/power/x86/turbostat
+ make
+# and install it:
+ mkdir -p $RPM_BUILD_ROOT/usr/libexec/
+ install -m 755 turbostat $RPM_BUILD_ROOT/usr/libexec/turbostat.$KernelVer
+ cd ../../../../
+ fi
%endif
%endif
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
cp $RPM_SOURCE_DIR/x86_energy_perf_policy $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
chmod 0755 $RPM_BUILD_ROOT/usr/sbin/x86_energy_perf_policy
+# turbostat shell wrapper
+mkdir -p $RPM_BUILD_ROOT/usr/sbin/
+cp $RPM_SOURCE_DIR/turbostat $RPM_BUILD_ROOT/usr/sbin/turbostat
+chmod 0755 $RPM_BUILD_ROOT/usr/sbin/turbostat
%endif
%ifnarch sparc64\
/usr/libexec/x86_energy_perf_policy.%{KVERREL}%{?2:.%{2}}\
/usr/sbin/x86_energy_perf_policy\
+/usr/libexec/turbostat.%{KVERREL}%{?2:.%{2}}\
+/usr/sbin/turbostat\
%endif\
%ghost /boot/initramfs-%{KVERREL}%{?2:.%{2}}.img\
%{expand:%%files %{?2:%{2}-}devel}\
--- /dev/null
+#!/bin/sh
+
+# In pathological situations, this will print some error about uname.
+kverrel="`uname -r`" || exit
+
+exec "/usr/libexec/turbostat.$kverrel" ${1+"$@"}
+rc=$?
+
+# We're still here, so the exec failed.
+echo >&2 "Sorry, your kernel ($kverrel) doesn't support turbostat."
+
+exit $rc