ADR-002: OS Building Tool Selection
Status
Section titled “Status”Accepted (2025-03-01)
Context
Section titled “Context”paiOS needs a tool to build customized Debian-based OS images for various target platforms (Raspberry Pi, x86, etc.). The image building process must:
- Be reproducible: Same inputs produce identical outputs
- Support CI/CD: Integrate cleanly with GitHub Actions
- Be maintainable: Low learning curve for contributors
- Leverage Debian ecosystem: Use existing
.debpackages rather than cross-compiling everything
Three tools were evaluated:
| Tool | Configuration | Approach | Complexity |
|---|---|---|---|
| Debos | YAML | Uses Debian packages | Low |
| Yocto | BitBake layers | Cross-compiles from source | High |
| Elbe | XML | Uses Debian packages + VM | Medium |
Evaluation Criteria
Section titled “Evaluation Criteria”1. Maintainability & Learning Curve
Section titled “1. Maintainability & Learning Curve”| Tool | Learning Curve | Documentation | Onboarding Time |
|---|---|---|---|
| Debos | Low: Simple YAML recipes | Good, examples available | Hours |
| Yocto | High: BitBake, layers, metadata | Extensive but complex | Weeks |
| Elbe | Medium: XML + initvm concepts | Moderate | Days |
Winner: Debos: Contributors can understand and modify recipes without specialized knowledge.
2. Build Speed
Section titled “2. Build Speed”| Tool | Approach | Typical Build Time |
|---|---|---|
| Debos | Downloads pre-built .deb packages | Minutes |
| Yocto | Cross-compiles everything from source | Hours |
| Elbe | Downloads packages, builds in VM | 10-30 minutes |
Winner: Debos: Leverages Debian’s package repository instead of rebuilding the world.
3. Debian Ecosystem Support
Section titled “3. Debian Ecosystem Support”| Tool | Package Source | Custom Packages |
|---|---|---|
| Debos | Native Debian repos | Add custom .deb via overlay |
| Yocto | Everything from source | Requires BitBake recipes |
| Elbe | Debian repos + custom builds | Better custom package support |
Winner: Debos/Elbe tie: Both leverage Debian packages natively.
4. CI/CD Integration
Section titled “4. CI/CD Integration”| Tool | Container Support | GitHub Actions |
|---|---|---|
| Debos | godebos/debos Docker image | ✅ Works well |
| Yocto | Complex, needs large runners | ⚠️ Needs 150GB+ storage |
| Elbe | Requires nested VM (initvm) | ⚠️ Complex setup |
Winner: Debos: Official Docker image simplifies CI/CD integration.
5. Security at Build Time
Section titled “5. Security at Build Time”| Tool | Security Patches in Images | Patch Turnaround | CVE Tracking |
|---|---|---|---|
| Debos | Via Debian Security Team | Hours–days | Automatic via APT |
| Yocto | Manual integration | Days–weeks | Requires layer maintenance |
| Elbe | Via Debian Security Team | Hours–days | Automatic via APT |
Winner: Debos/Elbe: Both inherit Debian’s mature security infrastructure for building images:
- Debian Security Team monitors and patches vulnerabilities upstream
- Rebuilding images pulls latest security fixes automatically
- No custom CVE tracking required: Debian handles it upstream
Yocto requires manual effort: security patches must be backported into BitBake recipes.
Decision
Section titled “Decision”We adopt Debos as the image building tool for paiOS.
Why Debos?
Section titled “Why Debos?”Debos aligns with paiOS’s pragmatic philosophy:
- KISS: YAML recipes are readable and maintainable
- Don’t Reinvent the Wheel: Uses Debian’s existing package infrastructure
- 80/20 Rule: Simple tool that covers our needs without complexity overhead
- Low-Hanging Fruits: Fast iteration with quick build times
Why Not Yocto (For Now)?
Section titled “Why Not Yocto (For Now)?”Yocto is the industry standard for deeply customized embedded Linux, but it’s over-engineering for the current phase of paiOS:
- Unnecessary complexity: We don’t need to cross-compile everything; Debian packages exist
- Steep learning curve: BitBake syntax and layer management takes weeks to master
- Long build times: Hours vs. minutes for equivalent images
- Resource intensive: Requires 150GB+ disk space and powerful build machines
Yocto would be the better choice if we needed:
- Minimal footprint embedded systems (< 100MB)
- Complete source control over every package
- Complex BSPs from silicon vendors with proprietary components
Why Not Elbe?
Section titled “Why Not Elbe?”Elbe is a solid middle-ground option, but has drawbacks:
- XML configuration: Less readable than YAML, harder to maintain
- initvm requirement: Runs builds inside a VM, complicating CI/CD
- Smaller community: Fewer examples and community resources than Debos
Elbe would be preferable if we needed:
- Complex custom package builds from source
- Strict license compliance tooling (Elbe has built-in license management)
- Ubuntu image support (Elbe supports Ubuntu, Debos is Debian-only)
Consequences
Section titled “Consequences”Positive
Section titled “Positive”- ✅ Fast builds: Minutes instead of hours
- ✅ Easy onboarding: YAML recipes are self-documenting
- ✅ Simple CI/CD: Docker container works out of the box
- ✅ Debian-native: Direct access to Debian’s package ecosystem
- ✅ Reproducible: Same recipe produces identical images
Negative
Section titled “Negative”- ⚠️ Debian-only: Cannot build non-Debian distributions
- ⚠️ Privileged containers: CI needs
--privilegedflag for loop device access
Technical Notes
Section titled “Technical Notes”- Custom kernels: Supported via
.debpackages: no need for Yocto. Radxa’s rsdk uses a similar Debian-native approach. - Reproducibility: Achieved via Debian Snapshots, Git-versioned recipes, and pinned Docker images.
- CI/CD: Requires
--privilegedDocker flag for loop device access (GitHub Actions supports this natively).
Related
Section titled “Related”- Architecture Overview: System layers and boundaries
- ADR-001: Licensing Strategy: License implications for OS components
- ADR-003: Update System: A/B partitioning and OTA updates