BeagleBone Black Boot optimization

Hello everyone,

I’m using the latest IoT images for the BBB and noticed that the bootup time from the eMMC is very slow. it takes ~1.5min for the USB gadget network interface to appear under Linux.

What can I do to improve the startup performance of the BBB?

So far I have disabled auto for the eth0 interface.

sudo nano /etc/network/interfaces
allow-hotplug eth0

Moreover, I have disabled graphical boot.

systemctl set-default multi-user.target
systemctl get-default

Still very slow is the generic-board-startup.service

1min 53.980s dev-mmcblk1p1.device
1min 50.627s generic-board-startup.service
4.208s ModemManager.service
4.106s systemd-udev-trigger.service
2.366s networking.service
2.032s NetworkManager.service
1.973s capemgr.service
1.838s systemd-journald.service
1.809s pppd-dns.service
1.579s dnsmasq.service
1.486s rsyslog.service
1.098s avahi-daemon.service
920ms systemd-logind.service
856ms systemd-udevd.service
845ms bb-wl18xx-wlan0.service
737ms sys-fs-fuse-connections.mount
730ms ssh.service
724ms systemd-sysctl.service
719ms systemd-timesyncd.service
651ms sys-kernel-debug.mount
604ms systemd-update-utmp.service
592ms dev-mqueue.mount
559ms sys-kernel-config.mount
493ms systemd-remount-fs.service
458ms polkit.service
448ms systemd-user-sessions.service
414ms systemd-tmpfiles-setup-dev.service
413ms systemd-tmpfiles-setup.service
360ms systemd-random-seed.service
359ms systemd-journal-flush.service
319ms systemd-modules-load.service
319ms kmod-static-nodes.service
225ms systemd-update-utmp-runlevel.service
168ms bb-wl18xx-bluetooth.service

I noticed that SSH key regeneration takes ~15s at boot. However, when I removed /etc/ssh/ssh.regenerate USB networking did not work anymore.

What else can I do to make the BBB boot faster?

Could you post your dmesg log?

This is only an issue on first boot, as the keys are only generated once.

Use the v4.14.x based kernel.

As I’ve spent some time building in and disabling unneeded modules.

Regards,

I need an RT kernel, so 4.14 does not work for me, yet.

Are there any improvements with 4.9 over 4.4?

Rt just came out for v4.14

https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/

I’ll have something later tonight, when my plane lands.

Nice, thanks!

Interesting, I noticed that my ssh keys where regenerated at every single boot thanks to a wrong sshd_config.

However, after fixing this problem, my usb0 interface does not connect anymore.

That 4.14 kernal definitely improved the boot times compared to what I was seeing and what I posted here: https://github.com/RobertCNelson/boot-scripts/issues/10

However, I am still getting a boot time of close to a minute (~32 seconds for both dev-mmcblk1p1.device and generic-board-startup.service).

`

systemd-analyze

Startup finished in 21.569s (kernel) + 37.032s (userspace) = 58.602s

systemd-analyze blame

32.599s dev-mmcblk1p1.device
31.957s generic-board-startup.service
3.137s systemd-udev-trigger.service
2.602s loadcpufreq.service
2.090s networking.service
1.638s ssh.service
1.542s connman.service
1.385s systemd-logind.service
1.196s systemd-journald.service
1.164s avahi-daemon.service
1.158s udhcpd.service
841ms dnsmasq.service
833ms pppd-dns.service
786ms bb-wl18xx-wlan0.service
623ms cpufrequtils.service
536ms systemd-timesyncd.service
497ms rsyslog.service
445ms wpa_supplicant.service
416ms systemd-random-seed.service
367ms systemd-udevd.service
350ms kmod-static-nodes.service
333ms systemd-modules-load.service
314ms systemd-sysctl.service
311ms systemd-user-sessions.service
311ms hostapd.service
304ms systemd-update-utmp.service
303ms sys-kernel-debug.mount
301ms sys-kernel-config.mount
297ms systemd-remount-fs.service
275ms systemd-tmpfiles-setup.service
248ms systemd-journal-flush.service
220ms media-sd.mount
206ms systemd-tmpfiles-setup-dev.service
191ms sys-fs-fuse-connections.mount
185ms user@0.service

`

Can anything be done to really trim down the boot time to be not much more than the kernel boot time? And what does one sacrifice in doing so? A 30 second boot would be great. This 60 boot isn’t too bad, either, of course, thanks for your work on that kernel 4.14.