Skip to content

feat(hooks): pak-scoped self-registering lifecycle hooks - #821

Open
dalexanco wants to merge 1 commit into
LoveRetro:mainfrom
dalexanco:chore/hooks-launch
Open

feat(hooks): pak-scoped self-registering lifecycle hooks#821
dalexanco wants to merge 1 commit into
LoveRetro:mainfrom
dalexanco:chore/hooks-launch

Conversation

@dalexanco

Copy link
Copy Markdown

Summary

Introduces pak-hooks.sh: Tools paks register for lifecycle events (boot, pre-launch, post-launch, pre-sleep, post-resume) by dropping a matching file next to their own launch.sh. Presence is the registration — no arming, and deleting the pak removes its hooks too. Only pre-launch.sh can veto a launch.

Pure core/infra PR, no Parental-control code — gives a future Parental.pak PR a stable mechanism to build on instead of bespoke .hooks/ copying, so it can land as an almost-independent pak.

What changed

  • Game Tracker.pak now owns gametimectl start/stop/resume via its own hooks; api.c/nextui.c no longer call it directly.
  • No HOOK_PHASE env var — the filename already says the phase.
  • Hook cache rebuilds at boot, then only after a Tools pak (not a rom) exits, since only a pak can change Tools/.
  • Legacy run_hooks.sh/.hooks/ kept but deprecated, logs a warning when used, so no third-party pak silently breaks.

Adds pak-hooks.sh: Tools paks register for boot/pre-launch/post-launch/
pre-sleep/post-resume via a matching file next to their own launch.sh --
no arming, no HOOK_PHASE (filename says it), removing the pak removes
its hooks. Only pre-launch.sh can veto. Cache rebuilds at boot, then
only after a Tools pak (not a rom) exits.

Game Tracker.pak now owns gametimectl start/stop/resume via its own
hooks. Legacy run_hooks.sh/.hooks/ is kept but deprecated (logs when used).
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