Skip to content

HMG-API isn't installed alongside NEMESIS: a new install on a NEMESIS unit stops - #480

Open
VysseCodes wants to merge 1 commit into
release/2.0from
fix/nemesis-gate
Open

VysseCodes wants to merge 1 commit into
release/2.0from
fix/nemesis-gate

Conversation

@VysseCodes

Copy link
Copy Markdown
Collaborator

What

2.0's rule (#468, section 1): HMG-API and NEMESIS aren't installed together. This is the gate for it, in install.sh, where every route ends (USB stick, adb, the app's updates, the catalogue's engine update hmgapi, NEMESIS's own package).

  • NEMESIS installed (lib.sh nemesis_installed): any of its own files on /system. That's its binary (/system/xbin/nemesis), its app (/system/app/NEMESIS.apk), or its LivePatch script at app_process. The head unit's factory nemesis service slot (/data/local/tmp/nemesis/nemesis, from init.daudio.rc) is stock and doesn't count.
  • A new install stops before anything changes: "NEMESIS is installed on this unit, and HMG-API isn't installed alongside NEMESIS, so nothing was changed." The USB stick's toast says the same in short. The guided "keep HMG-API, remove NEMESIS" path isn't built yet, so the message says moving a unit isn't in this build yet. It changes when that path lands.
  • A unit with HMG-API already on it goes ahead (hmgapi_on_unit): HMG-API's wrapper anywhere in the zygote chain, its stock copy (app_process.hmgapi-stock), or its install record. The orders test showed why this matters. Stopping those units blocks the NEMESIS 1.17: uninstalling HMG-API can stop Android from starting (fix in #396, recovery steps) #397 rescue: after an older uninstall under NEMESIS 1.17, installing again before the restart is what keeps the unit starting. So units that have both from an older release still get updates and repairs until they move.
  • HMGAPI_WITH_NEMESIS=1 installs anyway, for maintainers and the off-car tests (they check HMG-API's work under NEMESIS, which the "keep NEMESIS, remove HMG-API" path needs). No stick file sets it and no message names it, as with HMGAPI_FORCE.
  • Uninstall isn't gated.

Tested

Off-car only:

  • install/common/test.sh (46): both checks on NEMESIS's binary, its app, its LivePatch script, HMG-API's wrapper in .real with its stock copy gone, HMG-API's install record, and the factory slot's file alone.
  • install/common/install-test.sh (267): refused with NEMESIS's binary, and with its app alone; nothing changed; no way around it named. The rest runs with the maintainers' variable.
  • install/common/orders-test.sh (8): every order, including "1.0.2's uninstall under NEMESIS, then this install before the restart: starts". A first version of this gate failed that check.
  • install/usb/test.sh (63): the stick's toast, and nothing changed.
  • install/nemesis/mod-test.sh, install/nemesis/sync-test.sh, core/runtime/scriptcheck-test.sh.

Not on a car yet. To check on one: a USB install on a unit with NEMESIS 1.17 and no HMG-API is refused with the toast, and /system is untouched; an update on a unit that has both still goes through.

Conflicts to expect: #464, #478 and #479 each add an "Unreleased" heading to CHANGELOG.md. lib.sh and install.sh also change in #478 (the lock, right after the same capcheck line).

… unit stops

install.sh (where every route ends) stops before anything changes when NEMESIS
is installed: its binary (/system/xbin/nemesis), its app (NEMESIS.apk) or its
LivePatch script at app_process (lib.sh nemesis_installed). The factory
nemesis service slot's file isn't NEMESIS. The USB stick's toast says why.

Only a new install stops. A unit with HMG-API already on it (its wrapper in the
zygote chain, its stock copy or its install record: hmgapi_on_unit) is updated
and repaired as before: the orders test showed that stopping it would block the
#397 rescue (installing again before the restart after an older uninstall under
NEMESIS 1.17), and the unit wouldn't start.

HMGAPI_WITH_NEMESIS=1 installs anyway, for maintainers and the off-car tests
(no stick file sets it, no message names it), as HMGAPI_FORCE is.

Tested off-car only: install/common/test.sh (the two checks), install-test.sh
(refused with NEMESIS's binary and with its app alone, nothing changed),
orders-test.sh (every order, the rescue included), usb/test.sh (the toast),
mod-test.sh, sync-test.sh, scriptcheck-test.sh.

@AwsomeFox AwsomeFox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The two paths match NEMESIS's own: BIN_PATH is /system/xbin/nemesis and MANAGER_APK is /system/app/NEMESIS.apk (upstream nemesis.h).
  • uninstall.sh removes installed.txt, so an old record can't fool hmgapi_on_unit.
  • With #479:
    • After a wipe, NEMESIS's binary, its app and its LivePatch script are all gone, so the gate clears.
    • An incomplete wipe ("/system stayed read-only") leaves them, but hmgapi_on_unit still lets updates through.

Smaller:

  • A unit left with NEMESIS's LivePatch script at app_process but no NEMESIS (an old partial removal) is told "NEMESIS is installed". It's rare. Saying "NEMESIS (or its LivePatch script at app_process)" would save a confused report.
  • A question: "Wipe NEMESIS" in Manager followed by the USB install already moves a NEMESIS-only unit today, since the wipe puts the stock app_process back. If that's acceptable as the interim path, the message could name it instead of "isn't in this build yet". If it isn't, a line in #468 on why would help.
  • The conflict with #478 is as the PR says: both add a line right after capcheck.

This branch has not been deployed

No deployments
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.

2 participants