nshlib: move etc romfs mount from nsh to nuttx

This commit corresponds to apache/nuttx#11498 in nuttx.

Move etc romfs mount to sched/init for compatibility with kernel/protected mode.

changes:
- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
  in boards, and no need declaration for romfs_img/romfs_img_len.

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
fangxinyong
2023-11-26 12:10:46 +08:00
committed by Xiang Xiao
parent c4e78cd10a
commit 385f707382
8 changed files with 15 additions and 420 deletions

View File

@@ -39,7 +39,7 @@
* Private Functions
****************************************************************************/
#if defined(CONFIG_NSH_ROMFSETC) || defined(CONFIG_NSH_ROMFSRC)
#if defined(CONFIG_ETC_ROMFS) || defined(CONFIG_NSH_ROMFSRC)
static int nsh_script_redirect(FAR struct nsh_vtbl_s *vtbl,
FAR const char *cmd,
FAR const char *path,
@@ -202,7 +202,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR char *cmd,
*
****************************************************************************/
#ifdef CONFIG_NSH_ROMFSETC
#ifdef CONFIG_ETC_ROMFS
int nsh_sysinitscript(FAR struct nsh_vtbl_s *vtbl)
{
/* Since most existing systems only use the NSH_INITPATH script file.
@@ -224,7 +224,7 @@ int nsh_sysinitscript(FAR struct nsh_vtbl_s *vtbl)
*
****************************************************************************/
#ifdef CONFIG_NSH_ROMFSETC
#ifdef CONFIG_ETC_ROMFS
int nsh_initscript(FAR struct nsh_vtbl_s *vtbl)
{
static bool initialized;
@@ -268,6 +268,6 @@ int nsh_loginscript(FAR struct nsh_vtbl_s *vtbl)
return nsh_script_redirect(vtbl, "login", NSH_RCPATH, true);
}
#endif
#endif /* CONFIG_NSH_ROMFSETC */
#endif /* CONFIG_ETC_ROMFS */
#endif /* CONFIG_NSH_DISABLESCRIPT */