From 956c23925af12ebfd97ca59ccdb24cd6cb729284 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 23 2019 02:02:56 +0000 Subject: import powerpc-utils-1.3.4-10.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e2543c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/v1.3.4.tar.gz diff --git a/.powerpc-utils.metadata b/.powerpc-utils.metadata new file mode 100644 index 0000000..7595da9 --- /dev/null +++ b/.powerpc-utils.metadata @@ -0,0 +1 @@ +8618237d324ce68a1fc0d71f208b35654b5d737d SOURCES/v1.3.4.tar.gz diff --git a/SOURCES/nvsetenv b/SOURCES/nvsetenv new file mode 100644 index 0000000..9ee9571 --- /dev/null +++ b/SOURCES/nvsetenv @@ -0,0 +1,14 @@ +#!/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 $? diff --git a/SOURCES/powerpc-utils-01c9cbcf.patch b/SOURCES/powerpc-utils-01c9cbcf.patch new file mode 100644 index 0000000..e6783c8 --- /dev/null +++ b/SOURCES/powerpc-utils-01c9cbcf.patch @@ -0,0 +1,71 @@ +commit 01c9cbcf4face809cb6953bc3cd2a30cd075ed16 +Author: Tyrel Datwyler +Date: Thu Dec 6 17:30:38 2018 -0600 + + lparstat: correct calculation of physc to use tbr + + Currently phsyc is calculated using the sampled PURR values from lparcfg and + a derived timebase that lparstat itself calculates. However, both the Timer + Facilities section in Book III of the ISA and PAPR outline that this resource + calcuation is done by computing the ratio of the PURR delta and the Timebase + Register delta for the sampled period. + + I've sent a patch upstream to the kernel list to also export the Timebase + Register (tbr) in /proc/ppc64/lparcfg [1]. Use this value for calculating + physc value when running on a kernel that exposes tbr. + + [1] https://patchwork.ozlabs.org/patch/1009906/ + + Signed-off-by: Tyrel Datwyler + +diff --git a/src/lparstat.c b/src/lparstat.c +index 23e45f7..ec57c1a 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -155,17 +155,27 @@ void get_cpu_physc(struct sysentry *unused_se, char *buf) + float elapsed; + float new_purr, old_purr; + float timebase, physc; +- +- elapsed = elapsed_time() / 1000000.0; +- +- se = get_sysentry("timebase"); +- timebase = atoi(se->value); ++ float new_tb, old_tb; + + se = get_sysentry("purr"); + new_purr = strtoll(se->value, NULL, 0); + old_purr = strtoll(se->old_value, NULL, 0); + +- physc = (new_purr - old_purr)/timebase/elapsed; ++ se = get_sysentry("tbr"); ++ if (se->value[0] != '\0') { ++ new_tb = strtoll(se->value, NULL, 0); ++ old_tb = strtoll(se->old_value, NULL, 0); ++ ++ physc = (new_purr - old_purr) / (new_tb - old_tb); ++ } else { ++ elapsed = elapsed_time() / 1000000.0; ++ ++ se = get_sysentry("timebase"); ++ timebase = atoi(se->value); ++ ++ physc = (new_purr - old_purr)/timebase/elapsed; ++ } ++ + sprintf(buf, "%.6f", physc); + } + +diff --git a/src/lparstat.h b/src/lparstat.h +index c447692..3aee192 100644 +--- a/src/lparstat.h ++++ b/src/lparstat.h +@@ -129,6 +129,8 @@ struct sysentry system_data[] = { + .descr = "Virtual Processor Dispersions"}, + {.name = "purr", + .descr = "Processor Utilization Resource Register"}, ++ {.name = "tbr", ++ .descr = "Timebase Register"}, + {.name = "partition_active_processors", + .descr = "Online Virtual CPUs"}, + {.name = "partition_potential_processors", diff --git a/SOURCES/powerpc-utils-081e7ac9.patch b/SOURCES/powerpc-utils-081e7ac9.patch new file mode 100644 index 0000000..0e62eb4 --- /dev/null +++ b/SOURCES/powerpc-utils-081e7ac9.patch @@ -0,0 +1,48 @@ +commit 081e7ac9675b49346e937236f38822b33c8c751b +Author: Vasant Hegde +Date: Sun Jan 21 21:10:07 2018 +0530 + + update_flash: Use inband ipmi path to get firmware version + + update_flash_nv uses 'ipmitool -I usb' interface to get firmware version + details. This is AMI BMC OEM feature and not available on other BMC systems. + Hence lets use inband interface to get firmware version details. + + Signed-off-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/update_flash_nv b/scripts/update_flash_nv +index 0cec2eb..0ef765c 100755 +--- a/scripts/update_flash_nv ++++ b/scripts/update_flash_nv +@@ -588,16 +588,27 @@ opp_manage_flash() { + } + + opp_display_current_fw_version() { +- check_ipmitool ++ which ipmitool >/dev/null 2>&1 ++ if [ $? -ne 0 ]; then ++ echo "update_flash: ipmitool command not found." ++ error $E_IPMI "Please install ipmitool and retry." ++ fi ++ ++ # Use inband interface to get firmware version ++ ipmitool mc info >/dev/null 2>&1 && break; ++ if [ $? -ne 0 ]; then ++ echo "update_flash: ipmi inband interface is not working." ++ error $E_IPMI "Check 'ipmi_devintf' kernel module loaded or not." ++ fi + + echo +- id=`ipmitool -I usb fru 2>/dev/null |grep "System Firmware" | cut -d " " -f8 | cut -d ")" -f1` ++ id=`ipmitool fru 2>/dev/null |grep "System Firmware" | cut -d " " -f8 | cut -d ")" -f1` + if [ "x$id" = "x" ]; then + error $E_IPMI "Failed to get firmware version." + fi + + echo "Firmware version:" +- ipmitool -I usb fru print $id ++ ipmitool fru print $id + + exit $E_SUCCESS + } diff --git a/SOURCES/powerpc-utils-1.2.15-man.patch b/SOURCES/powerpc-utils-1.2.15-man.patch new file mode 100644 index 0000000..588c693 --- /dev/null +++ b/SOURCES/powerpc-utils-1.2.15-man.patch @@ -0,0 +1,328 @@ +diff -up powerpc-utils-1.2.25/Makefile.am.man powerpc-utils-1.2.25/Makefile.am +--- powerpc-utils-1.2.25/Makefile.am.man 2015-04-13 18:36:01.000000000 +0200 ++++ powerpc-utils-1.2.25/Makefile.am 2015-06-18 10:23:04.039591102 +0200 +@@ -43,7 +43,15 @@ man_MANS = \ + man/lsslot.8 \ + man/ppc64_cpu.8 \ + man/errinjct.8 \ +- man/rtas_dbg.8 ++ man/rtas_dbg.8 \ ++ man/lsdevinfo.8 \ ++ man/rtas_event_decode.8 \ ++ man/ls-vdev.8 \ ++ man/lsprop.8 \ ++ man/drmgr.8 \ ++ man/ls-veth.8 \ ++ man/nvsetenv.8 \ ++ man/ls-vscsi.8 + + EXTRA_DIST += $(bin_SCRIPTS) $(sbin_SCRIPTS) $(man_MANS) + +diff -up powerpc-utils-1.2.25/man/drmgr.8.man powerpc-utils-1.2.25/man/drmgr.8 +--- powerpc-utils-1.2.25/man/drmgr.8.man 2015-06-18 10:23:04.040591105 +0200 ++++ powerpc-utils-1.2.25/man/drmgr.8 2015-06-18 10:23:04.040591105 +0200 +@@ -0,0 +1,60 @@ ++.TH DRMGR "8" "Oct 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++drmgr \- Dynamic Resource Manager. Utility used to perform DLPAR operations on a client partition. ++ ++.SH SYNOPSIS ++.B drmgr ++.RB [ \-w ++.IR minutes ] ++.RB [ \-d ++.IR detail_level ] ++.RB [ \-C | \-\-capabilities ] ++.RB [ \-h | \-\-help ] ++ ++.B drmgr ++.RB { \-c " {" port " | " slot " | " phb " | " pci " | " mem " | " cpu } ++.RB | \-m } ++ ++.B drmgr \-c ++.RB { port " | " slot " | " phb } ++.RB { \-a " | " \-r " | " \-Q "} " \-s ++.I drc_name ++ ++.B drmgr \-c pci \-s ++.I slot ++.RB { \-i " | " \-a " [" \-I "] | " \-r " [" \-I "] | " \-R " [" \-I "]}" ++ ++.B drmgr \-c mem ++.RB { \-a " | " \-r "} {" \-q ++.I quantity ++.BR \-p ++.RI { variable_weight " | " ent_capacity "} |" ++.RB { \-q ++.I quantity ++.RB "| " \-s ++.IR drc_name }} ++ ++.B drmgr \-c cpu ++.RB { \-a " | " \-r "} {" \-q ++.I quantity ++.BR \-p ++.RI { variable_weight " | " ent_capacity } ++.RB [ \-s ++.IR drc_names ] ++ ++ ++ ++.SH OVERVIEW ++.B drmgr ++program is a member of the ppc64-utils suite of utils. ++Use it to list DLPAR and hotplug capable slots. ++ ++.SH DESCRIPTION ++.B drmgr ++is a utility to list DLPAR and hotplug capable slots. ++ ++.SH AUTHOR ++.B drmgr ++was written by IBM Corporation ++.PP ++This manual page was written by Roman Rakus +diff -up powerpc-utils-1.2.25/man/lsdevinfo.8.man powerpc-utils-1.2.25/man/lsdevinfo.8 +--- powerpc-utils-1.2.25/man/lsdevinfo.8.man 2015-06-18 10:23:04.040591105 +0200 ++++ powerpc-utils-1.2.25/man/lsdevinfo.8 2015-06-18 10:23:04.040591105 +0200 +@@ -0,0 +1,39 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. ++.TH LSDEVINFO "8" "October 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++lsdevinfo - information on Virtual devices ++ ++.SH SYNOPSIS ++.B lsdevinfo ++[\fI-q criteria\fR] [\fI-F format\fR] [\fI-R\fR] [\fI-c\fR] [\fI-h\fR] ++ ++.SH DESCRIPTION ++Provide information on Virtual devices ++.PP ++ ++.SH OPTIONS ++.TP ++\fB\-q\fR criteria ++Specifies a criteria to select which devices are to be displayed. ++.TP ++\fB\-F\fR format ++Specifies the set of attributes to be displayed. ++.TP ++\fB\-R\fR ++Recursively display children of selected devices ++.TP ++\fB\-c\fR ++Display output as a comma separated list for each device. ++.TP ++\fB\-V\fR ++Display version information and exit ++.TP ++\fB\-h\fR ++Display help information and exit ++ ++.SH AUTHOR ++.B lsdevinfo ++was written by Santiago Leon . ++.PP ++This manual page was written by Roman Rakus . ++ +diff -up powerpc-utils-1.2.25/man/lsprop.8.man powerpc-utils-1.2.25/man/lsprop.8 +--- powerpc-utils-1.2.25/man/lsprop.8.man 2015-06-18 10:23:04.040591105 +0200 ++++ powerpc-utils-1.2.25/man/lsprop.8 2015-06-18 10:23:04.040591105 +0200 +@@ -0,0 +1,42 @@ ++.TH LSPROP "8" "Sep 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++lsprop \- list properties ++.SH SYNOPSIS ++.B lsprop ++.RB [ \-R ] ++.RB [ \-m ++.IR max-bytes ] ++.RB [ \-w ++.IR num-words ] ++.RI [ FILE .\|.\|.] ++.SH OVERVIEW ++.B lsprop ++program is a member of the ppc64-utils suite of utils. ++Use it to list properties ++ ++.SH DESCRIPTION ++.B lsprop ++displays properties for ++.IR FILE s ++like Open Firmware ++.I .properties ++word. ++If the ++.I FILE ++is not set, the current directory is used. ++ ++.SH OPTIONS ++.TP ++.B \-R ++Process recursively ++.TP ++.BI \-m " max-bytes" ++Read only first ++.I max-bytes ++bytes from the ++.IR FILE s ++.TP ++.BI \-w " num-words" ++Display up to ++.I num-words ++words per line +diff -up powerpc-utils-1.2.25/man/ls-vdev.8.man powerpc-utils-1.2.25/man/ls-vdev.8 +--- powerpc-utils-1.2.25/man/ls-vdev.8.man 2015-06-18 10:23:04.040591105 +0200 ++++ powerpc-utils-1.2.25/man/ls-vdev.8 2015-06-18 10:23:04.040591105 +0200 +@@ -0,0 +1,25 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. ++.TH LS-VDEV "8" "October 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++ls-vdev \- information on Virtual SCSI adapters and devices ++.SH SYNOPSIS ++.BR ls-vdev " [" \-h " | " -V ] ++ ++.SH DESCRIPTION ++Provide information on Virtual SCSI adapters and devices ++.PP ++ ++.SH OPTIONS ++.TP ++\fB\-V\fR ++Display version information and exit ++.TP ++\fB\-h\fR ++Display help information and exit ++.PP ++ ++.SH AUTHOR ++.B ls-vdev ++was written by Brian King . ++.PP ++This manual page was written by Roman Rakus . +diff -up powerpc-utils-1.2.25/man/ls-veth.8.man powerpc-utils-1.2.25/man/ls-veth.8 +--- powerpc-utils-1.2.25/man/ls-veth.8.man 2015-06-18 10:23:04.041591108 +0200 ++++ powerpc-utils-1.2.25/man/ls-veth.8 2015-06-18 10:23:04.040591105 +0200 +@@ -0,0 +1,25 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. ++.TH LS-VETH "8" "October 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++ls-veth \- information on Virtual Ethernet devices ++.SH SYNOPSIS ++.BR ls-veth " [" \-h " | " -V ] ++ ++.SH DESCRIPTION ++Provide information on Virtual Ethernet devices ++.PP ++ ++.SH OPTIONS ++.TP ++\fB\-V\fR ++Display version information and exit ++.TP ++\fB\-h\fR ++Display help information and exit ++.PP ++ ++.SH AUTHOR ++.B ls-veth ++was written by Brian King . ++.PP ++This manual page was written by Roman Rakus . +diff -up powerpc-utils-1.2.25/man/ls-vscsi.8.man powerpc-utils-1.2.25/man/ls-vscsi.8 +--- powerpc-utils-1.2.25/man/ls-vscsi.8.man 2015-06-18 10:23:04.041591108 +0200 ++++ powerpc-utils-1.2.25/man/ls-vscsi.8 2015-06-18 10:23:04.041591108 +0200 +@@ -0,0 +1,25 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. ++.TH LS-VSCSI "8" "October 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++ls-vscsi \- information on Virtual devices ++.SH SYNOPSIS ++.BR ls-vscsi " [" \-h " | " -V ] ++ ++.SH DESCRIPTION ++Provide information on Virtual devices ++.PP ++ ++.SH OPTIONS ++.TP ++\fB\-V\fR ++Display version information and exit ++.TP ++\fB\-h\fR ++Display help information and exit ++.PP ++ ++.SH AUTHOR ++.B ls-vscsi ++was written by Brian King . ++.PP ++This manual page was written by Roman Rakus . +diff -up powerpc-utils-1.2.25/man/nvsetenv.8.man powerpc-utils-1.2.25/man/nvsetenv.8 +--- powerpc-utils-1.2.25/man/nvsetenv.8.man 2015-06-18 10:23:04.041591108 +0200 ++++ powerpc-utils-1.2.25/man/nvsetenv.8 2015-06-18 10:23:04.041591108 +0200 +@@ -0,0 +1,29 @@ ++.TH NVSETENV "8" "Oct 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++nvsetenv \- wrapper to invoke nvram ++ ++.SH SYNOPSIS ++.B nvsetenv ++[ ARG1 ] [ ARG2 ] ++ ++.SH DESCRIPTION ++.B nvsetenv ++is just a wrapper to invoke nvram ++ ++.SH OPTIONS ++ ++Without any argument, nvsetenv calls ++.I nvram --print-config ++ ++With one argument ++.IR ARG1 , ++nvsetenv calls ++.I nvram --print-config=ARG1 ++ ++With two arguments ++.IR "ARG1 ARG2" , ++nvsetenv calls ++.I nvram --update-config ARG1=ARG2 ++ ++.SH "SEE ALSO" ++.IR nvram (8) +diff -up powerpc-utils-1.2.25/man/rtas_event_decode.8.man powerpc-utils-1.2.25/man/rtas_event_decode.8 +--- powerpc-utils-1.2.25/man/rtas_event_decode.8.man 2015-06-18 10:23:04.041591108 +0200 ++++ powerpc-utils-1.2.25/man/rtas_event_decode.8 2015-06-18 10:23:04.041591108 +0200 +@@ -0,0 +1,31 @@ ++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. ++.TH RTAS_EVENT_DECODE 8 "September 2010" "Linux" "Linux on Power Service Tools" ++.SH NAME ++\fBrtas_event_decode\fP - RTAS message decoder ++.SH SYNOPSIS ++.B rtas_event_decode ++[\fI-dv\fR] [\fI-n eventnum\fR] [\fI-w width\fR] ++.SH DESCRIPTION ++RTAS messages are placed in the syslog encoded in a binary ++format, and are unreadable. This tool will take exactly one ++message, parse it, and spit out the human-readable equivalent. ++This program expects ascii data on stdin. ++ ++This tool is mostly meant to be used in conjuction with the ++rtas_dump shell script, which provides a suitable user ++interface. ++ ++.SH OPTIONS ++.TP ++.B \-d ++dump the raw RTAS event ++.TP ++.BI \-n " eventnum" ++event number of the RTAS event being dumped ++.TP ++.B \-v ++verbose, print all details, not just header ++.TP ++.BI \-w " width" ++limit the output to the specified width, default width is 80 characters. The width must be > 0 and < 1024. ++ diff --git a/SOURCES/powerpc-utils-1.3.4-load_rpadlpar_io.patch b/SOURCES/powerpc-utils-1.3.4-load_rpadlpar_io.patch new file mode 100644 index 0000000..f22c454 --- /dev/null +++ b/SOURCES/powerpc-utils-1.3.4-load_rpadlpar_io.patch @@ -0,0 +1,74 @@ +commit 73d847367d1a136d8e83d48e7ca4ff4602c0f5c7 +Author: Michal Suchanek +Date: Thu Jan 18 15:38:00 2018 -0800 + + drmgr: load rpadlpar_io on -C as well + + Users do drmgr -C to verify their system. + + However, -C does not select any hotplug type, and the rpadlpar_io kernel + module is loaded only when hotplug type pci, phb or slot is selected. + + Make display_capabilities global and check it in check_kmods() + + Signed-off-by: Michal Suchanek + Signed-off-by: Tyrel Datwyler + +diff --git a/src/drmgr/common.c b/src/drmgr/common.c +index f91ad82..6e89265 100644 +--- a/src/drmgr/common.c ++++ b/src/drmgr/common.c +@@ -114,13 +114,13 @@ static int check_kmods(void) + + /* We only need to do this for PHB/SLOT/PCI operations */ + if (usr_drc_type != DRC_TYPE_PCI && usr_drc_type != DRC_TYPE_PHB && +- usr_drc_type != DRC_TYPE_SLOT) ++ usr_drc_type != DRC_TYPE_SLOT && !display_capabilities) + return 0; + + /* We don't use rpadlar_io/rpaphp for PCI operations run with the + * -v / virtio flag, which relies on generic PCI rescan instead + */ +- if (usr_drc_type == DRC_TYPE_PCI && pci_virtio) ++ if (usr_drc_type == DRC_TYPE_PCI && pci_virtio && !display_capabilities) + return 0; + + /* Before checking for dlpar capability, we need to ensure that +diff --git a/src/drmgr/dr.h b/src/drmgr/dr.h +index 93785b6..d529580 100644 +--- a/src/drmgr/dr.h ++++ b/src/drmgr/dr.h +@@ -68,6 +68,7 @@ enum drc_type {DRC_TYPE_NONE, DRC_TYPE_PCI, DRC_TYPE_SLOT, DRC_TYPE_PHB, + DRC_TYPE_HIBERNATE, DRC_TYPE_MIGRATION}; + + extern enum drmgr_action usr_action; ++extern int display_capabilities; + extern int usr_slot_identification; + extern int usr_timeout; + extern char *usr_drc_name; +diff --git a/src/drmgr/drmgr.c b/src/drmgr/drmgr.c +index 6777e7f..09e8427 100644 +--- a/src/drmgr/drmgr.c ++++ b/src/drmgr/drmgr.c +@@ -38,7 +38,6 @@ int output_level = 1; /* default to lowest output level */ + int log_fd = 0; + int action_cnt = 0; + +-static int display_capabilities = 0; + static int handle_prrn_event = 0; + static int display_usage = 0; + +diff --git a/src/drmgr/options.c b/src/drmgr/options.c +index 1ace27d..eae6c90 100644 +--- a/src/drmgr/options.c ++++ b/src/drmgr/options.c +@@ -21,6 +21,9 @@ + /* Global User Specifications */ + enum drmgr_action usr_action = NONE; + ++/* the init routines may need to know this to enable all features */ ++int display_capabilities = 0; ++ + /* default is to do slot identification, unless the drmgr -I + * option is specified. + */ diff --git a/SOURCES/powerpc-utils-1.3.4-update_flash_nv_pseries_platform_man.patch b/SOURCES/powerpc-utils-1.3.4-update_flash_nv_pseries_platform_man.patch new file mode 100644 index 0000000..36fdcf6 --- /dev/null +++ b/SOURCES/powerpc-utils-1.3.4-update_flash_nv_pseries_platform_man.patch @@ -0,0 +1,280 @@ +diff -up powerpc-utils-1.3.4/Makefile.am.than powerpc-utils-1.3.4/Makefile.am +--- powerpc-utils-1.3.4/Makefile.am.than 2017-09-15 11:28:59.482394868 +0200 ++++ powerpc-utils-1.3.4/Makefile.am 2017-09-15 11:32:25.447393942 +0200 +@@ -31,6 +31,7 @@ man_MANS = \ + man/amsstat.1 \ + man/serv_config.8 \ + man/update_flash.8 \ ++ man/update_flash_nv.8 \ + man/nvram.8 \ + man/set_poweron_time.8 \ + man/bootlist.8 \ +@@ -52,7 +53,8 @@ man_MANS = \ + man/drmgr.8 \ + man/ls-veth.8 \ + man/nvsetenv.8 \ +- man/ls-vscsi.8 ++ man/ls-vscsi.8 \ ++ man/pseries_platform.8 + + EXTRA_DIST += $(bin_SCRIPTS) $(sbin_SCRIPTS) $(man_MANS) + +diff -up powerpc-utils-1.3.4/man/pseries_platform.8.than powerpc-utils-1.3.4/man/pseries_platform.8 +--- powerpc-utils-1.3.4/man/pseries_platform.8.than 2017-09-15 11:22:21.675326705 +0200 ++++ powerpc-utils-1.3.4/man/pseries_platform.8 2017-09-15 11:24:33.705686446 +0200 +@@ -0,0 +1,15 @@ ++.\" ++.\" Copyright (C) 2011 International Business Machines ++.\" Brian King ++.\" ++.TH pseries_platform 8 "December 2011" Linux "Linux on Power Service Tools" ++.SH NAME ++pseries_platform \- display platform name ++.SH SYNOPSIS ++.BI "pseries_platform" ++.SH DESCRIPTION ++The ++.B pseries_platform ++command can be used to display platform name. ++.SH AUTHOR ++Brian King +diff -up powerpc-utils-1.3.4/man/update_flash_nv.8.than powerpc-utils-1.3.4/man/update_flash_nv.8 +--- powerpc-utils-1.3.4/man/update_flash_nv.8.than 2017-09-15 11:21:28.571583127 +0200 ++++ powerpc-utils-1.3.4/man/update_flash_nv.8 2017-09-15 11:20:55.610742291 +0200 +@@ -0,0 +1,236 @@ ++.\" ++.\" Copyright (C) 2002 - 2013 International Business Machines ++.\" Todd Inglett ++.\" Michael Strosaker ++.\" Vasant Hegde ++.\" ++.TH UPDATE_FLASH_NV 8 "8 May 2013" Linux "PowerLinux Service Tools" ++.SH NAME ++update_flash_nv \- manage system and service processor firmware ++.SH SYNOPSIS ++.nf ++\fB/usr/sbin/update_flash_nv \fR[\fB-v|-n\fR] \fB-f \fIfirmware.img ++.B /usr/sbin/update_flash_nv -h ++.B /usr/sbin/update_flash_nv -c ++.B /usr/sbin/update_flash_nv -r ++.B /usr/sbin/update_flash_nv -s ++.B /usr/sbin/update_flash_nv -d ++.fi ++.SH DESCRIPTION ++.P ++The ++.I update_flash_nv ++script is used to validate, update and manage firmware on an IBM Power ++Systems servers. ++.TP ++.nf ++.B VALIDATION ++.fi ++When used with the ++.B -v ++option, the script will ONLY perform validation of the image file. Regardless ++of the outcome of the validation, no actual flash will occur. This option is ++only useful on machines that support validation of firmware images. ++.TP ++.nf ++.B UPDATE ++.fi ++When used with only the ++.B -f ++option and an image file name, the script will attempt to update the system ++firmware with the given image. If the machine has the ability to pre-validate ++the image, this will be done automatically before the flash. If the machine ++is not capable of pre-validation, or if validation passes, this script will ++upload the firmware image into the kernel and will perform a ++.B shutdown -r now ++which will reboot the system. The flash will occur at the end of the reboot ++process. ++ ++.B WARNING: ++The system WILL be rebooted! Wait until the flash process has completed. This ++can be anywhere from 2 minutes to 20 minutes (or more) depending on the system. ++The control panel display will show that the system is flashing. Failure to ++wait may render a system inoperable. ++ ++.B NOTE: ++If machine supports two firmware image areas, update is always applied to the ++temporary image area. The ++.B -c ++option is the normal means by which a temporary image is committed to the ++permanent side (see MANAGEMENT). However, if a platform is running from a ++temporary image when an update is to be applied, then the platform may ++automatically commit the current temporary image to the permanent side to ++allow the new image to be updated to the temporary image area. The ++.B -v ++option can be used to determine what would result from an attempt to update ++a flash image. ++ ++The ++.B -n ++option will prevent the automatic overwrite of the permanent image area ++and abandon the update entirely. ++ ++To apply an update to the temporary image area without overwriting the ++permanent image area, the system must first be running with the permanent ++image. The temporary image can then be rejected (see MANAGEMENT). ++Subsequently, the update can be applied. ++.TP ++.nf ++.B MANAGEMENT ++.fi ++When used with the ++.B -c ++option, the script will commit the temporary image to the permanent side. ++In order to use this, the machine must be running on the temporary image. ++This option is only useful on machines supporting two firmware image areas. ++ ++When used with the ++.B -r ++option, the script will reject the temporary image. In order to use this, ++the machine must be running on the permanent image. To switch from the ++temporary image to the permanent image, you must reboot from the permanent ++image -- for example, using the ASMI or HMC. This option is only useful on ++machines supporting two firmware image areas. ++ ++.SH OPTIONS ++.TP ++.B \-h ++Print the usage message and exit. ++.TP ++\fB\-f \fIfilename ++Supply the filename to flash (required). ++.TP ++.B \-v ++Validate ONLY with specified image file. ++.TP ++.B \-n ++Do not overwrite permanent side image automatically. ++.TP ++.B \-c ++Commit temporary image to permanent side. ++.TP ++.B \-r ++Reject temporary image. ++.TP ++.B \-s ++Determine if partition has access to perform flash image management. ++.TP ++.B \-d ++Display current firmware version. ++ ++.SH EXAMPLES ++.P ++To determine if partition has authority to flash image: ++ ++# update_flash_nv -s ++ ++.P ++For a typical firmware update (this may commit temporary to permanent): ++ ++# update_flash_nv -f 01AL740_100_042.img ++ ++.P ++To update only if permanent side will not be overwritten: ++ ++# update_flash_nv -n -f 01AL740_100_042.img ++ ++.P ++To validate an image: ++ ++# update_flash_nv -v -f 01AL740_100_042.img ++ ++.P ++To commit temporary image to permanent (note that the system ++must be running on temporary image): ++ ++# update_flash_nv -c ++ ++.P ++To reject temporary image, and copy to permanent to temporary ++(note that the system must be running on permanent image): ++ ++# update_flash_nv -r ++ ++.SH EXIT STATUS ++.TP ++.nf ++All cases: ++ 3 - Usage error ++ 4 - Permission error ++ 6 - Unexpected problem with /proc filesystem access ++ 7 - Error loading module ++ 8 - RTAS(pSeries)/OPAL(PowerNV) call failed ++ 9 - User aborted operation ++.fi ++.TP ++.nf ++Determine if partition has authority to manage image (-s): ++ 0 - Flash image management is supported ++ 1 - Flash image management is not supported on this system ++.fi ++.TP ++.nf ++Validation (-v): ++ 0 - Validation successful ++.fi ++.TP ++.nf ++Update ([-n] -f): ++ 5 - Image file error ++10 - Auto overwrite permanent side image ++15 - Update Access Key Expired ++.fi ++.TP ++.nf ++Manage (-c|-r): ++ 0 - Temporary image commit/reject successful ++.fi ++ ++.SH FILES ++.TP ++.nf ++pSeries ++ rtas_flash kernel module ++ /proc/ppc64/rtas/firmware_flash (provided by kernel module) ++.fi ++.TP ++.nf ++PowerNV ++ /sys/firmware/opal/image ++ /sys/firmware/opal/{validate/manage/update}_flash ++.fi ++.SH NOTES ++Firmware may be downloaded from the IBM website. Instructions for ++downloading and installing the firmware image are also there, and ++information there will be more up-to-date than this page. ++ ++.P ++Various conditions can lead to a firmware update failure. If you ++receive an authentication-related error, such as: ++.P ++.nf ++update_flash: RTAS: validate() Partition does not have authority ++-or- ++update_flash: System does not have authority to perform firmware update. ++.fi ++.P ++This can reflect either 1) That the permission is not set (correctable ++through the ASM interface, System -> Firmware Update Policy, or through an ++HMC if attached. ++.P ++-or- ++.P ++2) Firmware still believes an HMC is attached. This can be corrected by ++following the steps outlined here: ++.P ++http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/p7hatl/iphblresetserverp6.htm ++ ++.P ++For older "AIX format" images, the file will have a .BIN extension. This ++zip file happens to be an AIX binary, but it can be extracted with the ++unzip command (with password from the web page): ++ ++ unzip 70286C4F.BIN ++ ++This should produce a file with a .img extension. This image file is what ++should be flashed. diff --git a/SOURCES/powerpc-utils-149c7022a56e0ffb5fe27681f574d46860323e3c.patch b/SOURCES/powerpc-utils-149c7022a56e0ffb5fe27681f574d46860323e3c.patch new file mode 100644 index 0000000..995469e --- /dev/null +++ b/SOURCES/powerpc-utils-149c7022a56e0ffb5fe27681f574d46860323e3c.patch @@ -0,0 +1,149 @@ +commit 149c7022a56e0ffb5fe27681f574d46860323e3c +Author: Anton Blanchard +Date: Sun Oct 8 21:49:17 2017 -0700 + + ppc64_cpu: Scale CPU cycles counter by amount of time it ran + + ------=_Part_8274_1145520959.1507524557284 + Content-Type: text/plain; charset="UTF-8" + + At the moment we start a CPU cycles counter, sleep one second and + read the counter value, assuming we got one second of time on the + PMU. + + There are two issues with this. If someone else is consuming all + the available PMCs, we may end up context switching the PMC and + count for half (or less) of the time. In this case we report a CPU + frequency that is half (or less) of what it should be. + + On the other hand if the sleep goes for longer than one second which + might happen on a busy box, then we count for too long and report a + CPU frequency that is too high. + + Also check that we got a reasonable number of cycles and report + an error if we did not. + + Signed-off-by: Anton Blanchard + + -- + You received this message because you are subscribed to the Google Groups "Powerpc-utils development mailing list" group. + To unsubscribe from this group and stop receiving emails from it, send an email to powerpc-utils-devel+unsubscribe@googlegroups.com. + To post to this group, send email to powerpc-utils-devel@googlegroups.com. + To view this discussion on the web visit https://groups.google.com/d/msgid/powerpc-utils-devel/6f7e063a-0e51-48fa-a1ae-07b06d3ab8ad%40googlegroups.com. + For more options, visit https://groups.google.com/d/optout. + +
At the moment we start a CPU cycles counter, sleep one second and
read the counter value, assuming we got one second of time on the
PMU.

There are two issues with this. If someone else is consuming all
the available PMCs, we may end up context switching the PMC and
count for half (or less) of the time. In this case we report a CPU
frequency that is half (or less) of what it should be.

On the other hand if the sleep goes for longer than one second which
might happen on a busy box, then we count for too long and report a
CPU frequency that is too high.

Also check that we got a reasonable number of cycles and report
an error if we did not.

Signed-off-by: Anton Blanchard <anton@samba.org>

+ +

+ + --
+ You received this message because you are subscribed to the Google Groups "Powerpc-utils development mailing list" group.
+ To unsubscribe from this group and stop receiving emails from it, send an email to powerpc-utils-devel+unsubscribe@googlegroups.com.
+ To post to this group, send email to powerpc-utils-devel@googlegroups.com.
+ To view this discussion on the web visit https://groups.google.com/d/msgid/powerpc-utils-devel/6f7e063a-0e51-48fa-a1ae-07b06d3ab8ad%40googlegroups.com.
+ For more options, visit https://groups.google.com/d/optout.
+ Signed-off-by: Tyrel Datwyler + +diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c +index 87840df..34654b4 100644 +--- a/src/ppc64_cpu.c ++++ b/src/ppc64_cpu.c +@@ -64,7 +64,7 @@ struct cpu_freq { + int offline; + int counter; + pthread_t tid; +- unsigned long long freq; ++ double freq; + }; + + #ifndef __NR_perf_event_open +@@ -860,6 +860,9 @@ static int setup_counters(struct cpu_freq *cpu_freqs) + attr.disabled = 1; + attr.size = sizeof(attr); + ++ /* Record how long the event ran for */ ++ attr.read_format |= PERF_FORMAT_TOTAL_TIME_RUNNING; ++ + for (i = 0; i < threads_in_system; i++) { + if (!cpu_online(i)) { + cpu_freqs[i].offline = 1; +@@ -907,9 +910,15 @@ static void stop_counters(struct cpu_freq *cpu_freqs) + } + } + ++struct read_format { ++ uint64_t value; ++ uint64_t time_running; ++}; ++ + static void read_counters(struct cpu_freq *cpu_freqs) + { + int i; ++ struct read_format vals; + + for (i = 0; i < threads_in_system; i++) { + size_t res; +@@ -917,9 +926,16 @@ static void read_counters(struct cpu_freq *cpu_freqs) + if (cpu_freqs[i].offline) + continue; + +- res = read(cpu_freqs[i].counter, &cpu_freqs[i].freq, +- sizeof(unsigned long long)); +- assert(res == sizeof(unsigned long long)); ++ res = read(cpu_freqs[i].counter, &vals, sizeof(vals)); ++ assert(res == sizeof(vals)); ++ ++ /* Warn if we don't get at least 0.1s of time on the CPU */ ++ if (vals.time_running < 100000000) { ++ fprintf(stderr, "Measurement interval was too small, is someone running perf?\n"); ++ exit(1); ++ } ++ ++ cpu_freqs[i].freq = 1.0 * vals.value / vals.time_running; + + close(cpu_freqs[i].counter); + } +@@ -1048,16 +1064,14 @@ static void setrlimit_open_files(void) + setrlimit(RLIMIT_NOFILE, &new_rlim); + } + +-#define freq_calc(cycles, time) (1.0 * (cycles) / (time) / 1000000000ULL) +- + static int do_cpu_frequency(int sleep_time) + { + int i, rc; +- unsigned long long min = -1ULL; ++ double min = -1ULL; + unsigned long min_cpu = -1UL; +- unsigned long long max = 0; ++ double max = 0; + unsigned long max_cpu = -1UL; +- unsigned long long sum = 0; ++ double sum = 0; + unsigned long count = 0; + struct cpu_freq *cpu_freqs; + +@@ -1098,7 +1112,7 @@ static int do_cpu_frequency(int sleep_time) + read_counters(cpu_freqs); + + for (i = 0; i < threads_in_system; i++) { +- unsigned long long frequency; ++ double frequency; + + if (cpu_freqs[i].offline) + continue; +@@ -1118,11 +1132,9 @@ static int do_cpu_frequency(int sleep_time) + } + + report_system_power_mode(); +- printf("min:\t%.3f GHz (cpu %ld)\n", freq_calc(min, sleep_time), +- min_cpu); +- printf("max:\t%.3f GHz (cpu %ld)\n", freq_calc(max, sleep_time), +- max_cpu); +- printf("avg:\t%.3f GHz\n\n", freq_calc((sum / count), sleep_time)); ++ printf("min:\t%.3f GHz (cpu %ld)\n", min, min_cpu); ++ printf("max:\t%.3f GHz (cpu %ld)\n", max, max_cpu); ++ printf("avg:\t%.3f GHz\n\n", sum / count); + + free(cpu_freqs); + return 0; diff --git a/SOURCES/powerpc-utils-1d414737.patch b/SOURCES/powerpc-utils-1d414737.patch new file mode 100644 index 0000000..96b44bc --- /dev/null +++ b/SOURCES/powerpc-utils-1d414737.patch @@ -0,0 +1,198 @@ +commit 1d4147370a148b3a2ebadcf02abd4a6c9a763e6d +Author: Sourabh Jain +Date: Sat Apr 27 10:18:32 2019 +0530 + + lparstat: add an option to print the lparstat report similar to legacy lparstat tool + + This patch adds a new command line option (-l, --legacy) to allow + users to print the report similar to legacy lprastat tool without + affecting existing report format. + + Changes done to make the current report format similar to legacy + report format are listed below: + + 1) The memory attribute will be printed in MB instead of KB. + 2) cpus attribute will be referred as psize in legacy report format + and only printed in shared lpar environment. + 3) On legacy lparstat tool the lcpu attribute is a combination of + two attributes, smt and number of online processor. Formula used + to calculate the lcpu is given below. + lcpu = smt * number of online processors + + Signed-off-by: Sourabh Jain + Reviewed-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/man/lparstat.8 b/man/lparstat.8 +index 467f570..0f4c923 100644 +--- a/man/lparstat.8 ++++ b/man/lparstat.8 +@@ -36,6 +36,11 @@ Online Memory Capacity. + .TP + cpus + Number of online physical processors in the pool. ++.RS ++This attribute is referred as ++.B psize ++in legacy mode and only available in shared LPAR environment. ++.RE + .TP + ent + Entitled processing capacity in processor units. This information is displayed only if the partition type is shared. +@@ -204,6 +209,26 @@ The variable memory capacity weight of the LPAR. + .TP + .SH + .TP ++\fB\-l, --legacy\fR ++Display the report in legacy format. ++.RS ++.RS ++Memory attribute in MB instead of KB. ++.RS ++.RE ++.B cpus ++attribute is referred as ++.B psize ++and only available for shared LPAR. ++.RS ++.RE ++.B lcpu ++attribute calculation: lcpu = smt * number of online processors. ++.RE ++.TP ++.RS ++.SH ++.TP + \fB\-h, --help\fR + Display the usage of lparstat. + .RS +diff --git a/src/lparstat.c b/src/lparstat.c +index 1abe54d..ffb2cfa 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -23,6 +23,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -35,6 +36,8 @@ + #define SE_NOT_FOUND "???" + #define SE_NOT_VALID "-" + ++static bool o_legacy = false; ++ + struct sysentry *get_sysentry(char *name) + { + struct sysentry *se = &system_data[0]; +@@ -479,7 +482,7 @@ void get_mem_total(struct sysentry *se, char *buf) + { + FILE *f; + char line[128]; +- char *mem, *nl, *first_line; ++ char *mem, *nl, *first_line, *unit; + + f = fopen("/proc/meminfo", "r"); + if (!f) { +@@ -500,10 +503,21 @@ void get_mem_total(struct sysentry *se, char *buf) + mem++; + } while (*mem == ' '); + +- nl = strchr(mem, '\n'); ++ unit = strchr(mem, ' '); ++ *unit = '\0'; ++ ++ do { ++ unit++; ++ } while (*unit == ' '); ++ ++ nl = strchr(unit, '\n'); + *nl = '\0'; + +- sprintf(buf, "%s", mem); ++ if (o_legacy) { ++ sprintf(buf, "%d %s", atoi(mem) / 1024, "MB"); ++ } else { ++ sprintf(buf, "%s %s", mem, unit); ++ } + } + + void get_smt_mode(struct sysentry *se, char *buf) +@@ -604,7 +618,8 @@ void print_default_output(int interval, int count) + char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s %5s\n"; + char *descr; + char buf[128]; +- int offset; ++ int offset, smt, active_proc; ++ char type[32]; + char value[32]; + char user[32], sys[32], wait[32], idle[32], physc[32], entc[32]; + char lbusy[32], app[32], vcsw[32], phint[32]; +@@ -612,16 +627,30 @@ void print_default_output(int interval, int count) + memset(buf, 0, 128); + get_sysdata("shared_processor_mode", &descr, value); + offset = sprintf(buf, "type=%s ", value); ++ sprintf(type, "%s", value); + get_sysdata("capped", &descr, value); + offset += sprintf(buf + offset, "mode=%s ", value); + get_sysdata("smt_state", &descr, value); + offset += sprintf(buf + offset, "smt=%s ", value); ++ if (!strcmp(value, "Off")) ++ smt = 1; ++ else ++ smt = atoi(value); + get_sysdata("partition_active_processors", &descr, value); +- offset += sprintf(buf + offset, "lcpu=%s ", value); ++ active_proc = atoi(value); ++ if (o_legacy) ++ offset += sprintf(buf + offset, "lcpu=%d ", active_proc*smt); ++ else ++ offset += sprintf(buf + offset, "lcpu=%s ", value); + get_sysdata("MemTotal", &descr, value); + offset += sprintf(buf + offset, "mem=%s ", value); + get_sysdata("active_cpus_in_pool", &descr, value); +- offset += sprintf(buf + offset, "cpus=%s ", value); ++ if (o_legacy) { ++ if (strcmp(type, "Dedicated")) ++ offset += sprintf(buf + offset, "psize=%s ", value); ++ } else { ++ offset += sprintf(buf + offset, "cpus=%s ", value); ++ } + get_sysdata("DesEntCap", &descr, value); + offset += sprintf(buf + offset, "ent=%s ", value); + +@@ -662,6 +691,7 @@ static void usage(void) + "\t-h, --help Show this message and exit.\n" + "\t-V, --version \tDisplay lparstat version information.\n" + "\t-i Lists details on the LPAR configuration.\n" ++ "\t-l, --legacy Print the report in legacy format.\n" + "interval The interval parameter specifies the amount of time between each report.\n" + "count The count parameter specifies how many reports will be displayed.\n"); + } +@@ -669,6 +699,7 @@ static void usage(void) + static struct option long_opts[] = { + {"version", no_argument, NULL, 'V'}, + {"help", no_argument, NULL, 'h'}, ++ {"legacy", no_argument, NULL, 'l'}, + {0, 0, 0, 0}, + }; + +@@ -684,12 +715,15 @@ int main(int argc, char *argv[]) + exit(1); + } + +- while ((c = getopt_long(argc, argv, "iVh", ++ while ((c = getopt_long(argc, argv, "iVhl", + long_opts, &opt_index)) != -1) { + switch(c) { + case 'i': + i_option = 1; + break; ++ case 'l': ++ o_legacy = true; ++ break; + case 'V': + printf("lparstat - %s\n", VERSION); + return 0; diff --git a/SOURCES/powerpc-utils-35d01313b5d03069bf8cabbcdfe39944da4ae65c.patch b/SOURCES/powerpc-utils-35d01313b5d03069bf8cabbcdfe39944da4ae65c.patch new file mode 100644 index 0000000..6e7331f --- /dev/null +++ b/SOURCES/powerpc-utils-35d01313b5d03069bf8cabbcdfe39944da4ae65c.patch @@ -0,0 +1,41 @@ +commit 35d01313b5d03069bf8cabbcdfe39944da4ae65c +Author: Tyrel Datwyler +Date: Thu Jun 14 16:08:50 2018 -0700 + + lsslot: add DRC Type description strings for new U.2 PCIe slots + + Two new PCI slot types can be reported from firmware in the DRC Type + property for a PCI device. The following are the slot descriptions for + DRC types 43 and 44. + + 43 A U.2 PCI Express Rev 3 4x lane slot with 4x lanes connected + 44 A U.2 PCI Express Rev 4 4x lane slot with 4x lanes connected + + Currently, the lsslot utility reports "Unknown" for the description of + these pci devices. Update the php_slot_type_msg[] with these new slot + descriptions so that lsslot correctly reports them. + + Signed-off-by: Tyrel Datwyler + +diff --git a/src/drmgr/common.c b/src/drmgr/common.c +index 6e89265..30c641f 100644 +--- a/src/drmgr/common.c ++++ b/src/drmgr/common.c +@@ -974,6 +974,8 @@ char *php_slot_type_msg[]={ + "PCI-E capable, Rev 4, 16x lanes with 1 lane connected", /* 40 */ + "PCI-E capable, Rev 4, 16x lanes with 8x lanes connected", + "PCI-E capable, Rev 4, 16x lanes with 16x lanes connected", ++ "U.2 PCI-E capable, Rev 3, 4x lanes with 4x lanes connected", ++ "U.2 PCI-E capable, Rev 4, 4x lanes with 4x lanes connected", + }; + + char * +@@ -984,7 +986,7 @@ node_type(struct dr_node *node) + + desc_msg_num = atoi(node->drc_type); + if ((desc_msg_num >= 1 && desc_msg_num <= 8) || +- (desc_msg_num >= 11 && desc_msg_num <= 42)) ++ (desc_msg_num >= 11 && desc_msg_num <= 44)) + desc = php_slot_type_msg[desc_msg_num]; + else { + switch (node->dev_type) { diff --git a/SOURCES/powerpc-utils-7790c5ae.patch b/SOURCES/powerpc-utils-7790c5ae.patch new file mode 100644 index 0000000..10f8da4 --- /dev/null +++ b/SOURCES/powerpc-utils-7790c5ae.patch @@ -0,0 +1,97 @@ +commit 7790c5ae7ff50785c26e7d3942e0b86c9edb9df2 +Author: Vasant Hegde +Date: Sun Jan 21 21:10:08 2018 +0530 + + update_flash: Use device tree to get firmware version details + + On P9, OPAL exports firmware information via device tree + (/ibm,firmware-versions node). Even recent hostboot firmware on P8 BMC system + exports these information via mini device tree. + + Lets add support to parse device tree to get firmware information. If firmware + information is not present in device tree then fall back to existing ipmi + method. + + Signed-off-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/update_flash_nv b/scripts/update_flash_nv +index 0ef765c..bb9dfee 100755 +--- a/scripts/update_flash_nv ++++ b/scripts/update_flash_nv +@@ -58,6 +58,9 @@ DT_PATH=/proc/device-tree + DT_FW_MI_FILE=${DT_PATH}/ibm,opal/firmware/mi-version + DT_FW_ML_FILE=${DT_PATH}/ibm,opal/firmware/ml-version + ++# Firmware versions device tree node ++DT_PATH_FW_NODE=${DT_PATH}/ibm,firmware-versions ++ + # Code update status values + FLASH_SUCCESS=0 # Success + FLASH_PARAM_ERR=-1 # Parameter error +@@ -587,7 +590,49 @@ opp_manage_flash() { + exit $E_SUCCESS + } + +-opp_display_current_fw_version() { ++# Use device tree to get firmware version ++opp_display_dt_firmware_version() { ++ local prop_prod="" ++ ++ echo ++ echo "Firmware version:" ++ ++ # Different BMCs uses different device tree property to display ++ # product name. On P9 system OPAL firmware takes care of parsing ++ # and it will add version property under device tree. But on older ++ # systems will have IBM or open-power or buildroot depending on ++ # who builds firmware image. ++ if [ -f $DT_PATH_FW_NODE/version ]; then ++ prop_prod=version ++ elif [ -f $DT_PATH_FW_NODE/IBM ]; then ++ prop_prod=IBM ++ elif [ -f $DT_PATH_FW_NODE/open-power ]; then ++ prop_prod=open-power ++ elif [ -f $DT_PATH_FW_NODE/buildroot ]; then ++ prop_prod=buildroot ++ fi ++ ++ if [ "$prop_prod" != "" ]; then ++ echo " Product Version : $(tr -d '\0' < $DT_PATH_FW_NODE/$prop_prod)" ++ fi ++ ++ for i in `ls $DT_PATH_FW_NODE` ++ do ++ if [ "$i" = "$prop_prod" ]; then ++ continue ++ fi ++ if [ "$i" = "name" ]; then ++ continue ++ fi ++ if [ "$i" = "phandle" ] || [ "$i" = "linux,phandle" ]; then ++ continue ++ fi ++ echo " Product Extra : $i-$(tr -d '\0' < $DT_PATH_FW_NODE/$i)" ++ done ++} ++ ++# Use inband ipmi interface to get firmware version ++opp_display_ipmi_fw_version() { + which ipmitool >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "update_flash: ipmitool command not found." +@@ -609,6 +654,14 @@ opp_display_current_fw_version() { + + echo "Firmware version:" + ipmitool fru print $id ++} ++ ++opp_display_current_fw_version() { ++ if [ -d $DT_PATH_FW_NODE ]; then ++ opp_display_dt_firmware_version ++ else ++ opp_display_ipmi_fw_version ++ fi + + exit $E_SUCCESS + } diff --git a/SOURCES/powerpc-utils-7be598c7.patch b/SOURCES/powerpc-utils-7be598c7.patch new file mode 100644 index 0000000..00ce675 --- /dev/null +++ b/SOURCES/powerpc-utils-7be598c7.patch @@ -0,0 +1,55 @@ +commit 7be598c7ffdf1f934e43af88a42e8b1e6391f91e +Author: Aravinda Prasad +Date: Thu Dec 6 16:21:10 2018 +0530 + + lparstat: Enable desired and maximum memory stats + + This patch enables the display of desired memory + and maximum memory stats with lparstat -i flag. + The value for these stats are already available + in /proc/powerpc/lparcfg file. + + v2: updated man pages. + + Signed-off-by: Aravinda Prasad + Reviewed-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/man/lparstat.8 b/man/lparstat.8 +index 4872a37..9721580 100644 +--- a/man/lparstat.8 ++++ b/man/lparstat.8 +@@ -136,6 +136,12 @@ Amount of memory currently online. + Minimum Memory + Minimum memory this LPAR was defined to ever have. + .TP ++Desired Memory ++ Indicates the desired amount of memory. ++.TP ++Maximum Memory ++ Maximum possible amount of memory. ++.TP + Variable Capacity Weight + The priority weight assigned to this LPAR which controls how extra (idle) capacity is allocated to it. A weight of -1 indicates a soft cap is in place. + .TP +diff --git a/src/lparstat.h b/src/lparstat.h +index 20bb939..c447692 100644 +--- a/src/lparstat.h ++++ b/src/lparstat.h +@@ -142,6 +142,8 @@ struct sysentry system_data[] = { + .descr = "Minimum Memory"}, + {.name = "DesMem", + .descr = "Desired Memory"}, ++ {.name = "MaxMem", ++ .descr = "Maximum Memory"}, + {.name = "entitled_memory", + .descr = "Total I/O Memory Entitlement"}, + {.name = "mapped_entitled_memory", +@@ -261,6 +263,7 @@ char *iflag_entries[] = { + "MinProcs", + "MemTotal", + "MinMem", ++ "DesMem", + "MaxMem", + "MinEntCap", + "partition_max_entitled_capacity", diff --git a/SOURCES/powerpc-utils-7fb22cb5.patch b/SOURCES/powerpc-utils-7fb22cb5.patch new file mode 100644 index 0000000..48cc5ef --- /dev/null +++ b/SOURCES/powerpc-utils-7fb22cb5.patch @@ -0,0 +1,66 @@ +commit 7fb22cb5b8a0c95821024aa84750945134303f20 +Author: John Allen +Date: Wed Dec 6 10:33:59 2017 -0600 + + lparstat: Fix parsing of /proc/interrupts SPU line + + The current means of parsing the SPU line in /proc/interrupts is incorrect. + Adding 11 to the current pointer is only correct if the number of SPU + interrupts in each column is a single digit. Otherwise, for values with + more than a single digit, we will only see the last digit of the value. + This patch fixes the issue by using strstr to check for the SPU line and + strtok to split the line into tokens in order to omit the arbitrary + whitespace between values. + + Signed-off-by: John Allen + Reported-by: Flos Lonicerae + Reviewed-by: Nathan Fontenot + Signed-off-by: Tyrel Datwyler + +diff --git a/src/lparstat.c b/src/lparstat.c +index 3124077..6c54c7e 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -203,11 +203,12 @@ int parse_lparcfg() + int parse_proc_ints() + { + FILE *f; +- char *line, *p; ++ char *line; + size_t n = 0; + char *value; + struct sysentry *se; + long long int phint = 0; ++ const char *delim = " "; + + f = fopen("/proc/interrupts", "r"); + if (!f) { +@@ -216,20 +217,22 @@ int parse_proc_ints() + } + + while (getline(&line, &n, f) != -1) { +- p = line; +- while (*p == ' ') +- p++; +- + /* we just need the SPU line */ +- if (p[0] != 'S' || p[1] != 'P' || p[2] != 'U') ++ if (!strstr(line, "SPU:")) + continue; + +- for (value = &p[5]; value[2] != 'S'; value += 11) { ++ /* target line. omit the 'SPU:' */ ++ value = strtok(line, delim); ++ if (!value) ++ break; ++ ++ while ((value = strtok(NULL, delim)) && value[0] != 'S') { + int v; + v = atoi(value); + phint += v; + } + ++ /* skim the rest of the lines */ + break; + } + diff --git a/SOURCES/powerpc-utils-8b7978b1.patch b/SOURCES/powerpc-utils-8b7978b1.patch new file mode 100644 index 0000000..18fefea --- /dev/null +++ b/SOURCES/powerpc-utils-8b7978b1.patch @@ -0,0 +1,94 @@ +commit 8b7978b114e5df89218daa9b4b48cc0e918ba917 +Author: Sourabh Jain +Date: Mon Feb 4 16:15:14 2019 +0530 + + lparstat: introduce the help command line option to print lparstat usage + + This patch adds a function to print the usage of lparstat. Also, + a new element is added to structure option to handle long command + line argument for help. + + Signed-off-by: Sourabh Jain + Signed-off-by: Tyrel Datwyler + +diff --git a/man/lparstat.8 b/man/lparstat.8 +index 9721580..467f570 100644 +--- a/man/lparstat.8 ++++ b/man/lparstat.8 +@@ -9,8 +9,9 @@ + .SH NAME + lparstat \- Reports logical partition ( LPAR ) related information and statistics. + .SH SYNOPSIS +-.B /usr/sbin/lparstat +-[ -i ] [ interval [ count ] ] ++.B /usr/sbin/lparstat [ options ] ++.HP ++.B /usr/sbin/lparstat [ count ] + .SH DESCRIPTION + The \fIlparstat\fR command provides a report of LPAR related information and utilization statistics. This command provides a display of current LPAR related parameters and Hypervisor information, as well as utilization statistics for the LPAR. + +@@ -202,6 +203,17 @@ Desired Variable Capacity Weight + The variable memory capacity weight of the LPAR. + .TP + .SH ++.TP ++\fB\-h, --help\fR ++Display the usage of lparstat. ++.RS ++.SH ++.TP ++\fB\-V, --version\fR ++Display the lparstat version information. ++.RS ++.SH ++.TP + interval + The + .B interval +diff --git a/src/lparstat.c b/src/lparstat.c +index c9b86fd..1abe54d 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -655,8 +655,20 @@ void print_default_output(int interval, int count) + } while (--count > 0); + } + ++static void usage(void) ++{ ++ printf("Usage: lparstat [ options ]\n\tlparstat [ count ]\n\n" ++ "options:\n" ++ "\t-h, --help Show this message and exit.\n" ++ "\t-V, --version \tDisplay lparstat version information.\n" ++ "\t-i Lists details on the LPAR configuration.\n" ++ "interval The interval parameter specifies the amount of time between each report.\n" ++ "count The count parameter specifies how many reports will be displayed.\n"); ++} ++ + static struct option long_opts[] = { + {"version", no_argument, NULL, 'V'}, ++ {"help", no_argument, NULL, 'h'}, + {0, 0, 0, 0}, + }; + +@@ -672,7 +684,7 @@ int main(int argc, char *argv[]) + exit(1); + } + +- while ((c = getopt_long(argc, argv, "iV", ++ while ((c = getopt_long(argc, argv, "iVh", + long_opts, &opt_index)) != -1) { + switch(c) { + case 'i': +@@ -681,7 +693,12 @@ int main(int argc, char *argv[]) + case 'V': + printf("lparstat - %s\n", VERSION); + return 0; ++ case 'h': ++ usage(); ++ return 0; + case '?': ++ usage(); ++ return 1; + default: + break; + } diff --git a/SOURCES/powerpc-utils-autoconf.patch b/SOURCES/powerpc-utils-autoconf.patch new file mode 100644 index 0000000..c2cfe63 --- /dev/null +++ b/SOURCES/powerpc-utils-autoconf.patch @@ -0,0 +1,142 @@ +2009-10-29 Stepan Kasal + +Make build with autoconf 2.59. + +diff -urN powerpc-utils-1.2.2.orig/configure.ac powerpc-utils-1.2.2/configure.ac +--- powerpc-utils-1.2.2.orig/configure.ac 2009-10-22 21:00:13.000000000 +0200 ++++ powerpc-utils-1.2.2/configure.ac 2009-10-29 15:41:58.000000000 +0100 +@@ -1,8 +1,9 @@ + # -*- Autoconf -*- + # Process this file with autoconf to produce a configure script. + +-AC_PREREQ([2.63]) +-AC_INIT([powerpc-utils], [1.2.0], [nfont@austin.ibm.com]) ++AC_PREREQ([2.59]) ++m4_include([ac_type_uint.m4]) ++AC_INIT([powerpc-utils], [1.2.2], [nfont@austin.ibm.com]) + AM_INIT_AUTOMAKE + AC_CONFIG_SRCDIR([src/rtas_ibm_get_vpd.c]) + +diff -urN powerpc-utils-1.2.2.orig/ac_type_uint.m4 powerpc-utils-1.2.2/ac_type_uint.m4 +--- powerpc-utils-1.2.2.orig/ac_type_uint.m4 1970-01-01 01:00:00.000000000 +0100 ++++ powerpc-utils-1.2.2/ac_type_uint.m4 2009-10-29 16:04:41.000000000 +0100 +@@ -0,0 +1,119 @@ ++AC_DEFUN([AC_TYPE_INT8_T], [_AC_TYPE_INT(8)]) ++AC_DEFUN([AC_TYPE_INT16_T], [_AC_TYPE_INT(16)]) ++AC_DEFUN([AC_TYPE_INT32_T], [_AC_TYPE_INT(32)]) ++AC_DEFUN([AC_TYPE_INT64_T], [_AC_TYPE_INT(64)]) ++AC_DEFUN([AC_TYPE_UINT8_T], [_AC_TYPE_UNSIGNED_INT(8)]) ++AC_DEFUN([AC_TYPE_UINT16_T], [_AC_TYPE_UNSIGNED_INT(16)]) ++AC_DEFUN([AC_TYPE_UINT32_T], [_AC_TYPE_UNSIGNED_INT(32)]) ++AC_DEFUN([AC_TYPE_UINT64_T], [_AC_TYPE_UNSIGNED_INT(64)]) ++ ++# _AC_TYPE_INT(NBITS) ++# ------------------- ++AC_DEFUN([_AC_TYPE_INT], ++[ ++ AC_CACHE_CHECK([for int$1_t], [ac_cv_c_int$1_t], ++ [ac_cv_c_int$1_t=no ++ for ac_type in 'int$1_t' 'int' 'long int' \ ++ 'long long int' 'short int' 'signed char'; do ++ AC_COMPILE_IFELSE( ++ [AC_LANG_BOOL_COMPILE_TRY( ++ [AC_INCLUDES_DEFAULT], ++ [[0 < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1)]])], ++ [AC_COMPILE_IFELSE( ++ [AC_LANG_BOOL_COMPILE_TRY( ++ [AC_INCLUDES_DEFAULT], ++ [[($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1) ++ < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 2)]])], ++ [], ++ [AS_CASE([$ac_type], [int$1_t], ++ [ac_cv_c_int$1_t=yes], ++ [ac_cv_c_int$1_t=$ac_type])])]) ++ test "$ac_cv_c_int$1_t" != no && break ++ done]) ++ case $ac_cv_c_int$1_t in #( ++ no|yes) ;; #( ++ *) ++ AC_DEFINE_UNQUOTED([int$1_t], [$ac_cv_c_int$1_t], ++ [Define to the type of a signed integer type of width exactly $1 bits ++ if such a type exists and the standard includes do not define it.]);; ++ esac ++])# _AC_TYPE_INT ++ ++# _AC_TYPE_UNSIGNED_INT(NBITS) ++# ---------------------------- ++AC_DEFUN([_AC_TYPE_UNSIGNED_INT], ++[ ++ AC_CACHE_CHECK([for uint$1_t], [ac_cv_c_uint$1_t], ++ [ac_cv_c_uint$1_t=no ++ for ac_type in 'uint$1_t' 'unsigned int' 'unsigned long int' \ ++ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do ++ AC_COMPILE_IFELSE( ++ [AC_LANG_BOOL_COMPILE_TRY( ++ [AC_INCLUDES_DEFAULT], ++ [[($ac_type) -1 >> ($1 - 1) == 1]])], ++ [AS_CASE([$ac_type], [uint$1_t], ++ [ac_cv_c_uint$1_t=yes], ++ [ac_cv_c_uint$1_t=$ac_type])]) ++ test "$ac_cv_c_uint$1_t" != no && break ++ done]) ++ case $ac_cv_c_uint$1_t in #( ++ no|yes) ;; #( ++ *) ++ m4_bmatch([$1], [^\(8\|32\|64\)$], ++ [AC_DEFINE([_UINT$1_T], 1, ++ [Define for Solaris 2.5.1 so the uint$1_t typedef from ++ , , or is not used. ++ If the typedef were allowed, the #define below would cause a ++ syntax error.])]) ++ AC_DEFINE_UNQUOTED([uint$1_t], [$ac_cv_c_uint$1_t], ++ [Define to the type of an unsigned integer type of width exactly $1 bits ++ if such a type exists and the standard includes do not define it.]);; ++ esac ++])# _AC_TYPE_UNSIGNED_INT ++ ++ ++# AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT]) ++# ---------------------------------------------------- ++# Expand into ++# | case WORD in ++# | PATTERN1) IF-MATCHED1 ;; ++# | ... ++# | *) DEFAULT ;; ++# | esac ++m4_define([_AS_CASE], ++[ $1[)] m4_default([$2], [:]) ;; ++]) ++m4_define([_AS_CASE_DEFAULT], ++[ *[)] $1 ;; ++]) ++m4_defun([AS_CASE], ++[m4_ifval([$2$3], ++[case $1 in ++m4_transform_pair([_$0], [_$0_DEFAULT], m4_shift($@))dnl ++esac ++])dnl ++])# AS_CASE ++ ++ ++# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...) ++# -------------------------------------------------------------- ++# Perform a pairwise grouping of consecutive ARGs, by expanding ++# EXPRESSION([ARG1], [ARG2]). If there are an odd number of ARGs, the ++# final argument is expanded with END-EXPR([ARGn]). ++# ++# For example: ++# m4_define([show], [($*)m4_newline])dnl ++# m4_transform_pair([show], [], [a], [b], [c], [d], [e])dnl ++# => (a,b) ++# => (c,d) ++# => (e) ++# ++# Please keep foreach.m4 in sync with any adjustments made here. ++m4_define([m4_transform_pair], ++[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])], ++ [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])], ++ [$#], [2], [], ++ [$#], [3], [m4_default([$2], [$1])([$3])[]], ++ [$#], [4], [$1([$3], [$4])[]], ++ [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])]) ++ diff --git a/SOURCES/powerpc-utils-b5fea40a.patch b/SOURCES/powerpc-utils-b5fea40a.patch new file mode 100644 index 0000000..3214bb4 --- /dev/null +++ b/SOURCES/powerpc-utils-b5fea40a.patch @@ -0,0 +1,31 @@ +commit b5fea40ac98d1c9a685d98c011e88180c31ca0be +Author: Vasant Hegde +Date: Wed Feb 20 15:44:17 2019 +0530 + + man/update_flash: Add details to extract rpm format image + + Signed-off-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/man/update_flash.8 b/man/update_flash.8 +index 254fbac..4ae10d8 100644 +--- a/man/update_flash.8 ++++ b/man/update_flash.8 +@@ -225,6 +225,17 @@ following the steps outlined here: + .P + http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/p7hatl/iphblresetserverp6.htm + ++.P ++.B RPM format image ++.fi ++For "rpm format" images, the file will have a .rpm extension. It can be extracted ++using below command: ++ ++ rpm2cpio | cpio -idmv ++.fi ++.P ++This will extract files under current directory. Pass .img file to this script. ++ + .P + .B AIX format image + .fi diff --git a/SOURCES/powerpc-utils-bc928b06.patch b/SOURCES/powerpc-utils-bc928b06.patch new file mode 100644 index 0000000..d17f099 --- /dev/null +++ b/SOURCES/powerpc-utils-bc928b06.patch @@ -0,0 +1,40 @@ +commit bc928b06605371b72c7fe8ec7e81886114a9e9d4 +Author: Sourabh Jain +Date: Thu Jan 31 14:25:21 2019 +0530 + + lparstat: restrict the physc and entc attribute values to two decimal places + + Print format of physical processors consumed (physc) and percentage of + the entitled capacity consumed (entc) attributes has changed from six + decimal places to two. + + The least possible value allowed for processor entitlement to a LPAR + is 0.05 so printing physc and entc values with such a high precision + is incorrect. + + Signed-off-by: Sourabh Jain + Reviewed-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/src/lparstat.c b/src/lparstat.c +index ec57c1a..c9b86fd 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -176,7 +176,7 @@ void get_cpu_physc(struct sysentry *unused_se, char *buf) + physc = (new_purr - old_purr)/timebase/elapsed; + } + +- sprintf(buf, "%.6f", physc); ++ sprintf(buf, "%.2f", physc); + } + + void get_per_entc(struct sysentry *unused_se, char *buf) +@@ -188,7 +188,7 @@ void get_per_entc(struct sysentry *unused_se, char *buf) + get_sysdata("DesEntCap", &descr, entc); + get_sysdata("physc", &descr, physc); + +- sprintf(buf, "%.6f", atof(physc) / atof(entc) * 100.0); ++ sprintf(buf, "%.2f", atof(physc) / atof(entc) * 100.0); + } + + void get_cpu_app(struct sysentry *unused_se, char *buf) diff --git a/SOURCES/powerpc-utils-c3f583a9f62ee33080523c2d1d076fdf8d5520e7 b/SOURCES/powerpc-utils-c3f583a9f62ee33080523c2d1d076fdf8d5520e7 new file mode 100644 index 0000000..68012ac --- /dev/null +++ b/SOURCES/powerpc-utils-c3f583a9f62ee33080523c2d1d076fdf8d5520e7 @@ -0,0 +1,63 @@ +commit c3f583a9f62ee33080523c2d1d076fdf8d5520e7 +Author: Mamatha Inamdar +Date: Tue Jul 17 21:24:31 2018 +0530 + + Patch to display logical name using bootlist -o option + + Problem: + System unable to boot when OF device path name's set using -r option + EX: # bootlist -m normal -r /vdevice/v-scsi@30000010/disk@8100000000000000 + + Solution: + This patch is to set respective Open firmware device path names(-r) + and logical device path names(-o) using bootlist + + Test Results: + + Without patch: + + # bootlist -m normal -r /vdevice/v-scsi@30000010/disk@8100000000000000 + sda + + # bootlist -m normal -r + sda + + # bootlist -m normal -o + Could not translate sda to logical device name + + With patch: + + # ./bootlist -m normal -r /vdevice/v-scsi@30000010/disk@8100000000000000 + /vdevice/v-scsi@30000010/disk@8100000000000000 + + # ./bootlist -m normal -r + /vdevice/v-scsi@30000010/disk@8100000000000000 + + # ./bootlist -m normal -o + sda + + # ./bootlist -m normal -r sda + /vdevice/v-scsi@30000010/disk@8100000000000000 + + # ./bootlist -m normal -r + /vdevice/v-scsi@30000010/disk@8100000000000000 + + # ./bootlist -m normal -o + sda + + Signed-off-by: Mamatha Inamdar + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/bootlist b/scripts/bootlist +index 187b08c..65926d7 100755 +--- a/scripts/bootlist ++++ b/scripts/bootlist +@@ -453,6 +453,8 @@ if [[ ${#LOGICAL_NAMES[*]} -ne 0 ]]; then + if [[ -z ${OF_DEVPATH[$ctr]} ]]; then + # See if this is an OF pathname + OF_DEVPATH[$ctr]=`get_of_device_name ${LOGICAL_NAMES[$ctr]}` ++ else ++ OF_DEVPATH[$ctr]=${LOGICAL_NAMES[$ctr]} + fi + + if [[ -z ${OF_DEVPATH[$ctr]} ]]; then diff --git a/SOURCES/powerpc-utils-d1576f88.patch b/SOURCES/powerpc-utils-d1576f88.patch new file mode 100644 index 0000000..530887d --- /dev/null +++ b/SOURCES/powerpc-utils-d1576f88.patch @@ -0,0 +1,190 @@ +commit d1576f88dcc7008bcd3448172caff1b928be1254 +Author: Aravinda Prasad +Date: Thu Sep 6 15:01:04 2018 +0530 + + lparstat: Show available physical processors in the shared pool + + This patch adds the "app" field that displays the available + processors in the shared pool. + + The platform provides the summation of the physical processor + pool idle cycles through H_PIC hypercall. This data is updated + in the "pool_idle_time" field of the /proc/ppc64/lparcfg file. + This patch derives the "app" from the "pool_idle_time" field. + + v2: Handle fgets() errors + + Signed-off-by: Aravinda Prasad + Signed-off-by: Tyrel Datwyler + +diff --git a/man/lparstat.8 b/man/lparstat.8 +index 6d94486..4872a37 100644 +--- a/man/lparstat.8 ++++ b/man/lparstat.8 +@@ -77,6 +77,9 @@ Shows the percentage of the entitled capacity consumed. Because the time base ov + lbusy + Shows the percentage of logical processor(s) utilization that occurred while executing at the user and system level. + .TP ++app ++Shows the available physical processors in the shared pool. ++.TP + phint + Shows the number of phantom (targeted to another shared partition in this pool) interruptions received. + .SH OPTIONS +diff --git a/src/lparstat.c b/src/lparstat.c +index 6c54c7e..23e45f7 100644 +--- a/src/lparstat.c ++++ b/src/lparstat.c +@@ -123,6 +123,32 @@ int get_time_base() + return 0; + } + ++void get_sys_uptime(struct sysentry *unused_se, char *uptime) ++{ ++ FILE *f; ++ char buf[80]; ++ ++ f = fopen("/proc/uptime", "r"); ++ if (!f) { ++ fprintf(stderr, "Could not open /proc/uptime\n"); ++ sprintf(uptime, SE_NOT_VALID); ++ return; ++ } ++ ++ if ((fgets(buf, 80, f)) != NULL) { ++ char *value; ++ ++ value = strchr(buf, ' '); ++ *value = '\0'; ++ sprintf(uptime, "%s", buf); ++ } else { ++ sprintf(uptime, SE_NOT_VALID); ++ } ++ ++ fclose(f); ++} ++ ++ + void get_cpu_physc(struct sysentry *unused_se, char *buf) + { + struct sysentry *se; +@@ -155,6 +181,44 @@ void get_per_entc(struct sysentry *unused_se, char *buf) + sprintf(buf, "%.6f", atof(physc) / atof(entc) * 100.0); + } + ++void get_cpu_app(struct sysentry *unused_se, char *buf) ++{ ++ struct sysentry *se; ++ float timebase, app, elapsed_time; ++ long long new_app, old_app, newtime, oldtime; ++ char *descr, uptime[32]; ++ ++ se = get_sysentry("time"); ++ if (se->old_value[0] == '\0') { ++ /* Single report since boot */ ++ get_sysdata("uptime", &descr, uptime); ++ ++ if (!strcmp(uptime, SE_NOT_VALID)) { ++ sprintf(buf, "-"); ++ return; ++ } ++ elapsed_time = atof(uptime); ++ } else { ++ newtime = strtoll(se->value, NULL, 0); ++ oldtime = strtoll(se->old_value, NULL, 0); ++ elapsed_time = (newtime - oldtime) / 1000000.0; ++ } ++ ++ se = get_sysentry("timebase"); ++ timebase = atof(se->value); ++ ++ se = get_sysentry("pool_idle_time"); ++ new_app = strtoll(se->value, NULL, 0); ++ if (se->old_value[0] == '\0') { ++ old_app = 0; ++ } else { ++ old_app = strtoll(se->old_value, NULL, 0); ++ } ++ ++ app = (new_app - old_app)/timebase/elapsed_time; ++ sprintf(buf, "%.2f", app); ++} ++ + int parse_lparcfg() + { + FILE *f; +@@ -527,13 +591,13 @@ int print_iflag_data() + + void print_default_output(int interval, int count) + { +- char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s\n"; ++ char *fmt = "%5s %5s %5s %8s %8s %5s %5s %5s %5s %5s\n"; + char *descr; + char buf[128]; + int offset; + char value[32]; + char user[32], sys[32], wait[32], idle[32], physc[32], entc[32]; +- char lbusy[32], vcsw[32], phint[32]; ++ char lbusy[32], app[32], vcsw[32], phint[32]; + + memset(buf, 0, 128); + get_sysdata("shared_processor_mode", &descr, value); +@@ -554,9 +618,9 @@ void print_default_output(int interval, int count) + fprintf(stdout, "\nSystem Configuration\n%s\n\n", buf); + + fprintf(stdout, fmt, "\%user", "\%sys", "\%wait", "\%idle", "physc", +- "\%entc", "lbusy", "vcsw", "phint"); ++ "\%entc", "lbusy", "app", "vcsw", "phint"); + fprintf(stdout, fmt, "-----", "-----", "-----", "-----", "-----", +- "-----", "-----", "-----", "-----"); ++ "-----", "-----", "-----", "-----", "-----"); + + do { + if (interval) { +@@ -573,9 +637,10 @@ void print_default_output(int interval, int count) + get_sysdata("physc", &descr, physc); + get_sysdata("per_entc", &descr, entc); + get_sysdata("phint", &descr, phint); ++ get_sysdata("app", &descr, app); + + fprintf(stdout, fmt, user, sys, wait, idle, physc, entc, +- lbusy, vcsw, phint); ++ lbusy, app, vcsw, phint); + fflush(stdout); + } while (--count > 0); + } +diff --git a/src/lparstat.h b/src/lparstat.h +index 5412edc..20bb939 100644 +--- a/src/lparstat.h ++++ b/src/lparstat.h +@@ -46,6 +46,8 @@ extern void get_smt_mode(struct sysentry *, char *); + extern void get_cpu_stat(struct sysentry *, char *); + extern void get_cpu_physc(struct sysentry *, char *); + extern void get_per_entc(struct sysentry *, char *); ++extern void get_cpu_app(struct sysentry *, char *); ++extern void get_sys_uptime(struct sysentry *, char *); + + struct sysentry system_data[] = { + /* System Names */ +@@ -221,6 +223,9 @@ struct sysentry system_data[] = { + {.name = "per_entc", + .descr = "Entitled CPU Consumed", + .get = &get_per_entc}, ++ {.name = "app", ++ .descr = "Available physical CPUs in pool", ++ .get = &get_cpu_app}, + + /* Time */ + {.name = "time", +@@ -234,6 +239,11 @@ struct sysentry system_data[] = { + {.name = "phint", + .descr = "Phantom Interrupts"}, + ++ /* /proc/uptime */ ++ {.name = "uptime", ++ .descr = "System Uptime", ++ .get = &get_sys_uptime}, ++ + {.name[0] = '\0'}, + }; + diff --git a/SOURCES/powerpc-utils-dd6da6b329bac2743d1c80b5556b494c923c11ad.patch b/SOURCES/powerpc-utils-dd6da6b329bac2743d1c80b5556b494c923c11ad.patch new file mode 100644 index 0000000..c8c533a --- /dev/null +++ b/SOURCES/powerpc-utils-dd6da6b329bac2743d1c80b5556b494c923c11ad.patch @@ -0,0 +1,195 @@ +commit dd6da6b329bac2743d1c80b5556b494c923c11ad +Author: Michael Bringmann +Date: Mon Apr 29 11:25:18 2019 -0500 + + scripts: Improve handling of errors from subsidiary scripts + + This patch is to fix the handling of errors by 'lsdevinfo' from + invocations of 'ofpathname' that also encounter errors. Error + messages from 'ofpathname' were being sent through 'stdout', and + interpreted as valid data by a number of script instructions in + 'lsdevinfo'. Following is an example of such a failure when the + error results were forwarded to an associated HMC. + + 2019-02-19 22:05:38.212 [TID-5f68--72195] VIOS_CACHE: CacheVios.<-> saveCacheData 3*9080-M9S*130A068 cmd=lsdevinfo -c -q physloc=U78CD.001.FZH0128-P1-C1-T3-S4 -F status + 2019-02-19 22:05:38.212 [TID-5f68--72195] RMC_VIOS: PIRmcViosClient.stdErr=/bin/ls: cannot access /sys/class/net/ofpathname:: No such file or directory + /bin/ls: cannot access Could: No such file or directory + /bin/ls: cannot access not: No such file or directory + /bin/ls: cannot access retrieve: No such file or directory + /bin/ls: cannot access logical: No such file or directory + /bin/ls: cannot access device: No such file or directory + /bin/ls: cannot access name: No such file or directory + /bin/ls: cannot access for: No such file or directory + /bin/ls: cannot access Open: No such file or directory + /bin/ls: cannot access Firmware: No such file or directory + /bin/ls: cannot access path: No such file or directory + /bin/ls: cannot access "/pci@800000029008004/ethernet@0"./device/driver: No such file or directory + + This patch makes the following changes: + + * Redirects the error messages from 'ofpathname' to stderr + * Adds more checks to 'lsdevinfo' to filter out stderr text + from input to various parsing commands. + + Signed-off-by: Michael Bringmann + Signed-off-by: Tyrel Datwyler + +diff --git a/scripts/lsdevinfo b/scripts/lsdevinfo +index 4ef98d7..85019e9 100755 +--- a/scripts/lsdevinfo ++++ b/scripts/lsdevinfo +@@ -225,7 +225,7 @@ show_eth () + # Look at every vNIC device + for dev in $($LS -d /proc/device-tree/vdevice/vnic* 2> /dev/null); do + # use ofpathname to get the device name (i.e. eth0) +- name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) ++ name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//") 2> /dev/null) + connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/l-lan@//") + parent="vio" + +@@ -246,7 +246,7 @@ done + # Look at every ibmveth (Virtual Ethernet) device + for dev in $($LS -d /proc/device-tree/vdevice/l-lan* 2> /dev/null); do + # use ofpathname to get the device name (i.e. eth0) +- name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) ++ name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//") 2> /dev/null) + connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/l-lan@//") + parent="vio" + +@@ -268,7 +268,7 @@ done + for pci_dev in $($LS -d /proc/device-tree/pci* 2> /dev/null); do + for dev in $($LS -d $pci_dev/ethernet* 2> /dev/null); do + # use ofpathname to get the device name (i.e. eth0) +- name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) ++ name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//") 2> /dev/null) + connection=$(echo $pci_dev | $SED -e "s/\/proc\/device-tree\/pci@//") + parent="pci" + +@@ -280,7 +280,7 @@ for pci_dev in $($LS -d /proc/device-tree/pci* 2> /dev/null); do + class="adapter" + subclass="pci" + prefix="eth" +- driver=$($LS -l /sys/class/net/$name/device/driver | ++ driver=$($LS -l /sys/class/net/$name/device/driver 2> /dev/null | + $SED -e "s/^.*\///") + status=1 + +@@ -312,11 +312,11 @@ for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + prefix="host" + driver="ibmvscsic" + +- host=$($LS -d /sys/devices/vio/$slot/host*/) ++ host=$($LS -d /sys/devices/vio/$slot/host*/ 2> /dev/null) + if [[ -d $host/scsi_host ]]; then +- scsihost=$($LS -d $host/scsi_host/host*/) ++ scsihost=$($LS -d $host/scsi_host/host*/ 2> /dev/null) + else +- scsihost=$($LS -d $host/scsi_host*/) ++ scsihost=$($LS -d $host/scsi_host*/ 2> /dev/null) + fi + + if [[ $(cat $scsihost/state) == "running" ]] ; then +@@ -365,12 +365,12 @@ for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + fi + + # loop through the targets for this host. +- for t in $($LS -d $host/target*); do ++ for t in $($LS -d $host/target* 2> /dev/null); do + target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) + if [[ ! -d $target/block ]]; then +- name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") ++ name=$(echo $($LS -d $target/block* 2> /dev/null) | $SED -e "s/.*://") + else +- name=$($LS $target/block) ++ name=$($LS $target/block 2> /dev/null) + fi + + conn=$($OFPATHNAME /dev/$name 2> /dev/null | $SED -e "s/.*disk@//") +@@ -446,7 +446,7 @@ for dev in $($LS -d /proc/device-tree/vdevice/vfc-client* 2> /dev/null) ; do + slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/vfc-client@//") + + # there is only one host per device, assign it to the path's name +- for host in $($LS -d /sys/devices/vio/$slot/host*) ; do ++ for host in $($LS -d /sys/devices/vio/$slot/host* 2> /dev/null) ; do + parent=$(echo $host | $SED -e "s/.*\///") + name=$parent + +@@ -457,11 +457,11 @@ for dev in $($LS -d /proc/device-tree/vdevice/vfc-client* 2> /dev/null) ; do + prefix="host" + driver="ibmvfc" + +- host=$($LS -d /sys/devices/vio/$slot/host*/) ++ host=$($LS -d /sys/devices/vio/$slot/host*/ 2> /dev/null) + if [[ -d $host/scsi_host ]]; then +- scsihost=$($LS -d $host/scsi_host/host*/) ++ scsihost=$($LS -d $host/scsi_host/host*/ 2> /dev/null) + else +- scsihost=$($LS -d $host/scsi_host*/) ++ scsihost=$($LS -d $host/scsi_host*/ 2> /dev/null) + fi + + if [[ $(cat $scsihost/state) == "running" ]] ; then +@@ -510,16 +510,16 @@ for dev in $($LS -d /proc/device-tree/vdevice/vfc-client* 2> /dev/null) ; do + fi + + # As opposed to ibmvscsi, there are multiple rports in each host +- for rport in $($LS -d $host/rport*); do ++ for rport in $($LS -d $host/rport* 2> /dev/null); do + + # in ibmvfc there are two layers of directories before getting to + # the targets +- for t in $($LS -d $rport/target*); do ++ for t in $($LS -d $rport/target* 2> /dev/null); do + for target in $($LS $t | $GREP "[0-9]*:[0-9]*:[0-9]*:[0-9]*"); do + if [[ ! -d $t/$target/block ]]; then + name=$(echo $($LS -d $t/$target/block*) | $SED -e "s/.*://") + else +- name=$($LS $t/$target/block) ++ name=$($LS $t/$target/block 2> /dev/null) + fi + + connection=$($OFPATHNAME /dev/$name 2> /dev/null | $SED -e "s/.*disk@//") +diff --git a/scripts/ofpathname b/scripts/ofpathname +index 1b2a1dd..c37c6bd 100755 +--- a/scripts/ofpathname ++++ b/scripts/ofpathname +@@ -84,20 +84,20 @@ err() + fi + + case $emsg in +- 1) echo "$OFPATHNAME: Could not retrieve Open Firmware device path" +- echo " for logical device \"$DEVNAME_ARG\"." ;; ++ 1) echo "$OFPATHNAME: Could not retrieve Open Firmware device path" 1>&2 ++ echo " for logical device \"$DEVNAME_ARG\"." 1>&2 ;; + +- 2) echo "$OFPATHNAME: sysfs (/sys) is needed and does not appear" +- echo " to be mounted on this system." ;; ++ 2) echo "$OFPATHNAME: sysfs (/sys) is needed and does not appear" 1>&2 ++ echo " to be mounted on this system." 1>&2 ;; + +- 3) echo "$OFPATHNAME: Could not find sysfs information for logical" +- echo " device \"$DEVNAME_ARG\"." ;; ++ 3) echo "$OFPATHNAME: Could not find sysfs information for logical" 1>&2 ++ echo " device \"$DEVNAME_ARG\"." 1>&2 ;; + +- 4) echo "$OFPATHANME: Logical device \"$DEVNAME_ARG\" does not appear" +- echo " to be configured." ;; ++ 4) echo "$OFPATHANME: Logical device \"$DEVNAME_ARG\" does not appear" 1>&2 ++ echo " to be configured." 1>&2 ;; + +- 5) echo "$OFPATHNAME: Could not retrieve logical device name for" +- echo " Open Firmware path \"$DEVNAME_ARG\"." ++ 5) echo "$OFPATHNAME: Could not retrieve logical device name for" 1>&2 ++ echo " Open Firmware path \"$DEVNAME_ARG\"." 1>&2 ;; + esac + + exit 1 +@@ -1631,7 +1631,7 @@ of2l_nvme() + # + . $PSERIES_PLATFORM + if [[ $platform = $PLATFORM_POWERNV ]]; then +- echo "$OFPATHNAME: is not supported on the $platform_name platform" ++ echo "$OFPATHNAME: is not supported on the $platform_name platform" 1>&2 + exit 1 + fi + diff --git a/SOURCES/powerpc-utils-f567bdb8.patch b/SOURCES/powerpc-utils-f567bdb8.patch new file mode 100644 index 0000000..976b7c5 --- /dev/null +++ b/SOURCES/powerpc-utils-f567bdb8.patch @@ -0,0 +1,40 @@ +commit f567bdb8b2a3effdb4af06e2cf935b0350f2f881 +Author: Vasant Hegde +Date: Wed Feb 20 15:44:09 2019 +0530 + + man/update_flash: Fix man page + + Add heading to NOTES section. + + Signed-off-by: Vasant Hegde + Signed-off-by: Tyrel Datwyler + +diff --git a/man/update_flash.8 b/man/update_flash.8 +index 0e5ccf6..254fbac 100644 +--- a/man/update_flash.8 ++++ b/man/update_flash.8 +@@ -196,11 +196,15 @@ PowerNV + /sys/firmware/opal/{validate/manage/update}_flash + .fi + .SH NOTES ++.B Download firmware ++.fi + Firmware may be downloaded from the IBM website. Instructions for + downloading and installing the firmware image are also there, and + information there will be more up-to-date than this page. + + .P ++.B Firmware update failure ++.fi + Various conditions can lead to a firmware update failure. If you + receive an authentication-related error, such as: + .P +@@ -222,6 +226,8 @@ following the steps outlined here: + http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/p7hatl/iphblresetserverp6.htm + + .P ++.B AIX format image ++.fi + For older "AIX format" images, the file will have a .BIN extension. This + zip file happens to be an AIX binary, but it can be extracted with the + unzip command (with password from the web page): diff --git a/SOURCES/powerpc-utils-fac783d18d61af232b957af259a15ed231f6869b.patch b/SOURCES/powerpc-utils-fac783d18d61af232b957af259a15ed231f6869b.patch new file mode 100644 index 0000000..114bc95 --- /dev/null +++ b/SOURCES/powerpc-utils-fac783d18d61af232b957af259a15ed231f6869b.patch @@ -0,0 +1,156 @@ +commit fac783d18d61af232b957af259a15ed231f6869b +Author: Juliet Kim +Date: Thu Sep 13 15:57:42 2018 -0400 + + ppc64_cpu: Limit number of CPUs for frequency calculation + + The patch limits the number of threads used for CPU frequency calculation + to the minimum of either the actual number of CPUs in the system or + CPU_SETSIZE(currently 1024). In other words, if the number of CPUs in the + system is less than CPU_SETSIZE, a thread is created for each of the CPUs, + otherwise only CPU_SETSIZE threads are created. This is being done because + sched_setaffinity() will only work on CPU_SETSIZE CPUs, anything over the + limit is not supported. + + Signed-off-by: Juliet Kim + Signed-off-by: Tyrel Datwyler + +diff --git a/src/ppc64_cpu.c b/src/ppc64_cpu.c +index 34654b4..6d02235 100644 +--- a/src/ppc64_cpu.c ++++ b/src/ppc64_cpu.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + + #ifdef WITH_LIBRTAS + #include +@@ -849,7 +850,7 @@ static int do_run_mode(char *run_mode) + + #ifdef HAVE_LINUX_PERF_EVENT_H + +-static int setup_counters(struct cpu_freq *cpu_freqs) ++static int setup_counters(struct cpu_freq *cpu_freqs, int max_thread) + { + int i; + struct perf_event_attr attr; +@@ -863,7 +864,7 @@ static int setup_counters(struct cpu_freq *cpu_freqs) + /* Record how long the event ran for */ + attr.read_format |= PERF_FORMAT_TOTAL_TIME_RUNNING; + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + if (!cpu_online(i)) { + cpu_freqs[i].offline = 1; + continue; +@@ -886,11 +887,11 @@ static int setup_counters(struct cpu_freq *cpu_freqs) + return 0; + } + +-static void start_counters(struct cpu_freq *cpu_freqs) ++static void start_counters(struct cpu_freq *cpu_freqs, int max_thread) + { + int i; + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + if (cpu_freqs[i].offline) + continue; + +@@ -898,11 +899,11 @@ static void start_counters(struct cpu_freq *cpu_freqs) + } + } + +-static void stop_counters(struct cpu_freq *cpu_freqs) ++static void stop_counters(struct cpu_freq *cpu_freqs, int max_thread) + { + int i; + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + if (cpu_freqs[i].offline) + continue; + +@@ -915,12 +916,12 @@ struct read_format { + uint64_t time_running; + }; + +-static void read_counters(struct cpu_freq *cpu_freqs) ++static void read_counters(struct cpu_freq *cpu_freqs, int max_thread) + { + int i; + struct read_format vals; + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + size_t res; + + if (cpu_freqs[i].offline) +@@ -941,11 +942,11 @@ static void read_counters(struct cpu_freq *cpu_freqs) + } + } + +-static void check_threads(struct cpu_freq *cpu_freqs) ++static void check_threads(struct cpu_freq *cpu_freqs, int max_thread) + { + int i; + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + if (cpu_freqs[i].offline) + continue; + +@@ -1074,21 +1075,27 @@ static int do_cpu_frequency(int sleep_time) + double sum = 0; + unsigned long count = 0; + struct cpu_freq *cpu_freqs; ++ int max_thread; + + setrlimit_open_files(); + +- cpu_freqs = calloc(threads_in_system, sizeof(*cpu_freqs)); ++ max_thread = MIN(threads_in_system, CPU_SETSIZE); ++ if (max_thread < threads_in_system) ++ printf("ppc64_cpu currently supports up to %d CPUs\n", ++ CPU_SETSIZE); ++ ++ cpu_freqs = calloc(max_thread, sizeof(*cpu_freqs)); + if (!cpu_freqs) + return -ENOMEM; + +- rc = setup_counters(cpu_freqs); ++ rc = setup_counters(cpu_freqs, max_thread); + if (rc) { + free(cpu_freqs); + return rc; + } + + /* Start a soak thread on each CPU */ +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + if (cpu_freqs[i].offline) + continue; + +@@ -1103,15 +1110,15 @@ static int do_cpu_frequency(int sleep_time) + /* Wait for soak threads to start */ + usleep(1000000); + +- start_counters(cpu_freqs); ++ start_counters(cpu_freqs, max_thread); + /* Count for specified timeout in seconds */ + usleep(sleep_time * 1000000); + +- stop_counters(cpu_freqs); +- check_threads(cpu_freqs); +- read_counters(cpu_freqs); ++ stop_counters(cpu_freqs, max_thread); ++ check_threads(cpu_freqs, max_thread); ++ read_counters(cpu_freqs, max_thread); + +- for (i = 0; i < threads_in_system; i++) { ++ for (i = 0; i < max_thread; i++) { + double frequency; + + if (cpu_freqs[i].offline) diff --git a/SPECS/powerpc-utils.spec b/SPECS/powerpc-utils.spec new file mode 100644 index 0000000..1ec7943 --- /dev/null +++ b/SPECS/powerpc-utils.spec @@ -0,0 +1,449 @@ +Name: powerpc-utils +Version: 1.3.4 +Release: 10%{?dist} +Summary: Utilities for PowerPC platforms +Group: System Environment/Base +License: GPLv2 +URL: https://github.com/nfont/%{name}/ + +Source0: https://github.com/nfont/%{name}/archive/v%{version}.tar.gz +Source1: nvsetenv + +# This hack is needed only for platforms with autoconf < 2.63 +Patch0: powerpc-utils-autoconf.patch +Patch1: powerpc-utils-1.2.15-man.patch + +# add missing man pages: update_flash_nv, pseries_platform +Patch2: powerpc-utils-1.3.4-update_flash_nv_pseries_platform_man.patch + +# bz#1540067 load rpadlpar_io on -C as well +Patch3: powerpc-utils-1.3.4-load_rpadlpar_io.patch + +# bz#1592429 Device nvme0 listed as "Unknown slot type" from lsslot - FW b0502a_1817.920 +Patch4: powerpc-utils-35d01313b5d03069bf8cabbcdfe39944da4ae65c.patch + +# bz#1596121, POWER9/P9 ZZ DD2.2 machine frequency varies during workload +Patch5: powerpc-utils-149c7022a56e0ffb5fe27681f574d46860323e3c.patch + +# bz#1628907, ppc64_cpu tool got aborted while reading frequency +Patch6: powerpc-utils-fac783d18d61af232b957af259a15ed231f6869b.patch + +# bz#1630295, bootlist errors +Patch7: powerpc-utils-c3f583a9f62ee33080523c2d1d076fdf8d5520e7 + +# bz#1710217, lparstat and update_flash fixes +Patch8: powerpc-utils-7fb22cb5.patch +Patch9: powerpc-utils-081e7ac9.patch +Patch10: powerpc-utils-7790c5ae.patch +Patch11: powerpc-utils-d1576f88.patch +Patch12: powerpc-utils-7be598c7.patch +Patch13: powerpc-utils-01c9cbcf.patch +Patch14: powerpc-utils-f567bdb8.patch +Patch15: powerpc-utils-b5fea40a.patch +Patch16: powerpc-utils-bc928b06.patch +Patch17: powerpc-utils-8b7978b1.patch +Patch18: powerpc-utils-1d414737.patch +# fails getting topology for Broadcom Houston adapter doing DLPAR +Patch19: powerpc-utils-dd6da6b329bac2743d1c80b5556b494c923c11ad.patch + +ExclusiveArch: ppc64 ppc64le + +# This is done before release of F12 +Obsoletes: powerpc-utils-papr < 1.1.6-3 +Provides: powerpc-utils-papr = 1.1.6-3 + +# should be fixed - libservicelog is not right name +Requires: libservicelog bc which +Requires: powerpc-utils-python +Requires: perl(Data::Dumper) +BuildRequires: zlib-devel doxygen automake librtas-devel >= 1.4.0 libservicelog-devel >= 1.0.1-2 + + +%description +Utilities for PowerPC platforms. + + +%prep +%setup -q + +# This hack is needed only for platforms with autoconf < 2.63 +%if 0%{?fedora} < 9 && 0%{?rhel} < 6 +%patch0 -p1 -b .aconf +%endif +%patch1 -p1 -b .man +%patch2 -p1 -b .man1 +%patch3 -p1 -b .load_rpadlpar_io +%patch4 -p1 -b .1592429 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 + +%build +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +./autogen.sh +%configure +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT FILES= RCSCRIPTS= +install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/nvsetenv + +%define pkgdocdir %{_datadir}/doc/%{name}-%{version} +# move doc files +mkdir -p $RPM_BUILD_ROOT%{pkgdocdir} +install $RPM_BUILD_ROOT/usr/share/doc/packages/powerpc-utils/* -t $RPM_BUILD_ROOT%{pkgdocdir} +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 + + +%files +%{_sbindir}/nvsetenv +%{_sbindir}/nvram +#deprecated, use sosreport instead +%exclude %{_sbindir}/snap +%{_sbindir}/bootlist +%{_sbindir}/ofpathname +%{_sbindir}/ppc64_cpu +%{_sbindir}/lsdevinfo +%{_sbindir}/lsprop +%{_mandir}/man8/nvram.8* +%{_mandir}/man8/nvsetenv.8* +%exclude %{_mandir}/man8/snap.8* +%{_mandir}/man8/bootlist.8* +%{_mandir}/man8/ofpathname.8* + +%{_sbindir}/update_flash +%{_sbindir}/activate_firmware +%{_sbindir}/set_poweron_time +%{_sbindir}/rtas_ibm_get_vpd +%{_sbindir}/serv_config +%{_sbindir}/uesensor +%{_sbindir}/hvcsadmin +%{_sbindir}/rtas_dump +%{_sbindir}/rtas_event_decode +%{_sbindir}/sys_ident +%{_sbindir}/drmgr +%{_sbindir}/lsslot +%{_sbindir}/ls-vdev +%{_sbindir}/ls-veth +%{_sbindir}/ls-vscsi +%{_sbindir}/lparstat +%{_sbindir}/pseries_platform +%{_sbindir}/update_flash_nv +%{_sbindir}/errinjct +%{_sbindir}/rtas_dbg + +%{_bindir}/amsstat +%{_mandir}/man8/update_flash.8* +%{_mandir}/man8/update_flash_nv.8* +%{_mandir}/man8/activate_firmware.8* +%{_mandir}/man8/set_poweron_time.8* +%{_mandir}/man8/rtas_ibm_get_vpd.8* +%{_mandir}/man8/serv_config.8* +%{_mandir}/man8/uesensor.8* +%{_mandir}/man8/hvcsadmin.8* +%{_mandir}/man8/rtas_dump.8* +%{_mandir}/man8/sys_ident.8* +%{_mandir}/man8/lparstat.8* +%{_mandir}/man5/lparcfg.5* +%{_mandir}/man1/amsstat.1* +%{_mandir}/man8/lsdevinfo.8* +%{_mandir}/man8/rtas_event_decode.8* +%{_mandir}/man8/ls-vdev.8* +%{_mandir}/man8/lsslot.8* +%{_mandir}/man8/lsprop.8* +%{_mandir}/man8/drmgr.8* +%{_mandir}/man8/ls-veth.8* +%{_mandir}/man8/ppc64_cpu.8* +%{_mandir}/man8/ls-vscsi.8* +%{_mandir}/man8/errinjct.8* +%{_mandir}/man8/rtas_dbg.8* +%{_mandir}/man8/pseries_platform.8* + +%doc README COPYING Changelog + + +%changelog +* Tue Jun 04 2019 Than Ngo - 1.3.4-10 +- Resolves: #1716888 - fails getting topology for Broadcom Houston adapter doing DLPAR + +* Wed May 15 2019 Than Ngo - 1.3.4-9 +- Resolves: #1710217 - lparstat and update_flash fixes + +* Fri Nov 30 2018 Than Ngo - 1.3.4-8 +- Resolves: #1630295, bootlist errors +- Resolves: #1625107, display logical name using bootlist -o option + +* Mon Sep 17 2018 Than Ngo - 1.3.4-7 +- Resolves: bz#1628907, ppc64_cpu tool got aborted while reading frequency + +* Fri Jun 29 2018 Than Ngo - 1.3.4-6 +- Resolves: bz#1596121 - POWER9/P9 ZZ DD2.2 machine frequency varies during workload + +* Thu Jun 21 2018 Than Ngo - 1.3.4-5 +- Resolves: #1592429 - device nvme0 listed as "Unknown slot type" from lsslot" + +* Tue Jun 05 2018 Than Ngo - 1.3.4-4 +- Resolves: #1540067 - load rpadlpar_io on -C as well + +* Fri Sep 15 2017 Than Ngo - 1.3.4-3 +- Related: #1478871 - correct bugzilla number in changelog + +* Fri Sep 15 2017 Than Ngo - 1.3.4-2 +- Related: #1457408 - add missing man pages + +* Thu Sep 14 2017 Than Ngo - 1.3.4-1 +- Resolves: #1457408 - Update to 1.3.4 +- Resolves: #1478871 - "lsslot -c mem" fails with segmentation fault + +* Wed Jun 07 2017 Dan Horák - 1.3.3-4 +- Resolves: #1459270 - mkvterm calls fail with "DLPAR slot operations are not supported" + +* Fri Jun 02 2017 Dan Horák - 1.3.3-3 +- Resolves: #1457885 - lsslot doesn't display the slot information + +* Tue Mar 21 2017 Sinny Kumari - 1.3.3-2 +- Related: #1380656 - Rebuild due to soname change in librtas package + +* Mon Jan 23 2017 Rafael Fonseca - 1.3.3-1 +- Resolves: #1380648 - Update to 1.3.3 + +* Tue Aug 30 2016 Rafael Fonseca - 1.3.2-2 +- Resolves: #1366512 - lparstat segfault if 'SPU' line in /proc/interrupts is + too long + +* Tue Jul 12 2016 Rafael Fonseca - 1.3.2-1 +- Resolves: #1355775 - Update 1.3.2 to incorporate various important fixes +- Drop deprecated patches. + +* Mon Jul 04 2016 Rafael Fonseca - 1.3.1-2 +- Resolves: #1347083 - lparstat doesn't report physc correctly. + +* Fri Apr 08 2016 Rafael Fonseca - 1.3.1-1 +- Resolves: #1275706 - [7.3 FEAT] powerpc-utils package update - ppc64/ppc64le +- Resolves: #1302728 - [LEGAL] License change in powerpc-utils 1.3.0 +- Resolves: #1334203 - Hotplug detach issue with Mellanox CX4 (SR-IOV and + dedicated) +- Resolves: #1263772 - drmgr command is not giving valid error message under + RHEL +- Updated upstream URL. +- Drop deprecated patches. + +* Tue Sep 08 2015 Jakub Čajka - 1.2.26-2 +- Resolves: #1260285 - chhwres command hungs when creating VNIC adapter on RHEL7.1 LE partition (powerpc-utils) + +* Thu Jun 25 2015 Jakub Čajka - 1.2.26-1 +- Resolves: #1182040 - [7.2 FEAT] powerpc-utils package update - ppc64/ppc64le + +* Fri Jun 19 2015 Jakub Čajka - 1.2.25-1 +- Resolves: #1182040 - [7.2 FEAT] powerpc-utils package update - ppc64/ppc64le +- Resolves: #1199348 - After migration of RHEL7.1 Little Endian lpar, RMC connection on HMC will be lost (LPM) +- Resolves: #1207823 - drmgr -R flag is not working (powerpc-utils) + + +* Thu Jan 08 2015 Jakub Čajka - 1.2.24-7 +- Related: #1179263 - reverted changes related to this bug + +* Tue Jan 06 2015 Jakub Čajka - 1.2.24-6 +- Related: #1179263 - fixed file permissions + +* Tue Jan 06 2015 Jakub Čajka - 1.2.24-5 +- Resolves: #1179263 - RHEL 7.1-LE LPAR: ppc64_cpu --threads-per-core gives wrong data when --smt value set + +* Fri Jan 02 2015 Jakub Čajka - 1.2.24-4 +- Resolves: #1175812 - powerpc-utils: rtas_dump showing some unwanted character + +* Tue Dec 09 2014 Jakub Čajka - 1.2.24-3 +- Resolves: #1172087 - snap fails +- snap removed, sosreport should be used instead + +* Fri Dec 05 2014 Jakub Čajka - 1.2.24-2 +- Resolves: #1170856 - Could not gather LMB information when doing Mem DLPAR on RHEL7.1 Alpha LE (powerpc-utils) + +* Thu Nov 27 2014 Jakub Čajka - 1.2.24-1 +- Resolves: #1167865 - CPU/Mem DLPAR failed on both RHEL7.1 Alpha BE and LE +- Rebase to 1.2.24 + +* Fri Nov 14 2014 Jakub Čajka - 1.2.23-2 +- Resolves: #1164147 - CVE-2014-4040 powerpc-utils: snap creates archives with fstab and yaboot.conf which may expose certain passwords [rhel-7.1] + +* Mon Nov 10 2014 Jakub Čajka - 1.2.23-1 +- Resolves: #1161552 - powerpc-utils package update for RHEL7.1 Beta + +* Tue Oct 14 2014 Jakub Čajka - 1.2.22-2 +- Resolves: #1152313 - STC820:Brazos:JMET:lisafp1:lisap05:RHEL7 Hung/Crashed while running htx ... + +* Thu Sep 04 2014 Jakub Čajka - 1.2.22-1 +- Related: #1088539 - [7.1 FEAT] powerpc-utils package update - ppc64 +- Rebase to 1.2.22 + +* Mon Aug 25 2014 Jakub Čajka - 1.2.21-1 +- Resolves: #1088539 - [7.1 FEAT] powerpc-utils package update - ppc64 +- Resolves: #1083221 - Validation Failure with Linux partitions - Inactive RMC ... +- Resolves: #1079246 - powerpc-utils: lsdevinfo does not handle path of device on full system lpar. +- Resolves: #1083791 - powerpc-utils: add support for hotplug of qemu pci virtio devices +- Resolves: #1124006 - powerpc-utils needs ppc64le added to ExclusiveArch + +* Wed Mar 12 2014 Karsten Hopp 1.2.18-9 +- fix parsing of the value supplied for the -s option +- Resolves: #1074629 +- fix wrong check of valid_platform() return value +- Resolves: #1074635 + +* Mon Mar 10 2014 Karsten Hopp 1.2.18-8 +- update display message when Power System FW entitlement expires +- Resolves: rhbz 1071555 + +* Mon Feb 17 2014 Jaromir Capik - 1.2.18-7 +- drmgr: Fixing addition of device nodes (#1064220) +- sys_ident: Adding support for P8 Systems (#1064484) +- Resolves: rhbz#1064220, rhbz#1064484 + +* Mon Feb 10 2014 Jaromir Capik - 1.2.18-6 +- drmgr: Fixing allocation failures & race when removing adapter (#1061179) +- drmgr: Fixing return code when running with --capabilities (#1061092) +- Fixing bogus date in the changelog +- Cleaning the spec +- Resolves: rhbz#1061179, rhbz#1061092 + +* Thu Jan 16 2014 Filip Kocina - 1.2.18-5 +- Resolves: #1054031 - snap command get hung. No response + +* Tue Jan 14 2014 Filip Kocina - 1.2.18-4 +- Resolves: #1043455 && #1039473 - nvram tool fails to decompress the data && ofpathname in RHEL7 doesn't handle virtio-blk disks + +* Fri Dec 27 2013 Daniel Mach - 1.2.18-3 +- Mass rebuild 2013-12-27 + +* Thu Nov 28 2013 Filip Kocina - 1.2.18-2 +- Resolves: #1030236 - update FW entitlement message terminology + +* Wed Sep 25 2013 Filip Kocina - 1.2.18-1 +- Resolves: #1011038 - updated to latest upstream 1.2.18 + +* Thu Sep 12 2013 Filip Kocina - 1.2.17-1 +- Resolves: #947179 - updated to latest upstream 1.2.17 && applying patch nvram + +* Wed Jun 26 2013 Tony Breeds - 1.2.16-2 +- drmgr: Check for rpadlpar_io module +- resolves: #972606 + +* Tue May 21 2013 Vasant Hegde - 1.2.16 +- Update to latest upstream 1.2.16 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.2.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Jan 16 2013 Karsten Hopp 1.2.15-1 +- update to 1.2.15 +- usysident/usysattn got moved to ppc64-diag package +- multipath ofpathname patch removed as it is upstream now + +* Tue Dec 18 2012 Filip Kocina 1.2.14-1 +- Resolves: #859222 - updated to latest upstream 1.2.14 + +* Thu Dec 13 2012 Karsten Hopp 1.2.12-4 +- Add multipath support to ofpathname for bug #884826 + +* Tue Sep 04 2012 Karsten Hopp 1.2.12-3 +- require powerpc-utils-python (#852326 comment 7) + +* Sat Jul 21 2012 Fedora Release Engineering - 1.2.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Mar 22 2012 Jiri Skala - 1.2.12-1 +- updated to latest upstream 1.2.12 + +* Sat Jan 14 2012 Fedora Release Engineering - 1.2.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Nov 03 2011 Jiri Skala - 1.2.11-2 +- updated dependecy + +* Mon Oct 31 2011 Jiri Skala - 1.2.11-1 +- updated to latest upstream 1.2.11 +-fixes #749892 - powerpc-utils spec file missing dependency + +* Fri Aug 05 2011 Jiri Skala - 1.2.10-1 +- updated to latest upstream 1.2.10 + +* Wed Feb 09 2011 Fedora Release Engineering - 1.2.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 24 2011 Jiri Skala - 1.2.6-1 +- updated to latest upstream 1.2.6 +- removed amsvis man page (amsvis moved to powerpc-utils-python) +- added lparcfg man page - doc to /proc/ppc64/lparcfg + +* 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 + +* Wed Jun 09 2010 Roman Rakus - 1.2.2-10 +- Added some upstream patches +- also bump release + +* Wed Jun 02 2010 Roman Rakus - 1.2.2-4 +- correct the parameter checking when attempting to set the run mode +- also bump release + +* Fri Mar 05 2010 Roman Rakus - 1.2.2-2 +- Removed deprecated init script and perl script + +* Thu Oct 29 2009 Stepan Kasal - 1.2.2-1 +- new upstream version +- amsvis removed, this package has no longer anything with python +- change the manual pages in the file list so that it does not depend on + particular compression used +- add patch for configure.ac on platforms with autoconf < 2.63 +- use standard %%configure/make in %%build + +* Mon Aug 17 2009 Roman Rakus - 1.2.0-1 +- Bump tu version 1.2.0 - powerpc-utils and powerpc-utils-papr get merged + +* Sun Jul 26 2009 Fedora Release Engineering - 1.1.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Apr 06 2009 Roman Rakus - 1.1.3-1 +- new upstream version 1.1.3 + +* Tue Mar 03 2009 Roman Rakus - 1.1.2-1 +- new upstream version 1.1.2 + +* Thu Feb 26 2009 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Feb 19 2009 Roman Rakus - 1.1.1-1 +- new upstream version 1.1.1 + +* Mon Feb 18 2008 Fedora Release Engineering - 1.0.6-3 +- Autorebuild for GCC 4.3 + +* Mon Dec 3 2007 David Woodhouse 1.0.6-2 +- Add --version to nvsetenv, for ybin compatibility + +* Fri Nov 23 2007 David Woodhouse 1.0.6-1 +- New package, split from ppc64-utils