]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(qeth_rules): check the existence of /sys/devices/qeth/*/online beforehand
authorCoiby Xu <coxu@redhat.com>
Wed, 14 Jul 2021 07:26:10 +0000 (15:26 +0800)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 14 Jul 2021 12:46:23 +0000 (12:46 +0000)
On s390x KVM machines, the follow errors occurred,
    $ kdumpctl rebuild
    kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory

because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.

modules.d/95qeth_rules/module-setup.sh

index 914a28ce83c66c40cebf352541929a4637f8c086..884ae072e4c0424cc5872c9dbb52e3d12b259323 100755 (executable)
@@ -10,6 +10,7 @@ check() {
 
     [[ $hostonly ]] && {
         for i in /sys/devices/qeth/*/online; do
+            [ ! -f "$i" ] && continue
             read -r _online < "$i"
             [ "$_online" -eq 1 ] && return 0
         done