Core Domain API
Business logic modules in the domain layer.
Builder Package
Section titled “Builder Package”KernelBuilder
Section titled “KernelBuilder”type KernelBuilder struct { // Fields for kernel operations}
func NewKernelBuilder(...) *KernelBuilderfunc (kb *KernelBuilder) Clone() errorfunc (kb *KernelBuilder) Configure(configType string) errorfunc (kb *KernelBuilder) Build() errorfunc (kb *KernelBuilder) Clean() errorHandles kernel cloning, config, building.
ModuleBuilder / AppBuilder
Section titled “ModuleBuilder / AppBuilder”Similar structure for modules and apps.
Create(name string)- Generate templatesBuild(dir string)- Cross-compile
Doctor Package
Section titled “Doctor Package”HealthChecker
Section titled “HealthChecker”type HealthChecker struct{}
func NewHealthChecker(...) *HealthCheckerfunc (hc *HealthChecker) Check() ([]CheckResult, error)Runs dependency checks.
AutoFixer
Section titled “AutoFixer”type AutoFixer struct{}
func NewAutoFixer(...) *AutoFixerfunc (af *AutoFixer) Fix(results []CheckResult) errorApplies automatic fixes.
Emulator Package
Section titled “Emulator Package”QEMURunner
Section titled “QEMURunner”type QEMURunner struct{}
func NewQEMURunner(...) *QEMURunnerfunc (qr *QEMURunner) Run(options []string) errorfunc (qr *QEMURunner) Debug(options []string) errorManages QEMU execution.
Patch Package
Section titled “Patch Package”Manager
Section titled “Manager”type Manager struct{}
func NewManager(...) *Managerfunc (pm *Manager) Apply(patchPath string) errorfunc (pm *Manager) List() ([]Patch, error)Applies kernel patches.
Rootfs Package
Section titled “Rootfs Package”Creator
Section titled “Creator”type Creator struct{}
func NewCreator(...) *Creatorfunc (rc *Creator) Create() errorCreates the root file system disk image. Default engine oci: pulls a container image for the target architecture and writes it straight into a writable ext4 of the requested size in pure Go (third_party/ext4, adapted from hcsshim; no sudo, no e2fsprogs). Engine debootstrap: Debian foreign install (needs sudo and tools/debootstrap).
Toolchain Package
Section titled “Toolchain Package”Manager
Section titled “Manager”type Manager struct{}
func NewManager(...) *Managerfunc (tm *Manager) Install() errorfunc (tm *Manager) Build(target string) errorfunc (tm *Manager) List() ([]string, error)func (tm *Manager) Status() (map[string]bool, error)Manages crosstool-ng toolchains.
All domain structs use dependency injection with infra interfaces for testability.