WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Time saving during boot: skip unconnected interfaces  (Read 179 times)

Offline pedro.prado

  • Newbie
  • *
  • Posts: 2
Time saving during boot: skip unconnected interfaces
« on: March 22, 2025, 06:11:27 AM »
This example shows which interfaces have no carrier (no cable) and thus can be skipped during bootup - dhcp can be skipped for those to save precious miliseconds :)

Code: [Select]
for x in `ls /sys/class/net/`; do echo $x `cat /sys/class/net/$x/carrier | sed -e s/0/down/ -e s/1/up/`; done

eth0 down
lo up
wlan0 up

I don't have eth0 connected so it could be totally skipped instead of waiting for udhcpc trying to get an ip through it.
Could someone point where in the boot scripts is the code to try to get an IP?

Pedro Prado

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 335
Re: Time saving during boot: skip unconnected interfaces
« Reply #1 on: March 22, 2025, 06:35:36 AM »
In /etc/init.d/dhcp.sh, however it runs in the background so it shouldn't slow down boot time significantly anyway.

Offline pedro.prado

  • Newbie
  • *
  • Posts: 2
Re: Time saving during boot: skip unconnected interfaces
« Reply #2 on: March 22, 2025, 11:23:27 AM »
In /etc/init.d/dhcp.sh, however it runs in the background so it shouldn't slow down boot time significantly anyway.

Yeap indeed. I did add a test to skip over eth0, but when I rebooted, it turns out it wasn't even trying anything on eth0... (and I discovered that it's all ramfs of course :) )

The boot hangs a bit getting a DHCP address on wlan0, actually. While it can already be as fast as possible, I would like to investigate a bit...

Do you know what's the script doing the "Starting WiFi on wlan0..." ?

Thanks,
Pedro

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11982
Re: Time saving during boot: skip unconnected interfaces
« Reply #3 on: March 22, 2025, 12:37:09 PM »
Hi pedro.prado
Welcome to the forum.

... Do you know what's the script doing the "Starting WiFi on wlan0..." ?
Assuming that message is accurate (spelling, punctuation, capitalization) you
should be able to find the source:
Code: [Select]
sudo grep -rsl "Starting WiFi" /usr/bin/*
sudo grep -rsl "Starting WiFi" /usr/local/bin/*
sudo grep -rsl "Starting WiFi" /usr/sbin/*
sudo grep -rsl "Starting WiFi" /usr/local/sbin/*

You also don't state where you see this message. Terminal? dmesg?
It might even be coming from a driver.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1345
Re: Time saving during boot: skip unconnected interfaces
« Reply #4 on: March 22, 2025, 05:32:20 PM »
Some dhcp servers are very slow to respond, since the ones I have respond quickly, I cannot ever find a solution with busybox’s udhdpc.

Running a full dhcp client may help.   Extension dhcp.tcz

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 335
Re: Time saving during boot: skip unconnected interfaces
« Reply #5 on: March 23, 2025, 02:23:22 AM »
Do you know what's the script doing the "Starting WiFi on wlan0..." ?

Do you mean wifi.sh (from wifi.tcz)? WiFi initialisation is usually a bit slow for me too, although I only use it on a slow old PC so that might be the problem there. I guess you set it to start at boot time?