Boot Optimization

Hello everyone,

I would like to reduce my boot time for the beaglebone. It currently takes about 30 seconds for it to boot, and I will be using all 3 usb gadgets.

My version output:

debian@beaglebone:~$ sudo /opt/scripts/tools/
[sudo] password for debian:
dogtag:[ Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-dirty]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-bonegreen.dts]
/boot/uEnv.txt Settings:
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait]
dmesg | grep remote
[ 2.659539] remoteproc remoteproc0: wkup_m3 is available
[ 2.940239] remoteproc remoteproc1: is available
[ 2.952601] remoteproc remoteproc2: is available
[ 2.967349] remoteproc remoteproc0: powering up wkup_m3
[ 2.970564] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 2.971292] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
[ 2.940239] remoteproc remoteproc1: is available
[ 2.940546] pru-rproc PRU rproc node /ocp/interconnect@4a000000/segment@0/target-module@300000/pruss@0/pru@34000 probed successfully
[ 2.952601] remoteproc remoteproc2: is available
[ 2.952904] pru-rproc PRU rproc node /ocp/interconnect@4a000000/segment@0/target-module@300000/pruss@0/pru@38000 probed successfully
dmesg | grep pinctrl-single
[ 2.203986] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 2.207001] gpio-of-helper ocp:cape-universal: ready
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

systemd-analyze output

debian@beaglebone:~$ systemd-analyze blame
33.892s generic-board-startup.service
13.769s dnsmasq.service
8.988s lighttpd.service
7.115s php7.3-fpm.service
5.648s loadcpufreq.service
2.141s systemd-logind.service
1.774s wpa_supplicant.service
1.649s user@1000.service
1.578s systemd-journald.service
1.541s cpufrequtils.service
1.493s networking.service
1.102s systemd-timesyncd.service
1.094s systemd-fsck-root.service
954ms systemd-user-sessions.service
777ms kmod-static-nodes.service
763ms fake-hwclock.service
751ms systemd-tmpfiles-setup.service
691ms dev-mqueue.mount
655ms ifupdown-pre.service
653ms rsyslog.service
596ms systemd-udevd.service
591ms systemd-update-utmp.service
587ms systemd-modules-load.service
470ms user-runtime-dir@1000.service
457ms systemd-journal-flush.service
429ms sys-kernel-debug.mount
405ms systemd-sysusers.service
401ms sys-fs-fuse-connections.mount
392ms connman.service
377ms systemd-sysctl.service
363ms systemd-random-seed.service
311ms systemd-remount-fs.service
293ms sys-kernel-config.mount
183ms systemd-tmpfiles-setup-dev.service
165ms systemd-update-utmp-runlevel.service

Just to specify- it looks like is causing the long boot time. What can I modify in the script to drastically reduce the 30 second time?

You can disable it, but the big delay in that script is loading the
usb gadget drivers.. Which you stated you wanted..