4 of 4 people found this helpful
I haven't looked into all the things the BBB does during boot, but as a general trick to reduce the boot time on Linux you can check how long the boot takes with systemd-analyze. When I do this on the BBB I found that it takes 39 seconds to finish booting.
$ systemd-analyze critical-chain The time after the unit is active or started is printed after the "@" character. The time the unit takes to start is printed after the "+" character. graphical.target @39.525s └─multi-user.target @39.519s └─getty.target @39.187s └─serial-getty@ttyGS0.service @39.154s └─dev-ttyGS0.device @39.137s
So you can see that starting ttyGS0 took 39 seconds, there's also a web server running on the virtual USB network interface. Use systemctl status to list all services on your system.
When I disable the bonescript-autorun service I reach graphical.target in 27 seconds, so that's 12 seconds shaved off the boot time (don't worry about it being called graphical target, if you're using the IoT image there's no GUI)
$ sudo systemctl disable bonescript-autorun.service
When I also disable the web server nginx it doesn't shave off any time on boot. This is because services are starting even after the login prompt is visible.
$ sudo systemctl disable nginx.service
So I don't think DHCP being accessible would be related to the "long" boot time. Then what's taking up so much time? Well, we can check everything that has to be started before multi-user.target is reached.
$ systemctl list-dependencies multi-user.target
It will show a long list, some of those things are not enabled or running so you'll have to do some research into what you can disable. I choose two I didn't think was needed:
$ sudo systemctl disable bb-bbai-tether.service $ sudo systemctl disable serial-getty@ttyGS0.service # this is a generated symlink, so it need to be masked to be disabled $ sudo systemctl mask serial-getty@ttyGS0.service # this will create a symlink to /dev/null, disabling it forever
End result of just disabling services?
$ systemd-analyze critical-chain The time after the unit is active or started is printed after the "@" character. The time the unit takes to start is printed after the "+" character. graphical.target @15.297s └─multi-user.target @15.292s └─getty.target @15.070s └─serial-getty@ttyS0.service @15.054s └─dev-ttyS0.device @15.026s
Enjoy your extra 15 seconds of free time. I'll just end with this:
$ systemd-analyze Startup finished in 8.227s (kernel) + 15.522s (userspace) = 23.749s
Unpacking the kernel takes a few seconds and disabling services might break things. I'm not taking any responsibility if disabling services breaks your system.
Who is that guy
You are my hero!
Very detailed and very helpful.
Your instructions gave me some hints where to look further and finally I've got my network running as I want and it takes 18s to come up.
very very nice.
It can possible in pinnless system in motherboard
Beaglebone black official debian 10 image.
I try do get rid of some (for my project not needed) stuff that bbb does at startup.
Here is what I need:
TTY and getty on the debug UART connector
GPIOs and config-pin
Ethernet on the RJ45 connector
a running DHCP
What is bad with actual config is the long boot time.
Over a minute, trying to configure all that USB stuff I don't need.
USB0 and USB1 Ethernet interface, ttyG...
I was happy to find /etc/default/bb-boot and commented out USB_NETWORK . . .
Next boot was not much faster, but no USB0 and USB1 Ethernet interfaces, huu happy, 1 step done a few more to go
One or two boots later and those interfaces were back again, and of course edit made in /etc/default/bb-boot has magically gone away.
I was very closed to throw the bbb out of the window.
Please anyone can give me a hint what and where to look and edit to make the bbb work with that stuff I need as named above.