Skip to content

Normalize ownership of rootfs files to root:root in APK packaging#68

Merged
cbrake merged 2 commits intomainfrom
cbrake/main
Apr 24, 2026
Merged

Normalize ownership of rootfs files to root:root in APK packaging#68
cbrake merged 2 commits intomainfrom
cbrake/main

Conversation

@cbrake
Copy link
Copy Markdown
Collaborator

@cbrake cbrake commented Apr 24, 2026

No description provided.

cbrake added 2 commits April 24, 2026 16:31
APK tars were written with the host build user's uid/gid (docker --user
uid:gid), and tar extract during rootfs assembly runs non-root so ownership
fell back to the host user again. The booted system ended up with /bin,
/etc, /usr, etc. owned by whichever uid the build happened to land on
(e.g. the dev-image's uid-1000 `user`).

- APK packaging: normalize every tar header to root:root via a small
  normalizeOwnership helper.
- Image class: chown -R 0:0 \$DESTDIR/rootfs before mkfs.ext4 -d / mcopy
  (both now privileged) so the on-disk filesystem holds root-owned files,
  then chown \$DESTDIR back to the host user at the end of the disk task
  so the next build's host-side os.RemoveAll can still clean it up.

Also record the changelog-style preference in CLAUDE.md.
@cbrake cbrake merged commit 2b41e98 into main Apr 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant