3 ms·
"The new average is 107 ms smaller, which you are likely to consider as a worthy reduction, if you have experience with boot time reduction projects." Not real
by astrobe_ 2y ago
"The new average is 107 ms smaller, which you are likely to consider as a worthy reduction, if you have experience with boot time reduction projects."
Not really. The result is kind of a letdown and that was too be expected, going after a single memcpy is low ROI because memcpy performance is probably what processor and library makers look at first.
What wins big is to remove useless stuff entirely. The demo boards I have seen often come with a standard Debian with all the services one might want for a workstation. The kernel is usually the same, with drivers such as PS/2 mouse enabled - thankfully just as a module, but disabling the useless drivers wins big in kernel compilation time. Which makes optimizing the rest a bit more comfortable (some options such as hardening and debugging can nearly full recompilation).
While there, one can also build the drivers one always want inside the kernel (not as module). A module inside a compressed kernel is loaded faster than from somewhere in a filesystem.
That said, Bootlin has indeed a lot of good stuff.
As for turning off systemd, it is not a bad idea if one replaces it with an init system that can start stuff in parallel (to mask the waiting times). I get that desktop users and admins like it a lot, but for an embedded system with a specific mission and a static configuration, it can overkill. There are a bit more caveats than what they say, though.
- rollcat 2y ago> What wins big is to remove useless stuff entirely. This. And there's even a project (targeting mainly RasPi) that does just that: https://gokrazy.org https://gokrazy.org (And yes, you can also deploy code that wasn't written in Go, although it's quite clunky.)
- ryandrake 2y agoMost of the "make RPi Linux boot fast" guides out there use the same approach: Start with a tiny Debian and remove stuff until it's faster. There's not a lot of good information about attacking it from the other way: Start with a bootloader, firmware, and a kernel, and add only the stuff that you need. I mean, it's probably out there on the web somewhere, but I've found it tough to find among all the "just strip down Debian" blog posts. If anyone has experience doing this and could point me to a few resources, I'd be grateful!
- Snoozus 2y agolook into buildroot
- joezydeco 2y agoBuildroot is indeed the way.
- astrobe_ 2y agoI'm not the best one to answer your question, but I know there's Buildroot and Yocto - the latter being a bit "heavy" in terms of setup. I think I would go for one of those distros that focus on minimalism (Damn Small Linux, Alpine, ...) which also have precompiled packages for your target (note: Debian does have a tool to build custom root filesystems [1]). From there, get gcc and make for your platform, so you can carry on with compilation on-target, if possible; cross-compilation can be tricky. It should be ok if you don't want the heavier GUI stuff like X11/Wayland, browser etc. [1] https://wiki.debian.org/Debootstrap https://wiki.debian.org/Debootstrap