system/nxpkg: add a basic package lifecycle helper#3474
Conversation
|
Please follow the PR template and include more testing information. How did you verify the runtime path? Can you explain a little more about what nxpkg does? |
|
Thanks for the review. I’ve updated the PR description to follow the template, added more detail about what I also pushed a small follow-up change to address the For a bit of context, this PR is also part of my GSoC work, and I’m intentionally submitting it in smaller scoped pieces so the basic app-side Please take another look when you get a chance. |
Looks better! Just an FYI, the contributing guide states a "zero trust approach to testing". This means that you should include full log output from your tests, not just a verbal description of your steps (although that's good to include alongside the logs) |
|
Thanks, that is helpful. I have updated the PR description again and added the ROMFS-backed fixture script plus the relevant runtime transcript from the XIAO board validation, so the testing section now includes concrete command/output alongside the step summary. |
I will start a thread on the dev@ mailing list for this purpose. I think there should be a draft documentation that is easy to edit, maybe asf confluence wiki? :-) |
|
Thanks @cederom , this is very helpful. The BASE vs USERLAND separation is a very useful way to think about it, and I agree that the concept/architecture should be written down clearly as the work grows. I’ll follow the dev@ discussion and keep the next steps aligned with that broader design direction, while continuing to keep the current implementation in small reviewable pieces. |
| #define PKG_REPO_DIR "/data/repo" | ||
| #define PKG_REPO_INDEX "/data/repo/index.json" | ||
| #define PKG_REPO_INSTALLED "/data/repo/installed.json" | ||
| #define PKG_STORE_DIR "/data/pkgs" | ||
| #define PKG_TMP_DIR "/data/tmp" | ||
| #define PKG_TMP_PKG_DIR "/data/tmp/pkg" |
There was a problem hiding this comment.
@aviralgarg05 I agree with @cederom some of these files should be moved to /etc/nxpkg and others to /var/ (where /var is a TMPFS mounted partition that will be lost after reboot)
| if (strcmp(manifest->arch, pkg_runtime_arch()) != 0) | ||
| { | ||
| return -EXDEV; | ||
| } | ||
|
|
||
| if (strcmp(manifest->compat, pkg_runtime_compat()) != 0) | ||
| { | ||
| return -EXDEV; | ||
| } |
There was a problem hiding this comment.
If you return different errno here, it could be easier to track the root cause of the issue later
|
@aviralgarg05 Please submit an initial Documentation to nxpkg to be included at Applications section of the nuttx/Documentation/ |
Note: Please adhere to Contributing Guidelines.
Summary
This adds the first
nxpkgapplication undersystem/nxpkg.nxpkgis a small local-first package helper for Dynamic ELF applications. Inthis initial form, it reads package metadata from a local repository index,
verifies compatibility and SHA-256 integrity for a staged payload, installs the
payload into a versioned on-device store, and records installed package state so
it can be queried later with
list.The goal of this initial slice is to provide a small, usable package lifecycle
helper for Dynamic ELF content without trying to solve the full package
management problem in one change.
This PR includes:
nxpkgcommand entry point and subcommand dispatchinstall/listflowThis PR intentionally does not include:
nuttxThose items will follow in later PRs.
Impact
User impact:
nxpkgcommand innuttx-appsBuild impact:
system/nxpkgNETUTILS_CJSONRuntime impact:
install/listCompatibility impact:
CONFIG_SYSTEM_NXPKGis enabledTesting
Host used for build:
xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20241119) 14.2.0Target used for verification:
xtensaesp32s3-xiao:elfVerification performed:
nxpkgapplication path in the active XIAO ELF worktreenuttxvalidation branchRuntime flow verified on hardware:
nxpkgbuiltin is present and prints usageelfnxpkg install hellonxpkg listROMFS-backed fixture script used for the package-path validation:
Relevant runtime transcript captured during validation:
Observed runtime result:
nxpkg installcompleted successfully for the localhelloELF payloadnxpkg listreported the installed package state correctly on target