The patch step currently uses a phony target, so it is executed
again when the build is repeated in the same source tree. In that
case `patch -N` detects previously applied patches and returns 1,
which make treats as a failure.
Replace the phony patch target with a stamped `.patched` file so
the patch step is not re-run unnecessarily.
Fixes#3188
Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
This is necessary because new defconfig were recently added to
Xtensa-based Espressif SoCs and the build job may exceed 2 hours.
In order to avoid increasing job timeout, a specific job for each
supported SoC (ESP32, ESP32-S2 and ESP32-S3) was created instead.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
This adds support for testing PBKDF2 implementation. Test
vectors for SHA1 are taken from RFC6070. SHA256 vectors
were extrapolated using an online PBKDF2 generator which
was checked against RFC6070.
Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
Fix mismatch on apps directory naming when it is cloned under 'nuttx-apps' instead of 'apps'.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
When a command has no arguments (e.g., 'q', 'quit', 'stop'), the strtok_r()
function returns NULL for the arg parameter. The argument trimming loop was
dereferencing this NULL pointer without checking, causing undefined behavior
and system hang on ESP32-S3.
This commit adds a null check before dereferencing the arg pointer in the
leading space trimming loop.
Tested on ESP32-S3 (lckfb-szpi-esp32s3) - quit command now works correctly.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
SOCK_CLOEXEC and SOCK_NONBLOCK were incorrectly passed as the
third argument (protocol) instead of being OR'd into the second
argument (type). This caused socket() to fail with EPROTONOSUPPORT
(errno 93) on NuttX.
Move SOCK_CLOEXEC | SOCK_NONBLOCK to the type parameter and set
protocol to 0.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
fix compilation error:
sensorscope_main.c:314:3: error: implicit declaration of function 'list_initialize'; did you mean 'fs_initialize'? [-Wimplicit-function-declaration]
Signed-off-by: raiden00pl <raiden00@railab.me>
The header variable in nxboot_perform_update() is no longer
used after validate_image() was changed to take only the fd.
Signed-off-by: Neil Berkman <neil@xuku.com>
The comment previously stated CRC was not calculated before
boot. This is no longer accurate after adding full image CRC
validation in validate_image().
Signed-off-by: Neil Berkman <neil@xuku.com>
Two hardening fixes for nxboot power-loss resilience:
1. Add flash_partition_flush() calls between critical partition
operations in perform_update(). Without explicit flush barriers,
writes may remain buffered in RAM (e.g. via FTL rwbuffer) when
nxboot proceeds to the next phase. A power loss between phases
can leave the recovery image uncommitted while the staging
partition has already been consumed.
Flush points added:
- After copy_partition(primary, recovery) completes
- After copy_partition(update, primary) completes, before
erasing the staging first sector
2. Replace validate_image_header() with validate_image() in the
final primary validation path of nxboot_perform_update(). The
header-only check validates magic and platform identifier but
does not CRC-check the image body. After an interrupted update,
a corrupt primary with an intact header would pass this check
and be booted, resulting in a persistent boot failure.
Signed-off-by: Neil Berkman <neil@xuku.com>
Add missing #include <sys/boardctl.h> in camera_bkgd.c to fix
implicit declaration of boardctl() and undeclared BOARDIOC_NX_START.
Also fix capture_num check in camera_main.c to only apply still
capture size enumeration when capture_type is STILL_CAPTURE.
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
rmtchar_main.c is coming after rmtchar_common.c, which causes an
undefined reference error. This change fixes the problem.
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Remove quotes around target-pointer-width values in i486 and x86_64
target configuration files to change from string to numeric type.
This change is required due to recent rustc JSON format modifications
that expect numeric values instead of strings for target-pointer-width.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
X86 support for Rust needs more test and verification, and not
upstreamed to Rust side yet.
It's better to use custom target triples for x86 by json files for now,
and it can be upstreamed to Rust side if stable enough.
Changed the Rust target triples in the CMake configuration to reference JSON files for x86_64 and i486 architectures. This improves the build process by providing more detailed target specifications.
* Added JSON files for i486 and x86_64 targets
* Updated CMake functions to use the new target triples
* Enhanced build directory structure for Rust crates
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
ARCHTYPE is a valid abbreviation for 'architecture type' used
consistently across the codebase. This matches the nuttx repo's
.codespellrc configuration.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Replace deprecated -Zbuild-std-features=panic_immediate_abort with
-Cpanic=immediate-abort compiler flag via RUSTFLAGS.
The panic_immediate_abort feature has been stabilized as a real panic
strategy in recent Rust nightly versions. The old method of enabling
it via -Zbuild-std-features is no longer supported and triggers a
compile error in core/src/panicking.rs.
Changes:
* cmake/nuttx_add_rust.cmake: Use RUSTFLAGS with -Cpanic=immediate-abort
* tools/Rust.mk: Use RUSTFLAGS with -Cpanic=immediate-abort
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Use PRIdOFF instead of %ld for off_t arguments in flash.c syslog
calls, fixing -Wformat errors when off_t is not long.
Change nxboot_progress parameter from enum progress_type_e to int
to avoid undefined behavior from va_start on a parameter that
undergoes default argument promotion (-Wvarargs).
Signed-off-by: Neil Berkman <neil@xuku.com>
Modify the switch cases in parsearg function for QOS levels definition.
The comparison was made between a long value and a char.
Signed-off-by: Mihai Pacuraru <mpacuraru@protonmail.com>
This commit refactored the hrtimer_test and provided significantly
improved test-cases for both SMP and non-SMP.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
For QEMU, virtual CPUs can be preempted by any high priority thread in
test environments. This can cause the timer to be triggered later than
expected. This commit increased the tolerant latency to avoid the test
failures.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit fixed the hrtimer test.
In a QEMU environment, the hrtimer latency can be arbitrary because vCPUs can be preempted. We can not assert the latency. we can only issue alerts for excessively high latency.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
When NSH_ARCHINIT is not enabled, initialization is to be performed by
boardctl(BOARDIOC_INIT). However, the boardctl header is not included so
this causes compilation to fail. This commit corrects that issue.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This PR replicates the new PR Labeling Workflow from NuttX Repo to NuttX Apps Repo. For Future Syncing:
- Copy from NuttX Repo to NuttX Apps: `.github/workflows/labeler.yml` and `.github/workflows/pr_labeler.yml`
- Edit `.github/workflows/labeler.yml` and change `repository: apache/nuttx` to `repository: apache/nuttx-apps`
- Don't overwrite `.github/labeler.yml` by NuttX Repo
The new workflow reimplements PR Labeling with two triggers: pull_request and workflow_run. We no longer need pull_request_target, which is an unsafe trigger and may introduce security vulnerabilities.
The New PR Labeler is explained here:
- https://lupyuen.org/articles/prtarget
- https://github.com/apache/nuttx/issues/18359
Modified Files:
`.github/workflows/labeler.yml`: Changed the (read-write) pull_request_target trigger to (read-only) pull_request trigger. Compute the Size Label (e.g. Size: XS) and Arch Labels (e.g. Area: Examples). Save the PR Labels into a PR Artifact.
`.github/labeler.yml`: Added comment to clarify that NuttX PR Labeler only supports a subset of the `actions/labeler` syntax: `changed-files` and `any-glob-to-any-file`. Note: Don't overwrite this file by NuttX Repo.
New Files:
`.github/workflows/pr_labeler.yml`: Contains the workflow_run trigger, which is executed upon completion of the pull_request trigger. Download the PR Labels from the PR Artifact. Write the PR Labels into the PR.
Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.
BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_PYTHON_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.
BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_MINIBASIC_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.
BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_LUA_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Aligns `CONFIG_INTERPRETER_*` options to `CONFIG_INTERPRETERS_*` options
to be consistent with other interpreters.
BREAKING CHANGE: All configurations using `CONFIG_INTERPRETER_BAS_*`
options will no longer compile due to missing symbol errors. The fix is
very quick: any configurations using this options should add a trailing
S following INTERPRETER in the affected Kconfig variables. I believe
`./tools/refresh.sh` should also be capable of doing this automatically.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>