system/nxpkg: network sync, install hardening, and CLI completion#3642
Draft
aviralgarg05 wants to merge 1 commit into
Draft
system/nxpkg: network sync, install hardening, and CLI completion#3642aviralgarg05 wants to merge 1 commit into
aviralgarg05 wants to merge 1 commit into
Conversation
This was referenced Jul 16, 2026
aviralgarg05
force-pushed
the
gsoc/nxpkg-sync-lifecycle-hardening-pr5
branch
from
July 16, 2026 08:06
59fd472 to
d33ae3b
Compare
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. Assisted-by: Claude <noreply@anthropic.com> Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
aviralgarg05
force-pushed
the
gsoc/nxpkg-sync-lifecycle-hardening-pr5
branch
from
July 17, 2026 19:47
d33ae3b to
c4f639c
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 PR completes the package lifecycle work introduced in #3474. The initial
implementation supported local metadata and basic install/list operations;
this change adds the network and lifecycle operations needed to use
nxpkgasa practical on-device package manager.
The main changes are:
verification of downloaded artifacts;
sync,update,remove,rollback, andavailableCLIpaths, and allow
installto use either local or network sources;repository-provided data;
installed-package database so concurrent installs cannot overwrite one
another;
CONFIG_ARCH_BOARD_CUSTOM_NAMEwhenCONFIG_ARCH_BOARDis not defined;syslog, which also works when no consoleis attached; and
system/nxpkg/README.txt.This PR depends on the package lifecycle foundation merged in #3474. #3643 is
a graphical frontend that depends on the APIs added here; #3644 is independent.
Impact
When
CONFIG_SYSTEM_NXPKGis enabled, users gain a complete package lifecycle:repository sync, local or remote installation, update, removal, rollback,
listing, and discovery of available packages.
Network operations additionally require
CONFIG_NETUTILS_WEBCLIENT; theexisting
CONFIG_NETUTILS_CJSONdependency remains. Local-only installationsdo not require network access.
The install path now performs network I/O when given a remote source and uses a
global lock while updating installed-package state. Repository metadata is
treated as untrusted input, including path components and declared sizes.
Existing applications are unaffected unless
CONFIG_SYSTEM_NXPKGis enabled.The on-disk development format has gained fields for icon and transaction
state; no migration is provided because the format introduced by #3474 has not
appeared in a release.
Testing
Build host:
xtensa-esp-elf-gcc 14.2.0(esp-14.2.0_20241119)Target:
esp32s3-touch-lcd-7:nshon a Waveshare ESP32-S3-Touch-LCD-7(custom, not-yet-upstream board configuration)
The complete image was built and the package lifecycle was exercised repeatedly
on the physical board. The verified flows included repository sync from a local
HTTP server, remote install, update, removal, rollback, listing, and application
launch. Interrupted install state was recreated and successfully reclaimed.
Two different packages were also installed concurrently; both remained present
in the installed-package database after completion.
The custom-board compatibility fix was checked against the generated
include/nuttx/config.h, whereCONFIG_ARCH_BOARDis absent andCONFIG_ARCH_BOARD_CUSTOM_NAMEis defined: