Add power-mode and observability hooks#1397
Open
CatalyticArkun wants to merge 11 commits intospruceUI:Developmentfrom
Open
Add power-mode and observability hooks#1397CatalyticArkun wants to merge 11 commits intospruceUI:Developmentfrom
CatalyticArkun wants to merge 11 commits intospruceUI:Developmentfrom
Conversation
Introduce a power mode runtime module and add observability/coordination hooks across scripts. Key changes: - Add power_mode.sh: implements a locked, resumable power-mode state file and helpers for running/sleep/waking/shutdown_pending with validation and generation tracking. - Refactor archiveUnpacker.sh: add state file, pre_cmd handoff (foreground/background), resumable failure states, robust silent-lock handling, UI visibility flags, more detailed logging and emit traces via system-emit; ensure cleanup and exit tracing. - Update firstboot.sh: gate completion on unpack coordinator state, add UI hold flags, timeouts, and tracing; use shared show_firstboot_screen helper. - Update helperFunctions.sh, low_power_warning.sh, networkservices.sh and various device platform scripts (AnbernicXXCommon, MiyooMini, Pixel2, SmartProS, trimui_a133p) to emit structured events (brightness/audio/network/power) and improve PyUI writer lifecycle reporting. - Add new scripts: power_mode.sh, system-emit (executable) and trace.sh (for tracing/emit support). - principal.sh: add autoresume protections and validation for /tmp/cmd_to_run.sh. Overall this improves robustness for unpacking/firstboot workflows, adds observability and tracing, and provides a canonical power-mode contract for coordinated shutdown/sleep handling.
ryanmsartor
reviewed
Mar 19, 2026
Collaborator
There was a problem hiding this comment.
are there any actual differences here? Is this just a line ending thing?
Contributor
Author
There was a problem hiding this comment.
No actual difference there - just line endings
Contributor
Author
There was a problem hiding this comment.
Reverted the line ending noise
ryanmsartor
reviewed
Mar 19, 2026
Collaborator
There was a problem hiding this comment.
are these changes inherited from Sun's branch?
Contributor
Author
There was a problem hiding this comment.
I believe these are from overhauling first boot, but I'm not sure if first boot actually requires these.
Mixed 2/6/8/10-space indent introduced around the system-emit call; align to the 4-space convention used by the rest of the while loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- firstboot.sh: fix ScummVM label ("Installing ScummVM" → "ScummVM") so
the case match in extract_7z_with_progress activates the ScummVM icon
and display-text log as intended
- helperFunctions.sh: lift log_scummvm_display_text out of the nested
position inside extract_7z_with_progress (non-standard POSIX sh; leaked
into global scope); rename to _log_scummvm_display_text with explicit
IS_SCUMMVM_SECTION and log-path args; drop dead PROGRESS_TEXT variable
- archiveUnpacker.sh: remove consume_handoff_token_if_present and its
call site — the startup guard already owns token removal on the hot
path; the function was unreachable on any other path
- networkservices.sh: fix double-tab indent on two new lines at top of
disconnect_services (same class as low_power_warning.sh fix)
- save_poweroff.sh: add missing blank line after emit_shutdown_av_trace_fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a power mode runtime module and add observability/coordination hooks across scripts. Key changes:
Overall this improves robustness for unpacking/firstboot workflows, adds observability and tracing, and provides a canonical power-mode contract for coordinated shutdown/sleep handling.