- Add AGENTS.md with project overview for AI agents - Update .gitignore to exclude CodeWhale and DeepSeek tooling
3.8 KiB
3.8 KiB
AGENTS.md — CB-C6s-STU-GSI-Fixes
Overview
TWRP flashable zip for the CB-C6s-STU tablet (Spreadtrum/Unisoc) running a
GSI. It appends build.prop properties, installs a touchscreen IDC config,
and installs a camera sensor config. All install logic lives in a shell-script
update-binary — no compiled code, no build system.
Build / Package
# Create the flashable zip (excluded from git via .gitignore)
cd /home/purpl/Repos/CB-C6s-STU-GSI-Fixes
zip -r ../CB-C6s-STU-GSI-Fixes.zip META-INF/ system/ vendor/
No build dependencies, no lint, no test suite.
Architecture
zip root
├── META-INF/com/google/android/
│ ├── update-binary ← Entry point: POSIX sh script, executed by TWRP
│ └── updater-script ← Dummy placeholder (TWRP ignores it)
├── system/
│ ├── build.prop ← Properties APPENDED (>>) to /system/build.prop
│ └── usr/idc/
│ └── goodix_ts.idc ← Copied to /system/usr/idc/goodix_ts.idc (644)
└── vendor/etc/
└── sensor_config.xml ← Copied to /vendor/etc/ or /system/vendor/etc/ (644)
Install flow (update-binary)
- Locate zip root:
dirname $0→ up 3 levels (../../..) - Mount
/systemand/vendor - Append
system/build.prop→/system/build.prop(backup first to.bak) - Copy
goodix_ts.idc→/system/usr/idc/ - Copy
sensor_config.xml→/vendor/etc/(fallback to/system/vendor/etc/for SAR) - Report success via
ui_print()to/proc/self/fd/$OUTFD
Critical constraint: build.prop is APPENDED, never replaced
update-binary line ~72: cat "$BUILDPROP_SRC" >> /system/build.prop
The >> is intentional. Using > or package_extract_dir would clobber the
device's existing properties. Re-flashing duplicates entries — warn the user or
add idempotency if this becomes a problem.
Key Files
| File | Role |
|---|---|
META-INF/…/update-binary |
Entire install logic (shell script) |
META-INF/…/updater-script |
Placeholder; not executed |
system/build.prop |
5 properties appended to device's build.prop |
system/usr/idc/goodix_ts.idc |
Touchscreen input device config (orientation + type) |
vendor/etc/sensor_config.xml |
Camera module mapping: hi846, gc8034 (rear/front, 4 combos) |
README.md |
User-facing documentation |
.gitignore |
Excludes *.zip |
Coding Conventions
- Shell: POSIX sh, no bashisms. Shebang
#!/sbin/sh(TWRP environment). - Error handling:
abort()helper exits with message.2>/dev/nullon non-critical operations (mount, mkdir, cp backup). - Naming:
UPPER_CASEfor globals/file paths,snake_casefor helpers. - Partition logic:
/vendormount is best-effort; falls back to/system/vendor/etc/when/vendor/etc/doesn't exist (SAR compatibility).
Git Workflow
- Branch:
main(root commit only) - Commit style: concise summary line, then bullet list of changes
.gitignore: excludes*.zip(the build artifact) and tooling directories
Tips for AI Agents
- This is not a software project — there is no build system, no package manager, no test runner. Changes are edits to shell script or config files.
- To add a new fix: add the payload file under
system/orvendor/, add a step toupdate-binarywithui_printandcp(or append logic), updateREADME.md"What it fixes" table. - To add a new build.prop property: append a line to
system/build.prop. If it needs to be idempotent, add a grep guard inupdate-binary. - Testing: flash the zip in TWRP on the device. There is no emulation.
- The
updater-scriptis a dummy — do not add Edify commands there; put all logic inupdate-binary. - Zip path: the build artifact is written to the repo's parent directory,
not inside the workspace.
*.zipin.gitignorecovers both locations.