banger/internal/system
Thales Maciel 408ad6756c
system: build work-seed without sudo
BuildWorkSeedImage used to mount the source rootfs and the new seed
image — both via sudo. After the privilege split (59e48e8) the owner
daemon runs without sudo and those mounts fail silently inside the
image-pull pipeline (runBuildWorkSeed swallows errors), so every
freshly pulled image landed in the store with an empty WorkSeedPath
and 'banger doctor' kept warning that /root would be empty.

Rewrite the builder around the existing sudoless toolkit:

  1. RdumpExt4Dir extracts /root from the source rootfs into a host
     tempdir (debugfs, no mount).
  2. truncate + mkfs.ext4 -F -E root_owner=0:0 produces an empty
     user-owned ext4 file.
  3. A Go walk over the staged tree calls MkdirExt4 /
     WriteExt4FileOwned for every dir + regular file, forcing
     root:root and preserving mode bits.

Symlinks and special files in /root are skipped — extremely rare on
a stock distro and not part of what makes a useful seed.

Fix won't retroactively populate already-pulled images: re-pull the
default image (e.g. 'banger image delete debian-bookworm && banger
image pull debian-bookworm') to get a seeded work-seed.ext4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 20:18:23 -03:00
..
ext4.go daemon: rewrite git identity sync + file_sync on ext4 toolkit 2026-04-23 18:29:30 -03:00
ext4_test.go daemon: rewrite ensureWorkDisk no-seed path to skip the mount + cp 2026-04-23 18:09:32 -03:00
extra_test.go coverage: easy-wins batch across cli, system, paths, vmdns, toolingplan 2026-04-18 17:57:05 -03:00
files.go system: build work-seed without sudo 2026-04-26 20:18:23 -03:00
preflight.go Refactor VM lifecycle around capabilities 2026-03-18 19:28:26 -03:00
report.go Refactor VM lifecycle around capabilities 2026-03-18 19:28:26 -03:00
report_test.go Refactor VM lifecycle around capabilities 2026-03-18 19:28:26 -03:00
system.go daemon: split owner daemon from root helper 2026-04-26 12:43:17 -03:00
system_test.go Stop using kernel IP autoconfig for runtime VMs 2026-03-21 21:54:18 -03:00