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

   
   ## Summary
   
   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().
   
   ## Impact
   
   - **Users**: `boot <relative-path>` now resolves against the NSH cwd;
     absolute-path behavior is unchanged.
   - **Build**: None -- uses the existing `nsh_getfullpath`/`nsh_freefullpath`
     helpers, no new dependency.
   - **Hardware**: None -- NSH command logic only, no board-specific code.
   - **Documentation**: None.
   - **Security & Compatibility**: None -- behavior extension; absolute
     paths behave exactly as before.
   
   ## Testing
   
   Local build on Cortex-M55 (enables CONFIG_BOARDCTL_BOOT_IMAGE); the boot ELF 
builds and the `boot` NSH command succeeds.
   
   And the change follows the established 
`nsh_getfullpath()`/`nsh_freefullpath()` convention already used by the other 
NSH file-path commands. Representative upstream examples (the same pattern is 
also used by `mv`, `ls`, `ln`, `mkdir`, and every other NSH file-path command):
   
   - cp (src)  -- 
https://github.com/apache/nuttx-apps/blob/master/nshlib/nsh_fscmds.c#L1106
   - cp (dest) -- 
https://github.com/apache/nuttx-apps/blob/master/nshlib/nsh_fscmds.c#L1113
   - cat       -- 
https://github.com/apache/nuttx-apps/blob/master/nshlib/nsh_fscmds.c#L854
   - rm        -- 
https://github.com/apache/nuttx-apps/blob/master/nshlib/nsh_fscmds.c#L2667


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