fix(qeth_rules): check the existence of /sys/devices/qeth/*/online beforehand

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.
master
Coiby Xu 2021-07-14 15:26:10 +08:00 committed by Jóhann B. Guðmundsson
parent a0f12fb6a0
commit 6c71ba4121
1 changed files with 1 additions and 0 deletions

View File

@ -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