xiaoxiang781216 commented on code in PR #1697:
URL: https://github.com/apache/nuttx-apps/pull/1697#discussion_r1156221756


##########
nshlib/nsh_syscmds.c:
##########
@@ -318,6 +318,52 @@ int cmd_poweroff(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char **argv)
 }
 #endif
 
+/****************************************************************************
+ * Name: cmd_boot
+ ****************************************************************************/
+
+#if defined(CONFIG_BOARDCTL_BOOT_IMAGE) && !defined(CONFIG_NSH_DISABLE_BOOT)
+int cmd_boot(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
+{
+  struct boardioc_boot_info_s info;
+
+  memset(&info, 0, sizeof(info));
+
+  /* Invoke the BOARDIOC_BOOT_IMAGE board control to reset the board.  If
+   * the board_boot_image() function returns, then it was not possible to
+   * boot the image due to some constraints.
+   */
+
+  switch (argc)
+    {
+      default:
+        info.header_size = strtoul(argv[2], NULL, 0);
+
+        /* Go through */
+
+      case 1:
+        info.path = argv[1];
+
+        /* Go through */
+
+      case 0:
+
+        /* Nothing to do */

Review Comment:
   It intent to allow the empty image path to allow the board specific code to 
select the best next partition to boot.
   The help also indicate this possibility:
   ```
   { "boot",     cmd_boot,     1, 3, "[<image path> [<header size>]]" },
   ```



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to