mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 07:12:06 +08:00
nshlib: Add switchboot command
switchboot <image path> Switch to the updated or specified boot system. This command depends on hardware support CONFIG_BOARDCTL_SWITCH_BOOT. `<image path>` point to a partion or file which contain the firmware to boot. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:

committed by
Petro Karashchenko

parent
aa99d267b7
commit
1d3e6510e6
@@ -318,6 +318,24 @@ int cmd_poweroff(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_switchboot
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BOARDCTL_SWITCH_BOOT) && !defined(CONFIG_NSH_DISABLE_SWITCHBOOT)
|
||||
int cmd_switchboot(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
nsh_output(vtbl, g_fmtarginvalid, argv[0]);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
boardctl(BOARDIOC_SWITCH_BOOT, (uintptr_t)argv[1]);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_boot
|
||||
****************************************************************************/
|
||||
|
Reference in New Issue
Block a user