Skip to content

Commit

Permalink
fix(qeth_rules): check the existence of /sys/devices/qeth/*/online be…
Browse files Browse the repository at this point in the history
…forehand

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.

(Cherry-picked commit: 04fd4f0139c25e6f3846e759de15ac80ec807887)

Resolves: RHEL-17239
  • Loading branch information
coiby authored and pvalena committed Jan 15, 2024
1 parent d28f911 commit 143ab64
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules.d/95qeth_rules/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ check() {

[[ $hostonly ]] && {
for i in /sys/devices/qeth/*/online; do
read _online < $i
[ $_online -eq 1 ] && return 0
done
[ ! -f "$i" ] && continue
read -r _online < "$i"
[ "$_online" -eq 1 ] && return 0
done
}
return 255
}
Expand Down

0 comments on commit 143ab64

Please sign in to comment.