From 0adbb5fde061b12c5b3749d330c05f71947df7f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 15:36:24 +0000 Subject: [PATCH] Improve network initialization error handling - Add proper status checking for interface up operation - Use udhcpc -b flag for proper daemonization instead of background operator - Add warning message if interface fails to come up - Improves reliability of network initialization process Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- scripts/setup_rootfs.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/setup_rootfs.sh b/scripts/setup_rootfs.sh index bb7a012..7146b1f 100755 --- a/scripts/setup_rootfs.sh +++ b/scripts/setup_rootfs.sh @@ -171,11 +171,16 @@ ip link set lo up 2>/dev/null || ifconfig lo up 2>/dev/null for iface in eth0 enp0s3 enp0s8 ens33; do if ip link show "$iface" >/dev/null 2>&1; then echo "Bringing up $iface..." - ip link set "$iface" up 2>/dev/null || ifconfig "$iface" up 2>/dev/null - # Try to get IP via DHCP using busybox udhcpc - if command -v udhcpc >/dev/null 2>&1; then - udhcpc -i "$iface" -q -n -t 5 2>/dev/null & + # Bring up the interface + if ip link set "$iface" up 2>/dev/null || ifconfig "$iface" up 2>/dev/null; then + # Try to get IP via DHCP using busybox udhcpc + if command -v udhcpc >/dev/null 2>&1; then + # Run udhcpc in background, it will daemonize itself + udhcpc -i "$iface" -b -t 5 2>/dev/null + fi + else + echo "Warning: Failed to bring up $iface" fi break fi