diff --git a/powerpc-utils-amsstat.patch b/powerpc-utils-amsstat.patch new file mode 100644 index 0000000..e414615 --- /dev/null +++ b/powerpc-utils-amsstat.patch @@ -0,0 +1,164 @@ +commit 2568514fc910e3bb075b9b94d9d486243ddb5d29 +Author: Nathan Fontenot +Date: Wed May 19 13:36:22 2010 -0500 + + The amsstat appears to make some assumptions, namely that AMS is + enabled and all of the files it pulls data from exist. This patch + updates the script to verify that AMS is available and enabled before + trying to gather information. If either are not, it prints an error + message and exits. + + This also updates the file checking to redirect error messages from + the pushd command and print an appropriate error message if the file + is not present. + + Signed-off-by: Nathan Fontenot + +diff --git a/scripts/amsstat b/scripts/amsstat +index 11be072..628a797 100755 +--- a/scripts/amsstat ++++ b/scripts/amsstat +@@ -22,6 +22,7 @@ sleep_interval=$1 + indent=-4 + devstat_data_spacing=-30 + lparcfg_data_spacing=-30 ++lparcfg_file=/proc/ppc64/lparcfg + + function print_meminfo_stats { + echo "System Memory Statistics:" +@@ -38,7 +39,7 @@ function print_meminfo_stats { + done + + # Include Desired Memory value from /proc/ppc64/lparcfg +- stat=`grep "^DesMem" /proc/ppc64/lparcfg` ++ stat=`grep "^DesMem" $lparcfg_file` + if [ ! -z "${stat}" ]; then + this_stat=`echo $stat | awk -F= '{print $1}'` + this_value=`echo $stat | awk -F= '{print $2}'` +@@ -48,7 +49,7 @@ function print_meminfo_stats { + + function print_entitlement_data { + echo "Entitlement Information:" +- for stat in `cat /proc/ppc64/lparcfg`; do ++ for stat in `cat $lparcfg_file`; do + if echo $stat | grep "^entitled_memory\|^mapped_entitled_memory\|^entitled_memory_weight\|entitled_memory_pool_size\|^backing_memory\|^cmo_enabled\|^cmo_faults\|^cmo_fault_time_usec\|cmo_primary_psp\|^cmo_secondary_psp" >/dev/null; then + this_stat=`echo $stat | awk -F= '{print $1}'` + this_value=`echo $stat | awk -F= '{print $2}'` +@@ -59,12 +60,15 @@ function print_entitlement_data { + + function print_cmm_stats { + # CMM kernel parameters ++ echo "CMM Statistics:" ++ + local path=/sys/module/cmm/parameters +- pushd $path >/dev/null ++ pushd $path >/dev/null 2>&1 + if [ $? -ne 0 ] ; then +- exit 1 ++ printf "%${indent}s Could not get CMM Statistics.\n" " " ++ return + fi +- echo "CMM Statistics:" ++ + for stat in `find . -mindepth 1 -maxdepth 1 -print`; do + printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" + done +@@ -72,9 +76,9 @@ function print_cmm_stats { + + # CMM statistics + local path=/sys/devices/system/cmm/cmm0 +- pushd $path >/dev/null ++ pushd $path >/dev/null 2>&1 + if [ $? -ne 0 ] ; then +- exit 1 ++ return + fi + for stat in `find . -mindepth 1 -maxdepth 1 -print`; do + printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" +@@ -83,33 +87,50 @@ function print_cmm_stats { + } + + function print_vio_bus_stats { ++ echo "VIO Bus Statistics:" ++ local found=0 + local path=/sys/bus/vio +- pushd $path >/dev/null ++ pushd $path >/dev/null 2>&1 + if [ $? -ne 0 ] ; then +- exit 1 ++ printf "%${indent}s Could not get VIO Bus Statistics.\n" " " ++ return + fi +- echo "VIO Bus Statistics:" ++ + for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do ++ found=1 + printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" + done + popd >/dev/null ++ ++ if [ "$found" -eq "0" ]; then ++ printf "%${indent}s No AMS Busses found.\n" " " ++ fi + } + + + function print_vio_dev_stats { ++ echo "VIO Device Statistics:" ++ ++ local found=0 + local path=/sys/bus/vio/devices +- pushd $path >/dev/null ++ pushd $path >/dev/null 2>&1 + if [ $? -ne 0 ] ; then +- exit 1 ++ printf "%${indent}s Could not get VIO Device Statistics.\n" " " ++ return + fi +- echo "VIO Device Statistics:" ++ + for dir in `find . -mindepth 1 -print`; do +- pushd $dir >/dev/null ++ pushd $dir >/dev/null 2>&1 + if [ $? -ne 0 ] ; then + break + fi + + # Skip printing devices that are not using entitlement ++ if [ ! -e "cmo_entitled" ]; then ++ popd >/dev/null ++ continue ++ fi ++ + value=`cat cmo_entitled` + if [ ${value} -eq "0" ]; then + popd >/dev/null +@@ -119,13 +140,28 @@ function print_vio_dev_stats { + NAME=$(cat devspec) + echo " ${NAME##/*/}:" + for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do ++ found=1 + printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" + done + popd >/dev/null + done + popd >/dev/null ++ ++ if [ "$found" -eq "0" ]; then ++ printf "%${indent}s No AMS devices found.\n" " " ++ fi + } + ++# Verify CMO is present and enabled ++enabled=`cat $lparcfg_file | grep "^cmo_enabled" | awk -F= '{print $2}'` ++if [ -z $enabled ]; then ++ echo "This system is not capable of Active Memory Sharing." ++ exit -1 ++elif [ "$enabled" -eq "0" ]; then ++ echo "Active Memory Sharing is not enabled on this system." ++ exit -1 ++fi ++ + if [ -z $sleep_interval ]; then + date + print_meminfo_stats diff --git a/powerpc-utils-man_ofpathname.patch b/powerpc-utils-man_ofpathname.patch new file mode 100644 index 0000000..904ae75 --- /dev/null +++ b/powerpc-utils-man_ofpathname.patch @@ -0,0 +1,39 @@ +commit 7a17ff0743cdec7ee2edb2b3aad347566136b6d5 +Author: Nathan Fontenot +Date: Wed Apr 7 20:19:01 2010 -0500 + + This patch adds -a -V options to the ofpathname man page. + + Signed-off-by: Kamalesh Babulal + +diff --git a/man/ofpathname.8 b/man/ofpathname.8 +index 1f61b88..d5abc17 100644 +--- a/man/ofpathname.8 ++++ b/man/ofpathname.8 +@@ -6,7 +6,7 @@ + .SH NAME + ofpathname \- translate between Open Firmware and logical device names + .SH SYNOPSIS +-\fB/usr/sbin/ofpathname \fR[\fB-lq\fR] \fIname ++\fB/usr/sbin/ofpathname \fR[\fB-laqVh\fR] \fIname + .SH DESCRIPTION + .I Ofpathname + provides the ability to translate logical device names to their Open Firmware +@@ -17,10 +17,16 @@ Firmware device path to its logical device name using the -l option. + \fB\-l + Translate the \fIname \fRparameter to the corresponding logical device name. + .TP ++\fB\-a ++Find a matching Open Firmware device alias[es]. ++.TP + \fB\--quiet \fR(\fB\-q\fR) + Do not report any failures, exit quietly. + .TP +-\fB\--help \fR(\fB\-?\fR) ++\fB\--version \fR(\fB\-V\fR) ++Displat version and exit ++.TP ++\fB\--help \fR(\fB\-h\fR) + print usage information. + .SH AUTHOR + Written by Nathan Fontenot diff --git a/powerpc-utils.spec b/powerpc-utils.spec index 2c8671c..21497df 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.2.2 -Release: 11%{?dist} +Release: 14%{?dist} Summary: Utilities for PowerPC platforms Group: System Environment/Base @@ -48,6 +48,12 @@ Patch10: powerpc-utils-cpu_dlpar_check.patch # Corrects the parameter handling of ppc64_cpu when setting the run-mode Patch11: powerpc-utils-run_mode.patch +# 602717, amsstat changes from upstream +Patch12: powerpc-utils-amsstat.patch + +# 607356, ofpathname man page update +Patch13: powerpc-utils-man_ofpathname.patch + # This is done before release of F12 Obsoletes: powerpc-utils-papr < 1.1.6-3 Provides: powerpc-utils-papr = 1.1.6-3 @@ -73,9 +79,12 @@ Utilities for PowerPC platforms. %patch9 -p1 -b .cpudscr %patch10 -p1 -b .cpu_dlpar_check %patch11 -p1 -b .run_mode +%patch12 -p1 -b .amsstat +%patch13 -p1 -b .man_ofpathname %build ./bootstrap.sh +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %configure make %{?_smp_mflags} @@ -94,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/powerpc-utils # remove init script and perl script. They are deprecated rm -rf $RPM_BUILD_ROOT/etc/init.d/ibmvscsis.sh $RPM_BUILD_ROOT/usr/sbin/vscsisadmin +# nvsetenv is just a wrapper to nvram +ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz + %clean rm -rf $RPM_BUILD_ROOT @@ -108,6 +120,7 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/lsdevinfo %{_sbindir}/lsprop %{_mandir}/man8/nvram.8* +%{_mandir}/man8/nvsetenv.8* %{_mandir}/man8/snap.8* %{_mandir}/man8/bootlist.8* %{_mandir}/man8/ofpathname.8* @@ -155,6 +168,12 @@ rm -rf $RPM_BUILD_ROOT %preun %changelog +* Thu Jun 24 2010 Roman Rakus - 1.2.2-14 +- Compile with -fno-strict-aliasing CFLAG +- linked nvsetenv man page to nvram man page +- Updated man page of ofpathname +- Updated amsstat script + * Tue Jun 15 2010 Roman Rakus - 1.2.2-11 - Correct the parameter handling of ppc64_cpu when setting the run-mode