From a19e595794d5ea5d8395907d89b02b66232351af Mon Sep 17 00:00:00 2001 From: Qubot <1445788683@qq.com> Date: Mon, 9 Nov 2026 10:18:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E5=8F=A3=E9=BB=98=E8=AE=A4up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../init-ifupdown/init_networking | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/source_sync_rls_25c/layers/meta-unisoc/recipes-core/init-ifupdown/init-ifupdown/init_networking b/source_sync_rls_25c/layers/meta-unisoc/recipes-core/init-ifupdown/init-ifupdown/init_networking index d590f1dce..4fc0455f6 100755 --- a/source_sync_rls_25c/layers/meta-unisoc/recipes-core/init-ifupdown/init-ifupdown/init_networking +++ b/source_sync_rls_25c/layers/meta-unisoc/recipes-core/init-ifupdown/init-ifupdown/init_networking @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh ### BEGIN INIT INFO # Provides: networking # Required-Start: mountvirtfs $local_fs @@ -56,21 +56,25 @@ check_network_swap() { } start_eth0_dhcp() { - local retry=0 - - while [ ! -d /sys/class/net/eth0 ] && [ $retry -lt 10 ]; do - sleep 1 - retry=$((retry + 1)) - done - - [ -d /sys/class/net/eth0 ] || return 0 - - ip link set eth0 up 2>/dev/null || ifconfig eth0 up 2>/dev/null || true - - if command -v udhcpc >/dev/null 2>&1 && - ! ps | grep "[u]dhcpc .*eth0" >/dev/null 2>&1; then - udhcpc -i eth0 -b -R >/dev/null 2>&1 & - fi + # eth0 and netcond are initialized asynchronously on this platform. + # Keep reasserting the link state during late boot so a delayed driver + # probe or netcond cannot leave the interface down. Addressing remains + # dynamic and is handled by udhcpc. + ( + retry=0 + while [ $retry -lt 60 ]; do + if [ -d /sys/class/net/eth0 ]; then + ip link set eth0 up >/dev/null 2>&1 || \ + ifconfig eth0 up >/dev/null 2>&1 || true + if command -v udhcpc >/dev/null 2>&1 && + ! ps | grep "[u]dhcpc .*eth0" >/dev/null 2>&1; then + udhcpc -i eth0 -b -R >/dev/null 2>&1 & + fi + fi + retry=$((retry + 1)) + sleep 2 + done + ) & } case "$1" in