s390-tools/s390-tools-sles15sp2-znetconf-introduce-better-ways-to-locate-udevadm.patch
Mark Post 58e312617d Accepting request 823200 from home:markkp:branches:Base:System
- The location of the udevadm binary was changed from /sbin/ to /usr/bin
  a while back. A symbolic link was added for compatibility. In the latest
  versions, that symbolic link has been removed, requiring changes to scripts
  that were depending on that.
  Added the following patches for bsc#1171587
  * s390-tools-sles15sp2-lsluns-try-harder-to-find-udevadm.patch
  * s390-tools-sles15sp2-znetconf-introduce-better-ways-to-locate-udevadm.patch
  *s390-tools-sles15sp2-mon_tools-update-udevadm-location.patch
- Added s390-tools-sles15sp2-zipl-prevent-endless-loop-during-IPL.patch
  (bsc#1174309) zipl: prevent endless loop during secure IPL
- Added s390-tools-sles15sp2-zipl-check-for-valid-ipl-parmblock-lowcore-pointer.patch
  (bsc#1174310) zipl: check for valid ipl parmblock lowcore pointer
- Added s390-tools-sles15sp2-01-zipl-libc-libc_stop-move-noreturn-to-declaration.patch
        s390-tools-sles15sp2-02-zipl-stage3-correctly-handle-diag308-response-code.patch
  (bsc1174311) zipl: Fix KVM IPL without bootindex
- Updated cputype and read_values to recognize the new z15 models.
- Added s390-tools-sles15sp2-zipl-prevent-endless-loop-during-IPL.patch
  (bsc#1174309) zipl: prevent endless loop during secure IPL
- Added s390-tools-sles15sp2-zipl-check-for-valid-ipl-parmblock-lowcore-pointer.patch
  (bsc#1174310) zipl: check for valid ipl parmblock lowcore pointer
- Added s390-tools-sles15sp2-01-zipl-libc-libc_stop-move-noreturn-to-declaration.patch
        s390-tools-sles15sp2-02-zipl-stage3-correctly-handle-diag308-response-code.patch
  (bsc1174311) zipl: Fix KVM IPL without bootindex
- Updated cputype and read_values to recognize the new z15 models.
- Added s390-tools-sles15sp2-vmcp-exit-code.patch (bsc#1173481)
  Change the vmcp exit code and return 'CP command failed' when both
  "CP command failed" and "response buffer is too small" error
  conditions are true.

OBS-URL: https://build.opensuse.org/request/show/823200
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=97
2020-07-28 16:49:48 +00:00

90 lines
2.6 KiB
Diff

From 1003d8141209fdbd50d02aec2cad4690aec48702 Mon Sep 17 00:00:00 2001
From: Guevenc Guelce <guvenc@linux.ibm.com>
Date: Wed, 8 Jul 2020 18:31:34 +0200
Subject: [PATCH] znetconf: introduce better ways to locate udevadm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When udevadm is going to be used, try to locate it
in $PATH and if it fails, try to locate it in well-known
binary paths.
Signed-off-by: Guevenc Guelce <guvenc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
---
zconf/znetconf | 42 +++++++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 9 deletions(-)
diff --git a/zconf/znetconf b/zconf/znetconf
index ba8dec4..497e97f 100755
--- a/zconf/znetconf
+++ b/zconf/znetconf
@@ -63,14 +63,8 @@ CMD=$(basename $0)
LSZNET=/lib/s390-tools/lsznet.raw
LSZNET_ARGS=-a
LSZNET_CALL="$LSZNET $LSZNET_ARGS"
-UDEVSETTLE=/sbin/udevadm
-if [ ! -e $UDEVSETTLE ]
-then
- UDEVSETTLE=/sbin/udevsettle
- UDEVSETTLE_CALL="$UDEVSETTLE --timeout=10"
-else
- UDEVSETTLE_CALL="$UDEVSETTLE settle --timeout=10"
-fi
+UDEVSETTLE=udevadm
+UDEVSETTLE_CALL="$UDEVSETTLE settle --timeout=10"
SYSFSDIR=$(cat /proc/mounts|awk '$3=="sysfs"{print $2; exit}')
CCWGROUPBUS_DIR=$SYSFSDIR/bus/ccwgroup
CCWDEV_DIR=$SYSFSDIR/bus/ccw/devices
@@ -261,6 +255,35 @@ function lookup_lan_layer()
#==============================================================================
+function prepare_udevsettle_cmd()
+{
+ # is the command available in $PATH
+ if ! [ -x "$(command -v $UDEVSETTLE)" ]
+ then
+ # check the well known locations.
+ if [ -e "/sbin/udevadm" ]
+ then
+ UDEVSETTLE=/sbin/udevadm
+ UDEVSETTLE_CALL="$UDEVSETTLE settle --timeout=10"
+ elif [ -e "/usr/bin/udevadm" ]
+ then
+ UDEVSETTLE=/usr/bin/udevadm
+ UDEVSETTLE_CALL="$UDEVSETTLE settle --timeout=10"
+ elif [ -e "/sbin/udevsettle" ]
+ then
+ # Fallback to udevsettle
+ UDEVSETTLE=/sbin/udevsettle
+ UDEVSETTLE_CALL="$UDEVSETTLE --timeout=10"
+ else
+ UDEVSETTLE=""
+ UDEVSETTLE_CALL=""
+ echo "Failed to find any candidate for udevsettle"
+ fi
+ fi
+}
+
+#==============================================================================
+
function lookup_type_and_lan_or_vswitch_name()
{
local DEVNO="$1"
@@ -506,8 +529,9 @@ function wait_for_net_device()
local CMD_FINDNETLINK="find $CCWGROUPBUS_DEVICEDIR/$CCWGROUPDEVNO/ -type l -name net*"
local LINKNAME=""
+ prepare_udevsettle_cmd
# polling loop to wait for net device to become available
- if [ -e $UDEVSETTLE ]
+ if [ "$UDEVSETTLE" != "" ]
then
$UDEVSETTLE_CALL
fi
--
2.26.2