banger/internal
Thales Maciel bb95a0a273
banger internal make-bundle: build image bundles from flat rootfs tars
New hidden subcommand that turns a `docker export`-style rootfs tar
into a banger bundle (`rootfs.ext4` + `manifest.json`, tar+zstd):

  1. FlattenTar (new in imagepull) extracts the stream into a staging
     dir while capturing per-file uid/gid/mode into a Metadata record.
  2. imagepull.BuildExt4 produces the ext4 via `mkfs.ext4 -d`.
  3. imagepull.ApplyOwnership re-applies the captured metadata with
     `debugfs sif` so setuid/root-owned files keep their identity.
  4. imagepull.InjectGuestAgents drops the vsock agent + network
     bootstrap + first-boot service into the ext4.
  5. manifest.json is written with name/distro/arch/kernel_ref.
  6. Both files are packaged as .tar.zst with max compression.

Flags: --rootfs-tar (file or '-' for stdin), --name, --distro, --arch,
--kernel-ref, --description, --size, --out. Stdout prints bundle path,
sha256, and size so callers can patch the catalog.

Unit tests cover flag registration, required-arg validation, the
bundle tar round-trip, sha256HexFile, and dirSize. An end-to-end test
runs the full pipeline against a synthesized tiny rootfs tar; skips
gracefully when mkfs.ext4 / debugfs / companion binaries are missing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 15:17:50 -03:00
..
api Phase 2: daemon PullImage orchestration 2026-04-16 17:27:32 -03:00
buildinfo Stamp shared build metadata into banger binaries 2026-03-22 17:14:06 -03:00
cli banger internal make-bundle: build image bundles from flat rootfs tars 2026-04-17 15:17:50 -03:00
config Rename experimental Void image to void 2026-04-01 20:15:28 -03:00
daemon Generic kernel + init= boot path for OCI-pulled images 2026-04-16 20:12:56 -03:00
firecracker Add experimental Void guest workflow and vsock agent 2026-03-19 14:51:25 -03:00
guest Add guest.session.send and vm.workspace.export RPCs 2026-04-14 15:21:50 -03:00
guestconfig Refactor VM lifecycle around capabilities 2026-03-18 19:28:26 -03:00
guestnet Stop using kernel IP autoconfig for runtime VMs 2026-03-21 21:54:18 -03:00
hostnat Move helper NAT management into Go 2026-03-17 15:07:49 -03:00
imagecat imagecat: catalog + fetch for banger image bundles 2026-04-17 15:11:52 -03:00
imagepreset Add an experimental Alpine image flow 2026-03-21 20:25:55 -03:00
imagepull banger internal make-bundle: build image bundles from flat rootfs tars 2026-04-17 15:17:50 -03:00
kernelcat Generic kernel + init= boot path for OCI-pulled images 2026-04-16 20:12:56 -03:00
model Add guest sessions and agent VM defaults 2026-04-12 23:48:42 -03:00
namegen Remove runtime-bundle image dependencies 2026-03-21 18:34:53 -03:00
opencode Wait for real guest vsock health before opencode 2026-03-21 21:14:22 -03:00
paths Phase 1: imagepull package — pull, flatten, ext4 2026-04-16 17:22:13 -03:00
policy Add vsock-backed VM port inspection 2026-03-19 15:52:11 -03:00
rpc Propagate RPC cancellation to daemon requests 2026-03-16 18:28:33 -03:00
sessionstream Add guest sessions and agent VM defaults 2026-04-12 23:48:42 -03:00
store Add guest sessions and agent VM defaults 2026-04-12 23:48:42 -03:00
system Phase B-1: ownership fixup via debugfs pass 2026-04-16 18:04:22 -03:00
toolingplan Bootstrap vm run tooling before attach 2026-03-29 11:38:05 -03:00
vmdns Replace mapdns with daemon DNS 2026-03-17 15:49:35 -03:00
vsockagent Add vsock-backed VM port inspection 2026-03-19 15:52:11 -03:00
webui Rename experimental Void image to void 2026-04-01 20:15:28 -03:00