s390-tools/s390-tools-sles15sp2-lsluns-try-harder-to-find-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

60 lines
2.0 KiB
Diff

From e679a4002ecea6d8177430d6efde2b3ef2b89d0e Mon Sep 17 00:00:00 2001
From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Wed, 13 May 2020 18:19:35 +0200
Subject: [PATCH] lsluns: try harder to find udevadm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Hard-coding udevadm's location isn't robust enough - for instance,
Ubuntu 20.04 moved it to /usr/bin.
First see if we can reach it through $PATH, then fall back to hard-coded
locations that we know about.
Also when finally falling back to udevsettle, check that it exists.
Otherwise we end up throwing tons of "No such file or directory" error
messages at the user.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Fedor Loshakov <loshakov@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
---
zconf/lsluns | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index bfe48f1..7144c78 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -24,13 +24,22 @@ my $wlun = "0xc101000000000000";
my $lun0 = "0x0000000000000000";
my $sg_dir = "/sys/class/scsi_generic";
my $udevsettle_call;
-my $udevadm = "/sbin/udevadm";
-if (! -e $udevadm) {
- $udevsettle_call = "/sbin/udevsettle";
+# See if we can find udevadm through $PATH:
+if (!system("udevadm --version > /dev/null 2>&1")) {
+ $udevsettle_call = "udevadm settle";
+# Search udevadm in well-known locations:
+} elsif (-e "/sbin/udevadm") {
+ $udevsettle_call = "/sbin/udevadm settle";
+} elsif (-e "/usr/bin/udevadm") {
+ $udevsettle_call = "/usr/bin/udevadm settle";
+# Fall back to udevsettle:
+} elsif (-e "/sbin/udevsettle") {
+ $udevsettle_call = "/sbin/udevsettle";
} else {
- $udevsettle_call = "$udevadm settle";
+ $udevsettle_call = "";
+ print "Failed to find any candidate for udevsettle.\n";
}
# read the first line of a sysfs-entry and compare it to a given string
--
2.26.2