diff --git a/powerpc-utils-1.3.9-fix-hexdump-format.patch b/powerpc-utils-1.3.9-fix-hexdump-format.patch new file mode 100644 index 0000000..9b7b2bb --- /dev/null +++ b/powerpc-utils-1.3.9-fix-hexdump-format.patch @@ -0,0 +1,39 @@ +diff -up powerpc-utils-1.3.9/scripts/hcnmgr.me powerpc-utils-1.3.9/scripts/hcnmgr +--- powerpc-utils-1.3.9/scripts/hcnmgr.me 2021-11-11 11:38:33.293898966 +0100 ++++ powerpc-utils-1.3.9/scripts/hcnmgr 2021-11-11 11:39:19.302587637 +0100 +@@ -168,7 +168,7 @@ search_dev() { + # Look at pci ethernet devices + for pci_dev in "$DT_PATH"/pci*; do + [ -d "$pci_dev" ] || continue +- index=$(hexdump -n 4 -e '/1 "%02x"' "$pci_dev"/ibm,my-drc-index) ++ index=$(hexdump -n 4 -ve '/1 "%02x"' "$pci_dev"/ibm,my-drc-index) + if [[ $index != "$1" ]]; then + continue + fi +@@ -189,7 +189,7 @@ search_dev() { + hcnlog DEBUG "search vnic device with drc_index $1" + for dev in "$DT_PATH"/vdevice/vnic*; do + [ -d "$dev" ] || continue +- index=$(hexdump -n 4 -e '/1 "%02x"' "$dev"/ibm,my-drc-index) ++ index=$(hexdump -n 4 -ve '/1 "%02x"' "$dev"/ibm,my-drc-index) + if [[ $index == "$1" ]]; then + hcnlog DEBUG "found matching drc_index $index in $dev" + if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then +@@ -205,7 +205,7 @@ search_dev() { + hcnlog DEBUG "search ibmveth device with drc_index $1" + for dev in "$DT_PATH"/vdevice/l-lan*; do + [ -d "$dev" ] || continue +- index=$(hexdump -n 4 -e '/1 "%02x"' "$dev"/ibm,my-drc-index) ++ index=$(hexdump -n 4 -ve '/1 "%02x"' "$dev"/ibm,my-drc-index) + if [[ $index == "$1" ]]; then + hcnlog DEBUG "found matching drc_index $index in $dev" + if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then +@@ -233,7 +233,7 @@ get_dev_hcn() { + local dev=$1 + + hcnlog DEBUG "get_dev_hcn: enter $1" +- HCNID=$(hexdump -n 4 -e '/1 "%02x"' "$dev"/ibm,hcn-id) ++ HCNID=$(hexdump -n 4 -ve '/1 "%02x"' "$dev"/ibm,hcn-id) + MODE=$(tr -d '\0' <"$dev"/ibm,hcn-mode) + PHYSLOC=$(tr -d '\0' <"$dev"/ibm,loc-code) + DEVPATH=$1 diff --git a/powerpc-utils-support-vnic-as-backup-device-for-HNV.patch b/powerpc-utils-support-vnic-as-backup-device-for-HNV.patch new file mode 100644 index 0000000..f93d611 --- /dev/null +++ b/powerpc-utils-support-vnic-as-backup-device-for-HNV.patch @@ -0,0 +1,22 @@ +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 2021-11-11 11:10:37.800910318 +0100 ++++ powerpc-utils-1.3.8/scripts/hcnmgr 2021-11-11 11:12:10.597104063 +0100 +@@ -21,7 +21,7 @@ + # support live partition migration with SR_IOV + # + +-VERSION="1.0" ++VERSION="1.1" + PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin + BOND_BASEPATH="/sys/class/net" + BONDOPTIONS="mode=1,miimon=100,fail_over_mac=2" +@@ -630,6 +630,9 @@ fi + if ! nmcli --version >/dev/null 2>&1; then + err $E_ENETUNREACH + fi ++# HNV can support VNIC or Veth as backup device. ++# In the first HNV version 1.0, the vNIC as backup support was turned off ++# HNV VERSION greater than 1.0 starts to support vNIC as the backup device + if [[ $VERSION == "1.0" ]]; then + VNIC_SPT="OFF" + fi diff --git a/powerpc-utils.spec b/powerpc-utils.spec index 89d0be0..c145f93 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,13 +1,17 @@ Name: powerpc-utils Version: 1.3.9 -Release: 2%{?dist} +Release: 3%{?dist} Summary: PERL-based scripts for maintaining and servicing PowerPC systems License: GPLv2 URL: https://github.com/ibm-power-utilities/powerpc-utils Source0: https://github.com/ibm-power-utilities/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: nvsetenv - +# enable support for vnic as backup device +Patch8: powerpc-utils-support-vnic-as-backup-device-for-HNV.patch +# fixed hexdump format +Patch9: powerpc-utils-1.3.9-fix-hexdump-format.patch + ExclusiveArch: ppc %{power64} BuildRequires: gcc @@ -100,26 +104,20 @@ ln -s serv_config.8 %{buildroot}%{_mandir}/man8/uspchrp.8 rm -f $RPM_BUILD_ROOT%{_sbindir}/snap $RPM_BUILD_ROOT%{_mandir}/man8/snap.8* %post core -systemctl daemon-reload >/dev/null 2>&1 || : -systemctl start hcn-init.service >/dev/null 2>&1 || : -systemctl enable hcn-init.service >/dev/null 2>&1 || : +%systemd_post hcn-init.service # update the smt.state file with current SMT /usr/sbin/smtstate --save >/dev/null 2>&1 || : - %preun core -svc=$(systemctl list-units -la | grep -Fq smtstate.service; echo $?) -if [ "$svc" = "0" ]; then - systemctl stop smtstate.service >/dev/null 2>&1 || : - systemctl disable smtstate.service >/dev/null 2>&1 || : -fi -if systemctl is-enabled hcn-init.service |grep -q "enabled"; then - systemctl stop hcn-init.service >/dev/null 2>&1 || : - systemctl disable hcn-init.service >/dev/null 2>&1 || : -fi +%systemd_preun smtstate.service +%systemd_preun hcn-init.service %postun core -systemctl daemon-reload >/dev/null 2>&1 || : +%systemd_postun_with_restart smtstate.service +%systemd_postun_with_restart hcn-init.service + +%posttrans core +systemctl enable hcn-init.service >/dev/null 2>&1 || : %files # PERL-based scripts for maintaining and servicing PowerPC systems @@ -132,7 +130,7 @@ systemctl daemon-reload >/dev/null 2>&1 || : %files core %license COPYING %dir /var/lib/powerpc-utils -/var/lib/powerpc-utils/smt.state +%ghost %config(missingok,noreplace) /var/lib/powerpc-utils/smt.state %{_unitdir}/smtstate.service %{_unitdir}/smt_off.service %{_unitdir}/hcn-init.service @@ -207,6 +205,12 @@ systemctl daemon-reload >/dev/null 2>&1 || : %changelog +* Tue Dec 07 2021 Than Ngo - 1.3.9-3 +- enable support vnic as backend for HNV interface +- fixed hexdump format +- switch to systemd macros in scriptlets +- marked smt.state as %%ghost + * Fri Jul 23 2021 Fedora Release Engineering - 1.3.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild