Skip to content

K2GO-558 fix(proot): git keeps its objects under --link2symlink - #785

Merged
luisguzman-adfa merged 1 commit into
mainfrom
fix/K2GO-558-proot-git-createobject
Nov 14, 2026
Merged

luisguzman-adfa merged 1 commit into
mainfrom
fix/K2GO-558-proot-git-createobject

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

What changes

  • Rootfs bake: /etc/gitconfig gets core.createObject = rename and transfer.unpackLimit = 1.
  • APK: before each proot launch (PRootEngine.executeInContainer), the app adds the same two settings to the rootfs /etc/gitconfig when they are not in effect. Rule in proot/domain/GuestGitConfig (pure JVM, unit-tested). Writer in proot/data/GuestGitConfigWriter (temp file + rename, no-op when present).

Why

  • Git finalizes objects with link(). proot --link2symlink turns that into symlinks whose target is later removed, so the box clone loses objects ("bad object HEAD") and self-updates fail. rename() is not intercepted.
  • The bake fixes new images. The app fixes boxes already installed from older images.

Steps to QA

  • Baseline (main): in a proot shell on the box, git init in /tmp and make 5 commits. Objects in .git/objects are symlinks and .l2s.* files appear.
  • Change: install this APK and open the app. The rootfs /etc/gitconfig has both settings. The same test gives 0 symlinks and 0 .l2s.*. The box update check (git fetch in /opt/iiab-android) stays clean and git fsck passes.

Verifications

  • Q8 (armeabi-v7a) and OnePlus 7T (arm64-v8a): baseline 15 symlinked objects / 30 .l2s.*; change 0 / 0, real box fetch clean, fsck clean. App restart is a no-op.
  • GuestGitConfigTest 7/7; full unit suite and lint pass.
  • Evidence is in Jira K2GO-558.

Notes

  • The settings live in two places on purpose: the bake's first clone runs before the app exists. Each copy points to the other.

Git finalizes objects with link(), which link2symlink turns into symlinks
that later lose their target. Set core.createObject=rename and
transfer.unpackLimit=1 in the rootfs bake, and have the app add them to
older rootfs trees before each proot launch.
@luisguzman-adfa
luisguzman-adfa merged commit 2941914 into main Nov 14, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-558-proot-git-createobject branch November 14, 2026 21:30
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