Junbo-Zheng opened a new pull request, #3705:
URL: https://github.com/apache/nuttx-apps/pull/3705

   ## Summary
   
   A bare `boot` (no argument, argc == 1) passes `argv[1] == NULL`. 
nsh_getfullpath(NULL) returns `strdup(g_home) == "/"` 
https://github.com/apache/nuttx-apps/blob/6e61ce7cb7cce474572e32f3f837361ec18f1f62/nshlib/nsh_envcmds.c#L191-L203
  instead of `NULL`, which turned the default-boot path (NULL -> board default 
image) into `"/"`.  `board_boot_image("/")` then failed with -`EINVAL (-22)`, 
preventing the board from booting.
   
   Guard the `nsh_getfullpath()` call so NULL passes through unchanged, 
restoring the original default-boot behavior while still resolving relative 
paths when an argument is given.
   
   This fixes the regression introduced by the relative-path support
   ```bash
   commit fabafbc3615b3d22636bbf33f932578f491bef23 (origin/master, origin/HEAD)
   Author: Junbo Zheng <[email protected]>
   Date:   Fri Jul 24 23:47:44 2026 +0800
   
       nshlib: add relative image path support in boot command
   
       cmd_boot passed the image path straight to boardctl(), which resolves
       it in a context that does not inherit the NSH shell cwd, so relative
       paths failed and only absolute paths worked. Use nsh_getfullpath() to
       resolve relative paths against the cwd before calling boardctl().
   
       Signed-off-by: Junbo Zheng <[email protected]>
   ```
   
   ## Impact
   
   - Users: Fixes a regression where bare boot (no image argument) stopped 
working after the relative-path support boot now works again
   - Build: None -- one-line source change, no con change.
   - Hardware: None -- no board-specific logic touched; affects all boards 
using NSH boot.
   - Documentation: None.
   - Security & Compatibility: None
   
   ## Testing
   
   Passed internal CT tests by running boot with no argument
   
   - before, it returned `-EINVAL` and no boot occurred
   - after, the default boot path proceeds
   
   Signed-off-by: Junbo Zheng <[email protected]>


-- 
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