
+ $LKP_DEBUG_PREFIX $LKP_SRC/bin/run-ipconfig + network_ok && return + local net_devices=$(get_net_devices) if [ -z "$net_devices" ]; then
The patch moved around the $net_devices test. What line of code will set $net_devices (or somehow affect its setting)? That fact will answer the question "why the move (hence this patch) helps"?
OMG! The real root reason is because of dash and the follow line: local net_devices=$(get_net_devices) Explain: 1. get_net_devices is a function, and it return " enp0s1", 2. in dash, local net_devices=$(get_net_devices) => local net_devices= enp0s1 => net_devices will be none! 3. test code: + local ycb= asf + echo ycb: : ycb: : Conclusion: We only need add double quote for the follow code to solve this problem: before: local net_devices=$(get_net_devices) after: local net_devices="$(get_net_devices)" -------- Thanks Yu Chuan
Thanks, Fengguang
@@ -181,9 +184,6 @@ setup_network() fi fi
- $LKP_DEBUG_PREFIX $LKP_SRC/bin/run-ipconfig - network_ok && return - local err_msg='IP-Config: Auto-configuration of network failed' dmesg | grep -q -F "$err_msg" || { # Include $err_msg in the error message so that it matches -- 2.23.0