diff --git a/powerpc-utils-1.3.8-hcnmgr.patch b/powerpc-utils-1.3.8-hcnmgr.patch new file mode 100644 index 0000000..1947b8c --- /dev/null +++ b/powerpc-utils-1.3.8-hcnmgr.patch @@ -0,0 +1,118 @@ +diff -up powerpc-utils-1.3.8/man/hcnmgr.8.me powerpc-utils-1.3.8/man/hcnmgr.8 +--- powerpc-utils-1.3.8/man/hcnmgr.8.me 2020-10-01 13:09:19.969454947 +0200 ++++ powerpc-utils-1.3.8/man/hcnmgr.8 2020-10-01 13:09:29.969148204 +0200 +@@ -0,0 +1,35 @@ ++.TH hcnmgr "01 October 2020" "Linux" "Linux on Power Service Tools" ++.RS ++hcnmgr contains a set of commands to support migratable SR_IOV logical port. ++The new commands configure/query/remove network devices. New commands should ++be called from the HMC, rather than directly from linux LPAR ++.PP ++Usage: hcncfgdrc DRC_INDEX= [STAKE_TOKEN=NULL] [\fB-d\fP] ++Configure a device to hybrid network HCN ++.PP ++Usage: hcnrmhcn HCN_ID= ++Remove a hybrid network HCN given an HCN ID ++.PP ++Usage: hcnrmdev DRC_INDEX= HCN_ID= ++Unconfigure device from HCN ++.PP ++Usage: hcnqrydev DRC_INDEX= HCN_ID= ++Query a device given a DRC_INDEX or HCN ID ++.PP ++Usage: hcnversion ++get the current version of the HCN support ++.PP ++Optional arguments. ++.RS ++.TP ++.B ++\fB-s\fP ++scan device-tree and configure HCN ++.TP ++.B ++\fB-V\fP ++Display version information and exit ++.TP ++.B ++\fB-h\fP ++Display this help information and exit +diff -up powerpc-utils-1.3.8/scripts/hcnmgr.me powerpc-utils-1.3.8/scripts/hcnmgr +--- powerpc-utils-1.3.8/scripts/hcnmgr.me 2020-10-01 13:03:10.839439027 +0200 ++++ powerpc-utils-1.3.8/scripts/hcnmgr 2020-10-01 13:06:18.479509944 +0200 +@@ -1,4 +1,4 @@ +-#! /bin/bash ++#!/usr/bin/bash + + # Copyright (c) 2020 International Business Machines + # +@@ -562,34 +562,7 @@ scanhcn() { + # Main + # + +-#All echo messages goes into $LOG_FILE +-exec &> >(tee -a $LOG_FILE) +- +-#Start debug log $LOG_FILE with date and time +-NOW=$(date +"%m-%d-%Y %T") +-echo "=======================$NOW============================" +- +-#Validate this tool is running on powerpc platform +-. "$PSERIES_PLATFORM" +-if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then +- err $E_EPERM +-fi +- +-#Validate NMCLI packages is install to manage networking +-if ! nmcli --version >/dev/null 2>&1; then +- err $E_ENETUNREACH +-fi +- +-#Validate bonding module is loaded +-if ! lsmod | grep -q bonding; then +- hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..." +- if ! modprobe bonding; then +- err $E_NOMODULE +- fi +-fi +- + HCNCMD=$(basename "$0") +-hcnlog DEBUG "$HCNCMD enter" + + #getops for help and version + while getopts "sVhd:" arg; do +@@ -616,6 +589,34 @@ while getopts "sVhd:" arg; do + esac + done + ++#All echo messages goes into $LOG_FILE ++exec &> >(tee -a $LOG_FILE) ++ ++hcnlog DEBUG "$HCNCMD enter" ++ ++#Start debug log $LOG_FILE with date and time ++NOW=$(date +"%m-%d-%Y %T") ++echo "=======================$NOW============================" ++ ++#Validate this tool is running on powerpc platform ++. "$PSERIES_PLATFORM" ++if [ "$platform" != "$PLATFORM_PSERIES_LPAR" ]; then ++ err $E_EPERM ++fi ++ ++#Validate NMCLI packages is install to manage networking ++if ! nmcli --version >/dev/null 2>&1; then ++ err $E_ENETUNREACH ++fi ++ ++#Validate bonding module is loaded ++if ! lsmod | grep -q bonding; then ++ hcnlog DEBUG "HCNMGR: Bonding module not loaded, load module ..." ++ if ! modprobe bonding; then ++ err $E_NOMODULE ++ fi ++fi ++ + #Log this scripts command line to syslog + hcnlog INFO "$HCNCMD $*" + diff --git a/powerpc-utils.spec b/powerpc-utils.spec index d24eef1..27758a5 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.3.8 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Utilities for PowerPC platforms License: GPLv2 @@ -36,6 +36,7 @@ Patch3: powerpc-utils-1.3.5-pseries_platform-man.patch Patch4: powerpc-utils-1.3.5-update_flash_nv.patch Patch5: powerpc-utils-1.3.8-install-man.patch Patch6: powerpc-utils-manpage-lparstat.patch +Patch7: powerpc-utils-1.3.8-hcnmgr.patch %description Utilities for PowerPC platforms. @@ -191,6 +192,7 @@ systemctl daemon-reload >/dev/null 2>&1 || : %{_mandir}/man8/uspchrp.8* %{_mandir}/man8/vcpustat.8.gz %{_mandir}/man8/smtstate.8.gz +%{_mandir}/man8/hcnmgr.8* %files core %license COPYING @@ -206,6 +208,9 @@ systemctl daemon-reload >/dev/null 2>&1 || : %changelog +* Thu Oct 01 2020 Than Ngo - 1.3.8-3 +- add hcnmgr man page + * Thu Oct 01 2020 Than Ngo - 1.3.8-2 - clean up systemd service