That did it, I can now ssh in via usb. Wahoo I 'm now a Linux kernel developer, fame and fortune awaits.
Thank you very much!
That did it, I can now ssh in via usb. Wahoo I 'm now a Linux kernel developer, fame and fortune awaits.
Thank you very much!
I have taken a couple of seconds off the kernel boot time now. Also removed about 10 services by stop, disable and removing their file from /etc/systemd/system and /usr/lib/systemd/system also used apt remove where needed. according to the svg plot the rest of the services take minimal time to execute.
Now I need to reduce the userspace boot time. Userspace is taking 25.6 seconds.
I had boot time issues with 11.8 kernel 5.10.168-ti-r71. Not sure which kernel is in image you are using.
I found this patch to kernel saved 6 seconds in booting.
https://patchwork.kernel.org/project/linux-acpi/cover/20201121020232.908850-1-saravanak@google.com/#23791353
Thank you for that link. I have no idea how to get it though. Is that for buildroot or guys who are compiling their own Linux from source? Looks to me like they are compiling their own.
Yes I had to rebuild the kernel from source with that patch. I have an image here if you want to see if it does anything for you.
http://www.pdp8online.com/mfm/revb/software.shtml
I cross compiled on Fedora. I can give you the build tree also if useful.
Thank you again, it is very helpful. I would like to see your build tree too. I am new at this and I very much want to learn how to build my own Linux kernel for the BBB. Learning from others is great, maybe someday I can contribute back some knowledge.
Looks like I started with kernel 5.10.168-ti-rt-r74.tar.gz
My cryptic notes on building the kernel
https://www.pdp8online.com/misc/kernel-build. I donāt do this often so this was looking at web pages until I found something that worked.
Tree here
https://www.pdp8online.com/misc/patched-linux-5.10.168-ti-r74.tgz
Sorry for slow response but life is busy right now.
Iāve managed to significantly reduce the boot time on my BeagleBone Black, following the steps from the discussion in this forum, but Iām still looking to optimize it further. Currently, my boot time is 23.655s, and here are the changes Iāve made:
ls /boot/initrd.img-*
to list and then removed unnecessary kernel images with rm
from the /boot directoryā¦Iām using the BeagleBoard.org Debian Bullseye Minimal Image 2023-10-07.
My current setup shows 2.739s (kernel) and 20.915s (userspace) boot times. However, what else can I tweak to further reduce this boot time? Are there any additional services I could disable or configurations I should review to optimize further?
Thanks in advance for any suggestions or recommendations.
How fast do you want to boot and what do you really need ?
If the kernel is booing in 2.74s your software could be running then.
On the kernel boot args you can do init=/path_to_your_exe and run that rather than the default init
But if you are depending on services running that is probably not a good idea.
Depending on the work you want to put in, you could try going down the buildroot path.
If you build a minimal busybox image with nothing running you can get some idea how fast it is possible to boot.
You can use SYSV init rather than systemd (it is pretty easy to specify different init systems). You might find you can shave of some time doing that. It can also be easier to modify and as you seem to be disabling a lot of stuff might give you a quicker boot.
To be honest, I would like it to be as fast as possible; if itās under 10 seconds, thatās already acceptable. Essentially, the system automatically runs a PyQt file at startup, so the boot time needs to be as short as possible without compromising that functionality.
I was able to get boot time down to about 25 seconds with services needed for communication, display and running the custom software. I never got a Buildroot image to run as the 25s was fast enough for my customer. Buildroot requires a lot of time to learn to get an image to boot and run, at least for me. I got a Yacto build to complete but it did not run either. I can see a market for fast boot time for a BBB in an embedded application.
Have a Blessed day and new year!
Don
Core image minimal in Yocto is a very fast boot.
What do you recommend, Yocto or Buildroot? I donāt have much experience with either. It seems that the images provided by the manufacturers, even though minimal, include packages to support basic use. Also, Iām looking for pre-made minimal images in Buildroot, but there doesnāt seem to be much available from what Iāve searched so far.
personally I prefer buildroot because it is what I am used to. Think the learning curve for Yocto is much steeper.
For buildroot to start is as simple as downloading the tar file to a linux machine, unpack it
cd into the directory and then if you have ever built the linux kernel it is pretty similar
you can do make beaglebone_defconfig follwed by make
then go and make a cup of coffee because it will take a while
That should build a minimal image approx 50MB I think.
In the output/images directory you should have an image file that you can copy to an sd-card.
To add/change stuff run make menuconfig. Take a while and browse through all of the various menus.
It is all menu driven to select packages. Be aware that some stuff can be hidden if it depends on items you are not including.
@Martin_Rosso
Yes, it is.
We use it because the same packages can be used across multiple systems, from bbb to intel I7 boards. However, if you donāt have a need for that the time involved with finding all the little things that trip you up is not worth the effort. As for buildroot, we donāt use it so I cannot comment on it. As @benedict.hewson states, it might be a simpler solution.
If you remove systemd and everything that is not needed you will have done as much as possible. Not using systemd is not a good idea. Also, booting from SD is very slow.
root@beaglebone:~# systemd-analyze
Startup finished in 4.377s (kernel) + 13.162s (userspace) = 17.539s
multi-user.target reached after 11.884s in userspace
root@beaglebone:~# systemd-analyze blame
12.115s dev-mmcblk0p2.device
5.183s systemd-udev-trigger.service
2.947s systemd-timesyncd.service
2.508s systemd-resolved.service
1.915s systemd-networkd.service
1.793s systemd-logind.service
1.565s systemd-journald.service
1.226s systemd-udevd.service
1.149s user@0.service
1.135s sync-clocks.service
1.035s ldconfig.service
955ms modprobe@fuse.service
943ms modprobe@drm.service
923ms modprobe@configfs.service
882ms systemd-modules-load.service
864ms sys-kernel-debug.mount
860ms sys-kernel-tracing.mount
858ms tmp.mount
857ms dev-mqueue.mount
850ms systemd-network-generator.service
795ms systemd-remount-fs.service
755ms systemd-journal-catalog-update.service
563ms systemd-tmpfiles-setup.service
502ms sys-fs-fuse-connections.mount
486ms systemd-update-utmp.service
480ms systemd-userdbd.service
409ms sys-kernel-config.mount
367ms dbus.service
279ms systemd-sysctl.service
262ms systemd-random-seed.service
243ms systemd-sysusers.service
231ms media-ram.mount
220ms systemd-update-utmp-runlevel.service
206ms systemd-update-done.service
203ms systemd-tmpfiles-setup-dev.service
200ms var-volatile.mount
This is Tiās arago build, based on core-image-minimal yocto. That is even on SD card, when I get closer to where it needs to be I will plant it in emmc.
Thatās not bad timing. Could you point me to where I can find or download the minimal Arago image?
You will have to build it in Tiās Yocto. As typical TI the current SDK instructions have not been tested to see if they are correct. If you decide to go that direction I will look for my notes and what had to be fixed. Once you get it set up it works very well.
FYI, you will need 400Gb of NVMe space, and set your swap on NVMe to 60Gb and if you have less than 32Gb of ram you will have to bump that up to possibly 100Gb.
root@beaglebone-ai64:~# systemd-analyze
Startup finished in 5.762s (kernel) + 5.394s (userspace) = 11.157s
multi-user.target reached after 4.161s in userspace.
root@beaglebone-ai64:~#
You can even take 2 more seconds off of that, grub hangs for 2 seconds so that is about 9s boot.
ai-64 on arago.
Do you recommend this SDK āPROCESSOR-SDK-AM335X Software development kit (SDK) | TI.comā for creating my minimal image with Arago?