aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCoiby Xu <coxu@redhat.com>2021-07-14 15:26:10 +0800
committerJóhann B. Guðmundsson <johannbg@gmail.com>2021-07-14 12:46:23 +0000
commit6c71ba4121ae64ccd13fefba68ca327ac623810f (patch)
treeefde5f455b854bd987efa3fa43dae1172d3227bc
parenta0f12fb6a09b09f35ab28753d7c4461c10a8b562 (diff)
downloaddracut-6c71ba4121ae64ccd13fefba68ca327ac623810f.tar.gz
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.
-rwxr-xr-xmodules.d/95qeth_rules/module-setup.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules.d/95qeth_rules/module-setup.sh b/modules.d/95qeth_rules/module-setup.sh
index 914a28ce..884ae072 100755
--- a/modules.d/95qeth_rules/module-setup.sh
+++ b/modules.d/95qeth_rules/module-setup.sh
@@ -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