Repository navigation
Protect: use userspace to get built-in information - #20964
Merged
acassis merged 2 commits intoOct 25, 2026
Merged
Conversation
…ormation Get the builtin list from USERSPACE instead of BOARDIOC_BUILTINS. Signed-off-by: anjiahao <[email protected]> Signed-off-by: wangjianyu3 <[email protected]>
use forward declare to prevent circular dependency Signed-off-by: yangao1 <[email protected]> Signed-off-by: wangjianyu3 <[email protected]>
|
xiaoxiang781216
approved these changes
Oct 24, 2026
JianyuWang0623
marked this pull request as ready for review
October 25, 2026 01:28
JianyuWang0623
requested review from
GUIDINGLI,
gustavonihei,
jerpelea,
masayuki2009,
michallenc,
pkarashchenko,
pussuw,
yamt and
yf13
as code owners
October 25, 2026 01:28
acassis
approved these changes
Oct 25, 2026
casaroli
pushed a commit
to apache/nuttx-apps
that referenced
this pull request
Oct 25, 2026
This reverts commit d9454d8. apache/nuttx#20964 removed BOARDIOC_BUILTINS and struct boardioc_builtin_s, so nxinit no longer builds in a protected build: init.c:214:29: error: storage size of 'builtin' isn't known init.c:218:12: error: 'BOARDIOC_BUILTINS' undeclared (first use in this function) Assisted-by: Kiro:claude-opus-5.5 Signed-off-by: wangjianyu3 <[email protected]>
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.
Summary
In a protected build the kernel cannot see the user-space builtin list, so
posix_spawnp()of a builtin fails withENOENTunless user space first callsboardctl(BOARDIOC_BUILTINS). With nxinit as init, every service fails to start and there is no shell.This series publishes the builtin table through
struct userspace_sinstead, and removesBOARDIOC_BUILTINSandbuiltin_setlist().Impact
BOARDIOC_BUILTINSremoved and laterBOARDIOC_*renumbered;struct userspace_sgains two fields.kernel/*_userspace.cupdated.Testing
rv-virt:pnsh(protected + nxinit + ostest) onqemu-system-riscv32, apps at upstream master.Before (master
d17f5c91e4f), no shell:After (this PR):
esp32s3-devkit:knsh(protected + nxinit + ostest) on an ESP32-S3-WROOM-1 board:Also built
esp32s3-devkit:knsh(each commit),imxrt1050-evk:knsh,esp32s3-devkit:nsh;checkpatch.sh -c -u -m -gpasses.