Operations 10 min read

How to Slash Embedded Linux Boot Time on BeagleBone Black by 1.5 Seconds

This article walks through practical techniques—compiler tuning, application trimming, init and rootfs optimization, kernel configuration tweaks, and U‑Boot Falcon mode—to reduce the boot time of a BeagleBone Black Linux system from over nine seconds to just 2.4 seconds, while also shrinking the filesystem size.

Open Source Linux
Open Source Linux
Open Source Linux
How to Slash Embedded Linux Boot Time on BeagleBone Black by 1.5 Seconds

Source: 老吴嵌入式. The goal is to try a few simple yet effective startup‑time optimization methods without covering every possible technique.

Target System

Hardware : BeagleBone Black (Cortex‑A8) with USB camera and LCD.

Software : Linux 5.1 + Buildroot rootfs, FFmpeg for video capture and decoding.

Current boot time (power‑on to first LCD frame): 9.45 seconds.

1. Optimize the Compiler

ARM vs Thumb‑2 : Thumb‑2 reduces rootfs from 3.79 MB to 3.10 MB (‑18 %) and FFmpeg from 227 KB to 183 KB (‑19 %). Performance improves slightly (<5 %). The author still prefers ARM.

musl vs uClibc : uClibc is 570 KB (‑16 %) compared to musl 680 KB, saving 110 KB, so uClibc is chosen.

2. Optimize the Application

Configure FFmpeg with ./configure to select needed components, and use strace and perf to profile internal code.

Result after optimization :

Filesystem reduced from 16.11 MB to 3.54 MB (‑78 %).

Program load/run time shortened by 150 ms.

Total boot time shortened by 350 ms.

Space savings are large, but boot‑time gains are modest because the kernel only loads required parts of the program.

3. Optimize Init and Root Filesystem

Approach:

Use bootchartd to analyze boot and trim unnecessary services.

Merge scripts under /etc/init.d/ into one.

Do not mount /proc and /sys.

Trim BusyBox to shrink the filesystem.

Replace init with the application itself and statically link it.

Remove rarely accessed files (e.g., find / -atime -1000 -type f).

Result : Filesystem reduced from 3.54 MB to 2.33 MB (‑34 %). Boot time unchanged because the filesystem was already small.

Using initramfs as rootfs can further reduce boot time by loading the kernel and initramfs together, eliminating disk access. Disable CONFIG_INITRAMFS_COMPRESSION_NONE when using this method.

4. Optimize the Kernel

Evaluation : Add initcall_debug to kernel command line for detailed logs.

Key optimizations and their effects:

Disable tracing in Kernel hacking: boot time ‑550 ms, kernel size ‑217 KB.

Remove unused hardware drivers (e.g., omap8250_platform_driver_init, cpsw_driver_init, etc.).

Preset loops‑per‑jiffy to avoid runtime calibration: boot time ‑82 ms.

Disable SMP on single‑core platforms: kernel ‑188 KB, boot time ‑126 ms.

Disable console logging ( quiet, CONFIG_PRINTK, CONFIG_BUG): boot time ‑577 ms, kernel ‑~124 KB.

Enable CONFIG_EMBEDDED and CONFIG_EXPERT: kernel ‑51 KB, boot time ‑34 ms.

Select SLAB allocator (default) over SLOB/SLUB for stability.

Compress kernel with gzip or lzo (better than others).

Enable CONFIG_CC_OPTIMIZE_FOR_SIZE (use -Os).

Disable unnecessary pseudo‑filesystems ( /proc options) where possible; disabling sysfs saves 35 ms.

Append DTB to kernel image ( CONFIG_ARM_APPENDED_DTB): boot time ‑26 ms.

Total kernel‑related improvements reduce boot time by about 767 ms.

5. Optimize the Bootloader

Use U‑Boot Falcon mode, which runs only the SPL stage and skips the second stage, cutting boot time by roughly 250 ms.

Summary

After applying all optimizations, the final boot sequence shows a total time of 2.41 seconds from power‑on to first LCD frame.

Most effective steps (in order of impact):

Kernel configuration tweaks (tracing, SMP, logging, embedded mode).

U‑Boot Falcon mode.

Filesystem and rootfs trimming.

Compiler and C library selection.

Application configuration.

Remaining optimization opportunities include speeding up USB camera enumeration (currently ~1.2 seconds) and disabling tty/terminal login.

General principles: avoid premature optimization, start with low‑impact changes, work from rootfs to kernel to bootloader, and focus on the biggest bottlenecks.

Kernel TuningU-BootEmbedded LinuxBeagleBone Blackboot optimizationrootfs
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.