From 3b4df2455b072103339913aa67beca64bed89f67 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Wed, 30 Jun 2021 09:20:09 +0800 Subject: [PATCH] check the existence of /sys/bus/ccwgroup/devices before trying to find online network device Resolves: bz1977543 Upstream: Fedora Conflict: None commit 03f9b91351fcd245e8d9327c38de296f818ad115 Author: Coiby Xu Date: Mon Jun 28 18:37:10 2021 +0800 check the existence of /sys/bus/ccwgroup/devices before trying to find online network device /sys/bus/ccwgroup/devices doesn't exist for non-s390x machines which leads to the warning "find: '/sys/bus/ccwgroup/devices': No such file or directory". This warning can be eliminated by checking the existence of "/sys/bus/ccwgroup/devices" beforehand. Fixes: commit 7d472515688fb330eee76dac1c39ae628398f757 ("Iterate /sys/bus/ccwgroup/devices to tell if we should set up rd.znet") Reported-by: Ruowen Qin BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1974618 Signed-off-by: Coiby Xu Acked-by: Kairui Song Signed-off-by: Coiby Xu --- dracut-module-setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index eac883f..fc62060 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -467,7 +467,9 @@ kdump_setup_vlan() { find_online_znet_device() { local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices" local NETWORK_DEVICES d ifname ONLINE - NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR -type l) + + [ ! -d "$CCWGROUPBUS_DEVICEDIR" ] && return + NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR) for d in $NETWORK_DEVICES do read ONLINE < $d/online