res-os-builder: container-native bootable image builder (design proposal) #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
res-os-builder: container-native bootable image builder (design proposal)
Goal
Build residual boot images from Docker/OCI containers instead of (or alongside) the current
mkimage.shISO pipeline. Desired flow:docker buildaFROM-based OS image — config scripts baked in viaCOPY/RUNddto USBNo privileged build containers, no QEMU in the build path. The whole pipeline must run on standard GitHub runners (fully unprivileged).
Why not bootc
Evaluated and rejected:
res-init— a core design decision of this project.bootc-image-builderis Fedora/RHEL-family oriented ("especially oriented towards Fedora/CentOS bootc or derivatives"). Alpine support is effectively nonexistent and undocumented; prior attempts at Alpine+bootc hit a wall of undocumented Fedora-isms.Hand-rolled is the right call here.
Proposed pipeline
Dockerfile.residual:FROM alpine(or a residual base) →apk add→ multi-stageCOPYof Go binaries (res-init,res-sh,res-console,residual-login,res-edit) →COPYconfig scripts →RUNscripts. Builds on any stock runner.docker savea tarball) — the tool accepts both.res-os-builder convert(new Go tool, lives atcmd/res-os-builderin this repo):rootfs/(umoci/crane, no daemon needed)/boot, initramfs built via ourrespkg-mkinitfsfork against those modulesmksquashfs rootfs/→system.squashfsxorriso, and/or.img: FAT32 ESP viamtools, partitions laid out withsfdisk+ddat offsets — no loop mounts, no privilegesmksquashfs,xorriso,mkfs.ext4 -d,mtoolsall do).Boot model: immutable OS + overlay for user data
system.squashfsmounted read-only as the overlay lower → immutable systemtmpfs(stateless) or a labeled persistent partition (RESIDUAL_DATA, ext4) when present — same image boots stateless on any machine, persistent where the data partition exists, no flags neededswitch_root→res-initas PID 1mkimg.residual*.sh(package lists, config) migrates into the Dockerfile.Open decisions
.img, or both from a single build?apk add linux-ltsin the Dockerfile)?Suggested first milestone
/dev/kvm? loop devices?).imgas a workflow artifactCoalesced into the workspace backlog as residual/.agent#27 (labels
proj-os,tier-3-hard). Closing this one to keep a single source of truth.