Tiny Core Base > TCB Talk

Time saving during boot: skip unconnected interfaces

(1/2) > >>

pedro.prado:
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: ---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

--- End code ---

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

CNK:
In /etc/init.d/dhcp.sh, however it runs in the background so it shouldn't slow down boot time significantly anyway.

pedro.prado:

--- Quote from: CNK 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.

--- End quote ---

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

Rich:
Hi pedro.prado
Welcome to the forum.


--- Quote from: pedro.prado on March 22, 2025, 11:23:27 AM --- ... Do you know what's the script doing the "Starting WiFi on wlan0..." ?
--- End quote ---
Assuming that message is accurate (spelling, punctuation, capitalization) you
should be able to find the source:

--- Code: ---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/*
--- End code ---

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

Paul_123:
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

Navigation

[0] Message Index

[#] Next page

Go to full version