f226d6
From eff17c61ba358d03461b62c95ef593e3b8d65e26 Mon Sep 17 00:00:00 2001
f226d6
From: Coiby Xu <coxu@redhat.com>
f226d6
Date: Wed, 14 Jul 2021 15:26:10 +0800
f226d6
Subject: [PATCH] fix(qeth_rules): check the existence of
f226d6
 /sys/devices/qeth/*/online beforehand
f226d6
f226d6
On s390x KVM machines, the follow errors occurred,
f226d6
    $ kdumpctl rebuild
f226d6
    kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
f226d6
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
f226d6
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
f226d6
f226d6
because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
f226d6
doesn't exist. Eliminate this error by checking the existence
f226d6
beforehand.
f226d6
f226d6
(cherry picked from commit 6c71ba4121ae64ccd13fefba68ca327ac623810f)
f226d6
f226d6
Resolves: #2050570
f226d6
---
f226d6
 modules.d/95qeth_rules/module-setup.sh | 1 +
f226d6
 1 file changed, 1 insertion(+)
f226d6
f226d6
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
f226d6
index 914a28ce..884ae072 100755
f226d6
--- a/modules.d/95qeth_rules/module-setup.sh
f226d6
+++ b/modules.d/95qeth_rules/module-setup.sh
f226d6
@@ -10,6 +10,7 @@ check() {
f226d6
 
f226d6
     [[ $hostonly ]] && {
f226d6
         for i in /sys/devices/qeth/*/online; do
f226d6
+            [ ! -f "$i" ] && continue
f226d6
             read -r _online < "$i"
f226d6
             [ "$_online" -eq 1 ] && return 0
f226d6
         done
f226d6