
On Fri, Jan 08, 2021 at 03:50:58PM +0800, Liu Yinsi wrote:
[error] LKP: HOSTNAME vm-8p64g.2288hv5-2s44p-384g--b5-3554212, MAC , IP , kernel 5.9.0-5-riscv64 1, serial console /dev/ttyS0
[why] root@vm-8p64g /sys/class/net# ls */operstate docker0/operstate eth0/operstate lo/operstate vethf90a0ad/operstate root@vm-8p64g /sys/class/net# ls */carrier docker0/carrier eth0/carrier lo/carrier vethf90a0ad/carrier
Please be more exact and show the content of operstate, carrier files. Let's see what exactly goes wrong. If it's only docker0 and veth*, we may skip it like how we skip lo: [ "${i#*/lo/}" != "$i" ] && continue Thanks, Fengguang
one qemu may have serial net interfaces in /sys/class/net, just one is 'up' or '1' means network is ok, it will not sleep and directly run function export_ip_mac(), but actually eth0 not ready, it can't get mac and ip, so use ping can ensure save enough time for eth0.
Signed-off-by: Liu Yinsi <liuyinsi@163.com> --- lib/bootstrap.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/lib/bootstrap.sh b/lib/bootstrap.sh index b04ea3dd4..df25e99e0 100755 --- a/lib/bootstrap.sh +++ b/lib/bootstrap.sh @@ -87,13 +87,7 @@ net_devices_link()
network_ok() { - local i - for i in /sys/class/net/*/ - do - [ "${i#*/lo/}" != "$i" ] && continue - [ "$(cat $i/operstate)" = 'up' ] && return 0 - [ "$(cat $i/carrier 2>/dev/null)" = '1' ] && return 0 - done + ping -c 3 $LKP_SERVER > /dev/null && return 0
is_clearlinux && { net_devices_link up -- 2.23.0