Google deleted this source from bootable/recovery outright (commit c7ebad5f, "rm -rf non-AB code", 2024-04-05) — confirmed present at android-14, absent at android-16.0.0_r4. The runtime side (install.cpp's SetUpNonAbUpdateCommands) and build-side packaging (ota_from_target_files.py's GenerateNonAbOtaPackage) both survived; only the source that builds the update-binary executable itself was removed. Sourced from TeamWin's android_bootable_recovery (android-14.1), the only living copy found, with install/ZipUtil.cpp, get_args.cpp, and set_metadata.cpp intentionally left out (only wired into TeamWin's modified install.cpp, which PawletOS isn't adopting — twrpinstall carries its own independent copies). Kept as its own repo, not folded into a recovery fork, so it's buildable independent of whichever recovery UI ends up in use.
76 lines
3.9 KiB
Markdown
76 lines
3.9 KiB
Markdown
# external_update_binary
|
|
|
|
Provides the `applypatch`/`updater`/`edify` stack — the code that builds the
|
|
`updater` binary embedded as `update-binary` inside a non-A/B OTA zip, and
|
|
interpreted by recovery's `install/install.cpp` (`SetUpNonAbUpdateCommands()`)
|
|
at install time.
|
|
|
|
## Why this repo exists
|
|
|
|
Google deleted this source from AOSP outright in commit `c7ebad5f`
|
|
("rm -rf non-AB code", 2024-04-05, Bug 324360816) — confirmed present in the
|
|
android-14 tag, absent from android-16.0.0_r4. The *runtime* side survived
|
|
(`install/install.cpp` in stock `bootable/recovery` still unconditionally
|
|
extracts and executes `update-binary` from an OTA zip) and the *build-side
|
|
packaging* survived too (`ota_from_target_files.py` still has
|
|
`GenerateNonAbOtaPackage`/`--binary`) — only the source that builds the
|
|
`updater` executable itself was removed. This repo restores just that piece,
|
|
sourced from TeamWin's `android_bootable_recovery` (`android-14.1` branch),
|
|
the only living copy found.
|
|
|
|
Kept as its own repo rather than folded into a recovery fork so it's
|
|
buildable independent of whichever recovery UI PawletOS ends up using (stock
|
|
AOSP UI or a TWRP-derived one) — see `PawletOS/NOTES-ota-recovery-ab.md` in
|
|
the main workspace for the full investigation.
|
|
|
|
## Layout
|
|
|
|
- `applypatch/` — binary patch application (`imgpatch`, `bspatch`), plus the
|
|
standalone `applypatch`/`imgdiff` tools. Self-contained Soong module, no
|
|
changes made against TeamWin's source.
|
|
- `updater/` — the `updater` executable itself (`updater/Android.mk`,
|
|
`LOCAL_MODULE := updater`) and its supporting static libs
|
|
(`libupdater_core`, `libupdater_device`, `libupdater_host`). Uses classic
|
|
`Android.mk`/`BUILD_EXECUTABLE` — verified still supported in
|
|
raspberry-vanilla's `android-16.0` `build/make` fork (`core/executable.mk`
|
|
present, `LOCAL_FORCE_STATIC_EXECUTABLE` handling present).
|
|
- `edify/` — the scripting language `updater-script` is written in
|
|
(`libedify`: lexer/parser/expression evaluator).
|
|
|
|
## What was intentionally left out
|
|
|
|
- `install/ZipUtil.cpp`, `install/get_args.cpp`, `install/set_metadata.cpp` —
|
|
these existed in TeamWin's tree but are wired only into *their* modified
|
|
`install.cpp` (bootable/recovery's top-level `Android.bp`), which PawletOS
|
|
is not adopting (stock `install.cpp` is being kept as-is). Confirmed
|
|
`twrpinstall` (a separate standalone module, not part of this repo) ships
|
|
its own independent copies of `ZipUtil`/`get_args`, so nothing depends on
|
|
the ones that used to live here. Left out rather than carried along as
|
|
dead weight.
|
|
- `uncrypt/Android.mk` — `uncrypt` still exists, unmodified, in stock
|
|
`bootable/recovery`. Nothing to restore there.
|
|
|
|
## Compatibility notes (android-16.0.0_r4, raspberry-vanilla build)
|
|
|
|
- Adapted `updater/Android.bp` and `edify/Android.bp` to declare their own
|
|
`license {}` module instead of referencing bootable/recovery's internal
|
|
`bootable_recovery_license` name — keeps this repo buildable without a
|
|
hard coupling to bootable/recovery's own license plumbing. `applypatch/`
|
|
already declared its own license module upstream, left as-is.
|
|
- All `static_libs`/`shared_libs` dependencies referenced
|
|
(`libbootloader_message`, `libotautil`, `libavb`, `liblp`, `libdm`,
|
|
`libfec`/`libfec_rs`, `libselinux`, `libsparse`, `libsquashfs_utils`,
|
|
`libbrotli`, `libbz`, `libziparchive`, `libbase`, `libcrypto_utils`,
|
|
`libbsdiff`, `libdivsufsort`/`libdivsufsort64`) are long-stable AOSP
|
|
library names from `system/`/`external/`, not modified by PawletOS or
|
|
raspberry-vanilla — not individually re-verified against the android-16.0
|
|
tag, flagged here in case a build turns one of these up as missing.
|
|
- Not yet build-tested end to end (no local AOSP build environment
|
|
available in this workspace) — the checks above were done by reading
|
|
source and grepping actual cloned trees, not by compiling.
|
|
|
|
## License
|
|
|
|
Apache License 2.0 (see `NOTICE`), consistent with the upstream AOSP/TeamWin
|
|
source this was derived from.
|