import powerpc-utils-1.3.6-5.el8

This commit is contained in:
CentOS Sources 2020-01-21 16:49:37 -05:00 committed by Stepan Oksanichenko
parent 521b3122b2
commit 2671eaf599
3 changed files with 160 additions and 1 deletions

View File

@ -0,0 +1,85 @@
From 4fe0e76e1d02787b4cf60eafd2fb3667897becf4 Mon Sep 17 00:00:00 2001
From: Michael Bringmann <mwb@linux.vnet.ibm.com>
Date: Tue, 23 Jul 2019 15:58:21 -0500
Subject: [PATCH 1/1] powerpc-utils: Suppress errors reading kernel
files
A problem was observed with the evaluation of the '${devspec}'
by the script 'ofpathname'. This patch provided improved
handling of errors within that script, and by some of the
follow-on uses of the tool by the 'bootlist' script.
* Deal with error messages returned sometimes by evaluation
of ${devspec} in 'ofpathname'.
* Strip embedded nulls from values provided by kernel files,
especially, /proc/device-tree${devspec}/namespace/name,
in 'ofpathname'.
* Redirect more error messages to /dev/null
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
scripts/bootlist | 8 ++++----
scripts/ofpathname | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/scripts/bootlist b/scripts/bootlist
index 65926d7..5ce20cf 100755
--- a/scripts/bootlist
+++ b/scripts/bootlist
@@ -169,7 +169,7 @@ get_logical_device_name()
local devname=$1
local logical_name
- logical_name=`$OFPATHNAME -l $devname 2>/dev/null`
+ logical_name=`$OFPATHNAME -l $devname 2>/dev/null | tr -d '\000'`
if [[ $? -ne 0 ]]; then
echo ""
else
@@ -207,11 +207,11 @@ show_bootlist()
local devlist=$1
local i
- for i in `$NVRAM --print-config=${devlist} | sed 's/ /\n/g'`; do
+ for i in `$NVRAM --print-config=${devlist} 2> /dev/null | sed 's/ /\n/g'`; do
if [[ $TRANSLATE_NAMES = "yes" ]]; then
name=`get_logical_device_name $i`
if [[ -z $name ]]; then
- echo "Could not translate $i to logical device name"
+ echo "Could not translate $i to logical device name" 2>&1
else
case $name in
eth*) parse_eth_info $name $i ;;
@@ -230,7 +230,7 @@ show_bootlist()
. $PSERIES_PLATFORM
if [[ $platform != $PLATFORM_PSERIES_LPAR ]]; then
- echo "bootlist: is not supported on the $platform_name platform"
+ echo "bootlist: is not supported on the $platform_name platform" 2>&1
exit 1
fi
diff --git a/scripts/ofpathname b/scripts/ofpathname
index c37c6bd..09c0209 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -656,7 +656,7 @@ l2of_nvme()
goto_dir $PWD "device/devspec"
- devspec=`$CAT $PWD/device/devspec`
+ devspec=`$CAT $PWD/device/devspec | tr -d '\000'`
if [[ -n $devspec ]]; then
found=1
break
@@ -681,7 +681,7 @@ l2of_nvme()
# Device type is usually 'namespace'.
# Get it from device-tree just in case.
- devtype=`$CAT /proc/device-tree${devspec}/namespace/name`
+ devtype=`$CAT /proc/device-tree${devspec}/namespace/name | tr -d '\000'` 2> /dev/null
if [[ -z $devtype ]]; then
err $ERR_NO_OFPATH
fi
--
1.8.3.1

View File

@ -0,0 +1,64 @@
commit ea4db66e941720313af2c6b1afb32a74f3e360f4
Author: Michael Bringmann <mwb@linux.vnet.ibm.com>
Date: Tue Sep 10 14:31:42 2019 -0500
Safe bootlist update
This patch is intended to prevent problems with identifying or parsing
the bootlist devices from propagating into the system NVRAM configuration.
A number of such problems have been observed when processing USB devices.
* If 'bootlist' encounters an invalid OF_DEVPATH entry, it will print
an notice, but still continue on to write invalid data to nvram.
Changed to abort the script before writing bad data to nvram.
* When 'ofpathname' encounters an invalid 'devspec' file or invalid
value in a 'devspec' file, while trying to find the logical pathname
for a scsi device, it may continue to return the invalid 'devspec'
value to the caller/invoking script.
Changed to abort with an error message instead of returning that
invalid value to a caller like 'bootlist'.
Example:
# bootlist -m normal sdb
# bootlist -m normal -o
Could not translate (null)/scsi@0/sd@0,0 to logical device name
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
diff --git a/scripts/bootlist b/scripts/bootlist
index 65926d7..acdaf89 100755
--- a/scripts/bootlist
+++ b/scripts/bootlist
@@ -459,6 +459,7 @@ if [[ ${#LOGICAL_NAMES[*]} -ne 0 ]]; then
if [[ -z ${OF_DEVPATH[$ctr]} ]]; then
echo "Device ${LOGICAL_NAMES[$ctr]} does not appear to be valid." >&2
+ exit 1
else
# See if this is an ethernet adapter. If so, the next entries
# may be parameters for the bootlist entry.
diff --git a/scripts/ofpathname b/scripts/ofpathname
index c37c6bd..dc452c4 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -803,9 +803,16 @@ l2of_scsi()
# move up directories until we find one with devspec information
goto_dir $PWD "devspec"
- OF_PATH=`$CAT $PWD/devspec`
+ if [[ -e $PWD/devspec ]]; then
+ OF_PATH=`$CAT $PWD/devspec`
+ else
+ err $ERR_NO_OFPATH
+ fi
+
if [[ -z $OF_PATH ]]; then
err $ERR_NO_OFPATH
+ elif [[ ! -e /proc/device-tree/$OF_PATH ]]; then
+ err $ERR_NO_OFPATH
fi
local vdev=${OF_PATH%/*}

View File

@ -1,6 +1,6 @@
Name: powerpc-utils
Version: 1.3.6
Release: 3%{?dist}
Release: 5%{?dist}
Summary: Utilities for PowerPC platforms
Group: System Environment/Base
@ -37,6 +37,8 @@ Patch9: powerpc-utils-8b7978b114e5df89218daa9b4b48cc0e918ba917.patch
Patch10: powerpc-utils-1d4147370a148b3a2ebadcf02abd4a6c9a763e6d.patch
# Improve handling of errors from subsidiary scripts
Patch11: powerpc-utils-dd6da6b329bac2743d1c80b5556b494c923c11ad.patch
Patch12: 0001-powerpc-utils-Suppress-errors-reading-kern.v2.patch
Patch13: powerpc-utils-ea4db66e941720313af2c6b1afb32a74f3e360f4.patch
%description
Utilities for PowerPC platforms.
@ -78,6 +80,8 @@ Core utilities for PowerPC platforms.
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@ -179,6 +183,12 @@ ln -s nvram.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/nvsetenv.8.gz
%changelog
* Wed Dec 04 2019 Than Ngo <than@redhat.com> - 1.3.6-5
- Resolves: #1779257, Safe bootlist update
* Wed Jul 24 2019 Than Ngo <than@redhat.com> - 1.3.6-4
- Resolves: #1719372 - wrong disk gets booted after installation
* Fri Jun 07 2019 Than Ngo <than@redhat.com> - 1.3.6-3
- Resolves: #1718254, improve handling of errors from subsidiary scripts