How to modify WIFI driver or /etc/init.d/network to decrease boot time?

Hello,
I'm using VOCORE2, there I'm running OpenWRT, So now I want to reduce the boot time, for that, I'm trying to modify the wifi driver or /etc/init.d/network file.

Can anyone give tips on how to modify these files?

What is the current issue with the boot time? You've opened a number of topics which all ask essentially the same question, with a slight variation on which part of the system you want to 'modify'.

So what exactly are you trying to achieve? How long is the boot time now? How long do you think it should be? Why do you think it's being slowed down by the wifi driver or the network config file?

5 Likes

present my boot time is 30.078400 sec
This is the dmesg output

[   23.090706] tssi_1_target_pwr_g_band = 25
[   28.769420] <==== rt28xx_init, Status=0
[   28.787720] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   30.057201] br-lan: port 2(ra0) entered blocking state
[   30.062624] br-lan: port 2(ra0) entered disabled state
[   30.068314] device ra0 entered promiscuous mode
[   30.073065] br-lan: port 2(ra0) entered blocking state
[   30.078400] br-lan: port 2(ra0) entered forwarding state

and this is logread

Thu Jun 27 12:20:22 2019 kern.warn kernel: [   23.090706] tssi_1_target_pwr_g_band = 25
Thu Jun 27 12:20:22 2019 user.notice ucitrack: Setting up /etc/config/firewall reload dependency on /etc/config/miniupnpd
Thu Jun 27 12:20:23 2019 user.notice ucitrack: Setting up /etc/config/dhcp reload dependency on /etc/config/odhcpd
Thu Jun 27 12:20:23 2019 user.notice ucitrack: Setting up non-init /etc/config/fstab reload handler: /sbin/block mount
Thu Jun 27 12:20:23 2019 user.notice ucitrack: Setting up /etc/config/system reload trigger for non-procd /etc/init.d/led
Thu Jun 27 12:20:23 2019 user.notice ucitrack: Setting up /etc/config/system reload dependency on /etc/config/luci_statistics
Thu Jun 27 12:20:23 2019 user.notice ucitrack: Setting up /etc/config/system reload dependency on /etc/config/dhcp
Thu Jun 27 12:20:24 2019 daemon.notice procd: /etc/rc.d/S96led: setting up led wifi
Thu Jun 27 12:20:28 2019 kern.warn kernel: [   28.769420] <==== rt28xx_init, Status=0

From dmesg can you see
[ 23.090706] tssi_1_target_pwr_g_band = 25
[ 28.769420] <==== rt28xx_init, Status=0

here it is taking too much time, rt28xx driver for WIFI device, it is running even its not enabled,
inside my .config file you can see I did not enabled anything

# CONFIG_TARGET_ramips_rt288x is not set
# CONFIG_PACKAGE_rt2800-pci-firmware is not set
# CONFIG_PACKAGE_rt2800-usb-firmware is not set
# CONFIG_PACKAGE_kmod-rt2800-pci is not set
# CONFIG_PACKAGE_kmod-rt2800-usb is not set

and if you check this https://vocore.io/v2u.html once, here processor used in vocore is MT7628, it comes with WLAN but in vocore they additionally added wireless support.

So, I thinking to reduce boot time by removing extra wireless support or modifying its wifi driver.
I want to decrease it to 20sec.

@krazeh Can we enable Falcon mode in openwrt

there's something else you could try: Increase the NOR's IO-Speed. This would help with "everything" as from what I know, the devices are usually waiting for data from the flash on bootup. And from what I can tell dts/mt7628an_vocore_vocore2.dtsi sets the spi-max-freq to (just) 10MHz.

        flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;

Check out the NOR-chip's datasheet for the speeds it supports (>=133MHz - though maybe not supported). I've seen other MT7628an that set the spi-max-frequency up to 86Mhz. Also some NOR-chips support fast-reads - there's a device-tree property for that.

Just slowly bump up the speed and test if it is still working for you.

1 Like

You can remove the wifi drivers from the kernel if not using wireless. I think these are read from /lib/modules not compiled into the kernel.

Building your configuration into an initramfs would have everything read from flash in one blob at boot-up. The bootloader would do this so OpenWrt's flash driver really isn't an issue.

1 Like

@mk24 but I need wifi

Your previous posts seem to indicate you do not need wifi or have disabled it...

Anyway, i do not think there is a magical solution to decrease boot time just like that, or it would have been done before.

I would disable anything I do not need, review the boot messages, see where it is spending the most time, dig into the code, ...

@eduperez I don't need ethernet but need wifi, so I just removed ethernet in dts file.

thanks @chunkeey it really worked, it reduced around 600ms

You still didn’t answer why boot time is a problem. Why do you want it to be shorter?

This is a router, why are you turning it on and off continually? I’d expect you to corrupt the spi or nand doing constant reboots.