Skip to content

LevitateOS/distro-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

125 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

distro-builder

Shared infrastructure for building Linux distribution ISOs.

This crate provides common abstractions used by both leviso (LevitateOS) and AcornOS builders.

Architecture

distro-builder (this crate)
    │
    ├── component/     Declarative component system
    │   └── Installable trait, Phase enum, generic Op variants
    │
    ├── build/         Build utilities
    │   ├── context    DistroConfig and BuildContext traits
    │   └── filesystem FHS directory structure utilities
    │
    ├── artifact/      Artifact builder interfaces
    │   ├── rootfs     mkfs.erofs wrapper (EROFS only)
    │   ├── initramfs  cpio+gzip builder
    │   └── iso        xorriso wrapper
    │
    └── preflight/     Host tool validation

Usage

use distro_builder::component::{Installable, Op, Phase};
use distro_builder::build::context::DistroConfig;

// Implement DistroConfig for your distribution
struct MyDistroConfig;

impl DistroConfig for MyDistroConfig {
    fn os_name(&self) -> &str { "MyDistro" }
    fn os_id(&self) -> &str { "mydistro" }
    // ... other methods
}

// Define components using the Installable trait
struct MyComponent;

impl Installable for MyComponent {
    fn name(&self) -> &str { "MyComponent" }
    fn phase(&self) -> Phase { Phase::Services }
    fn ops(&self) -> Vec<Op> {
        vec![
            Op::Dir("etc/myservice".into()),
            Op::WriteFile("etc/myservice/config".into(), "key=value".into()),
        ]
    }
}

Status

This crate is currently a structural skeleton. The abstractions are defined but artifact builders contain placeholder implementations. Full extraction from leviso requires testing with both LevitateOS and AcornOS builds.

Implemented

  • Installable trait and Phase enum
  • Generic Op variants (directory, file, symlink, user/group, binary)
  • DistroConfig and BuildContext traits
  • FHS filesystem utilities (with tests)
  • Host tool preflight validation

Placeholder (future work)

  • EROFS builder (interface only)
  • Initramfs builder (interface only)
  • ISO builder (interface only)

Related Crates

  • distro-spec - Distribution specifications (constants, paths, services)
  • leviso - LevitateOS ISO builder
  • AcornOS - AcornOS ISO builder

Migration Notes

License

Licensed under either of:

at your option.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages