TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to optimize boot time in user space on a Raspberry Pi 4 / Boot2Qt

37 pointsby jandeboevrie8 months ago

4 comments

megous8 months ago
This just shows how proprietary boot flow of RPi is slow. On other platforms you can get bootloader to hand off to kernel in subsecond timeframes, sometimes as fast as in 0.3s.<p>Then kernel can be done in another 0.3s or faster, and then userspace can still be optimized more than what&#x27;s described in the article, too. Instead of shell and executing programs, which requires filesystem access, loading them, loading shared libraries, etc. you can have a specialized, tiny statically built init binary which just does all initialization&#x2F;mounts via syscalls and then runs your app (which should be built statically, too).<p>This way you can achieve ~1-2s boot to UI on even way slower platforms than Rpi4. I did something like this on Pinephone a few years ago and recently again on Luckfox Pico Mini, which is a slow Cortex-A7 with DDR2 memory.<p>There&#x27;s no justification for Rpi to be booting for 12s. Even unoptimized standard U-Boot on common platforms often runs for just ~1s before handing off to the kernel.
评论 #41549865 未加载
评论 #41546312 未加载
joezydeco8 months ago
&quot;Instead of finding and optimizing tasks, we just turned systemd off&quot;. Okay.<p>The folks at Bootlin have way more interesting approaches and techniques to review. I&#x27;d look to them.<p><a href="https:&#x2F;&#x2F;bootlin.com&#x2F;blog&#x2F;tag&#x2F;boot-time&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bootlin.com&#x2F;blog&#x2F;tag&#x2F;boot-time&#x2F;</a>
评论 #41548113 未加载
评论 #41546428 未加载
dividuum8 months ago
Even if your userspace is pretty fast, some necessary initialization happening before the kernel is even loaded means the you probably never get lower than 6-8 seconds. There is a lengthy EEPROM issue thread about that for the Pi4: <a href="https:&#x2F;&#x2F;github.com&#x2F;raspberrypi&#x2F;firmware&#x2F;issues&#x2F;1375">https:&#x2F;&#x2F;github.com&#x2F;raspberrypi&#x2F;firmware&#x2F;issues&#x2F;1375</a>
cvilgan8 months ago
I wonder how this even works, as PID 1 should exit right away, no? And I thought this would lead to an immediate kernel panic?
评论 #41546656 未加载
评论 #41546251 未加载