Currently NSH prompt is defined at build time, thus improper for AMP cases
where the same NSH binary is used on different nodes as the same NSH prompt
shows on all nodes.
This patch attempts to support runtime prompt string population from ordered
sources:
- the environment variable defined by NSH_PROMPT_ENV plus suffix
- the NSH_PROMPT_STRING
- the HOSTNAME plus suffix
The suffix is defined by NSH_PROMPT_SUFFIX so that to clearly separate the
command inputs.
Changes in `nshlib/`
- Kconfig: add configs NSH_PROMPT_MAX/ENV/SUFFIX etc
- nsh.h: adjust g_nshprompt defs, add nsh_update_prompt
- nsh_parse.c relocate g_nshpromt to nsh_prompt.c
- nsh_init.c revise to use nsh_update_prompt once
- nsh_session.c revise to use methods in nsh_prompt.c
- Makefile add nsh_prompt.c
- CMakeLists.txt add nsh_prompt.c
New additions in `nshlib/`
- nsh_prompt.c prompt related data structures and methods.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
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>
Gregory Nutt is has submitted the SGA
Uros Platise has submitted the ICLA
as a result we can migrate the licenses to Apache.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro
Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Squashed commit of the following:
apps/nshlib: Remove NSH initialization. Now uses the common apps/netutils/netinit logic (which was cloned from nshlib to begin with).
apps/netutils/netinit: Clone network initialization logic from NSH to this directory so that it can be available for general use.