system/nxstore: add LVGL touchscreen app-store frontend#3643
Draft
aviralgarg05 wants to merge 2 commits into
Draft
system/nxstore: add LVGL touchscreen app-store frontend#3643aviralgarg05 wants to merge 2 commits into
aviralgarg05 wants to merge 2 commits into
Conversation
This was referenced Jul 16, 2026
Fill in most of what the initial nxpkg slice deferred: network sync and artifact acquisition over plain HTTP (verified via SHA-256), an install rewrite that supports network sources and reclaims state left by an interrupted previous install, and wiring update/remove/rollback/ available into the CLI. Harden the package path against untrusted input along the way: bounded memory-safety helpers and explicit size limits throughout, storage read/write hardened against partially-written files, path-traversal rejection in manifest name/version before they reach the filesystem, and a fix for a lost-update race on the shared installed-packages database (two concurrent installs of different packages could otherwise silently clobber each other's recorded state). Add an optional manifest icon field for the nxstore GUI frontend to consume, raise PKG_INDEX_MAX now that the in-memory index is heap-allocated, and document the repository layout and local server setup in system/nxpkg/README.txt. Also fixes a real build break: pkg_runtime_compat() unconditionally referenced CONFIG_ARCH_BOARD, a Kconfig string symbol with no default clause under ARCH_BOARD_CUSTOM, so it is left entirely undefined rather than defined-but-empty on a custom board - falls back to CONFIG_ARCH_BOARD_CUSTOM_NAME instead. Routes pkg_error()/pkg_info() through syslog rather than stdio, since neither is visible to a supervisor with no attached console. Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
Add nxstore, an LVGL-based frontend for nxpkg (system/nxpkg): lists packages from the local index, installs/launches the selected one, and supervises whatever it hands the screen to. Card-based app list (populate_app_list()): each row shows name, version, and description/status, install/launch state reflected via icon glyph and color (LV_SYMBOL_DOWNLOAD/PLAY, accent/success color), and a sliding-segment progress bar during install (no real byte-level progress is available from pkg_install(), so this reads as 'actively working' without fabricating a percentage). Explicit LV_STATE_PRESSED styling on every tappable row/button, since no LVGL theme is loaded and a tap would otherwise give no visual feedback at all. Supervisor screen (build_run_screen()/nxstore_enter_running_screen()): a launched app (e.g. a game that owns /dev/fb0 directly, not just another LVGL client) gets a dedicated screen with a name label and a Close button, confined to the border region the launched app's own scaled/centered framebuffer output never draws into, so switching back to it doesn't fight over pixels with whatever the app already put in the framebuffer. Close/reap handling (close_running_app_event_cb()/ nxstore_poll_running_app()): sends SIGTERM and polls waitpid(WNOHANG) for the launched pid, but explicitly also treats waitpid() returning ECHILD as 'already gone' rather than 'still running' - both the close-button handler and the passive per-loop poll independently race to reap the same child, so whichever one loses that race must not spin forever waiting for a wait() that can now never succeed. Requires the target app to install its own SIGTERM handler to exit cleanly (this is why there is no generic force-kill fallback here: an earlier version of this code called task_delete() when SIGTERM wasn't reaped quickly enough, which was found on real hardware to hang the entire board - not just the one task - when it landed mid framebuffer/heap access on this flat-memory build). Toast notifications (nxstore_toast()) provide a transient, unmissable confirmation for install/uninstall/launch outcomes and app-closed events, additive to the durable per-row subtitle text rather than a replacement for it. nxstore's own boot-time catalog sync waits (bounded, 15s) on g_wifi_dhcp_ret before attempting a network fetch, since Wi-Fi association completing doesn't imply DHCP has - an HTTP fetch attempted in that window fails with -ENETUNREACH even though the link itself is already up, indistinguishable from being genuinely offline without this wait. Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
aviralgarg05
force-pushed
the
gsoc/nxstore-app-store-ui-pr6
branch
from
July 16, 2026 08:06
1d5c451 to
ce6c2e5
Compare
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.
Note: Please adhere to Contributing Guidelines.
Summary
This is another slice of the ongoing GSoC 2026 Dynamic ELF loading and
nxpkgwork for NuttX.An earlier draft PR (#3474) carries the initial
nxpkgpackagelifecycle helper. PR #3642 extends
nxpkgwith network sync, installhardening, and the rest of its CLI (
update/remove/rollback/available). This PR adds the first graphical frontend on top of that:system/nxstore, an LVGL touchscreen app store.Series order for this PR:
branch (
gsoc/nxpkg-sync-lifecycle-hardening-pr5), notmaster,because
nxstorecallspkg_sync()/pkg_uninstall()/pkg_zalloc()/pkg_free()/pkg_metadata_find_installed()/pkg_metadata_find_latest()and readsmanifest->description— noneof which exist yet on
master, only as of system/nxpkg: network sync, install hardening, and CLI completion #3642. This PR will notbuild standalone against
masteruntil system/nxpkg: network sync, install hardening, and CLI completion #3642 merges; GitHub willretarget it automatically at that point and the diff will shrink to
just this PR's own commit.
Concretely,
nxstoreis:populate_app_list()): each row shows name,version, and description/status, install/launch state reflected via
icon glyph and color, and a sliding-segment progress bar during
install (no real byte-level progress is available from
pkg_install(), so this reads as "actively working" withoutfabricating a percentage)
build_run_screen()/nxstore_enter_running_screen()): a launched app gets a dedicatedscreen with a name label and a Close button, confined to a border
region the launched app's own framebuffer output is expected to never
draw into, so switching back to it doesn't fight over pixels with
whatever the app already put in the framebuffer
close_running_app_event_cb()/nxstore_poll_running_app()): sendsSIGTERMand pollswaitpid(WNOHANG), explicitly treatingECHILDas "already gone"rather than "still running" (the close-button handler and the passive
per-loop poll both race to reap the same child). There is
deliberately no generic force-kill fallback: an earlier version of
this code called
task_delete()whenSIGTERMwasn't reaped quicklyenough, and on real hardware that fallback landed mid
framebuffer/heap access and hung the entire board, not just the one
task, on this flat-memory build. A launched app can only be closed if
it cooperates by installing its own
SIGTERMhandlernxstore_toast()) for install/uninstall/launchoutcomes and app-closed events, additive to the durable per-row
subtitle text
sync, since Wi-Fi association completing doesn't imply DHCP has —
fetching before that resolves fails with
-ENETUNREACH, which isindistinguishable from being genuinely offline without the wait
Impact
User impact:
nxstorecommand: an on-device, touchscreen graphicalfront-end for browsing, installing, launching, and closing
nxpkgpackages, instead of driving the same flow from the
nxpkgCLI byhand
Build impact:
system/nxstoreGRAPHICS_LVGLandSYSTEM_NXPKG(and transitively,NETUTILS_CJSON/NETUTILS_WEBCLIENTvia system/nxpkg: network sync, install hardening, and CLI completion #3642)Runtime impact:
/dev/fb0) and touch input device(
/dev/input0)(
NXSTORE_LAUNCH_STACKSIZE) —posix_spawn's own default(
CONFIG_POSIX_SPAWN_DEFAULT_STACKSIZE, 2 KiB) is far too small fora real LVGL/framebuffer app and overflowing it does not fail loudly
Compatibility impact:
CONFIG_SYSTEM_NXSTOREisenabled
Testing
Host used for build:
xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0Target used for verification:
xtensaesp32s3-touch-lcd-7:nshyet upstream)
Runtime flow verified on hardware, repeatedly, across the packages this
project has shipped on top of
nxstore(a calculator, Conway's Game ofLife, a matching game, snake, brick breaker, and a Doom port — all
separate follow-on PRs):
with a progress indicator, toast on completion
supervisor bar with the Close button appears at the top of the
screen
SIGTERMis sent, the app reaps itself, and the applist reappears cleanly
Specifically re-verified in this project's most recent hardware pass,
directly relevant to
close_running_app_event_cb()in this PR: launcheda package with a previously-known Close-button regression (its own
rendering was painting over the reserved top bar every frame), tapped
Close, and confirmed via syslog that the sequence in this file executed
correctly end-to-end:
This is a draft PR, stacked on the not-yet-merged #3642 — opening now to
get the series in front of reviewers.