casaroli opened a new pull request, #3907:
URL: https://github.com/apache/nuttx-apps/pull/3907

   ## Summary
   
   In a protected build the kernel cannot read the list of builtin applications 
in user space. The binfmt builtin loader uses its own copy of the list, which 
user space must set with `boardctl(BOARDIOC_BUILTINS)`. NSH starts a builtin 
with `task_spawn()` and does not use the loader, so it never needed this. 
nxinit starts each service with `posix_spawnp()`, which goes through the 
loader, so in a protected build every builtin service fails with `ENOENT`.
   
   `esp32s3-devkit:knsh` uses nxinit as init and never gets a shell:
   
   ```
   Error Starting service 'console': 2
   ```
   
   `init_main()` now gives the list to the kernel first, when 
`CONFIG_BUILD_PROTECTED`, `CONFIG_BUILTIN` and `CONFIG_BOARDCTL` are set.
   
   ## Impact
   
   nxinit in protected builds only. Flat and kernel builds do not compile the 
new code.
   
   ## Testing
   
   ESP32-S3-DevKitC with an ESP32-S3-WROOM-2-N32R8V (`esp32s3-devkit:knsh`, 
protected build, stock defconfig with nxinit as init, plus 
`CONFIG_TESTING_OSTEST`), nuttx master:
   
   | | apps master | this PR |
   |---|---|---|
   | boot | `Error Starting service 'console': 2` in a loop, no shell | nxinit 
starts `sh`, NSH prompt |
   | `ostest` | (no shell) | status 0 |
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to