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>
Replace all fwrite/fread/fgets/... to write/read/...
Before:
```
text data bss dec hex filename
109827 601 6608 117036 1c92c nuttx/nuttx
```
After:
```
text data bss dec hex filename
108053 601 6608 115262 1c23e nuttx/nuttx
```
After with CONFIG_FILE_STREAM disabled:
```
text data bss dec hex filename
105667 601 6608 112876 1b8ec nuttx/nuttx
```
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Follow: http://glennastory.net/boot/sysinit.html
This is first script that init runs is rc.sysinit. This
script does serval initialization tasks about basic service.
The boot sequence currently provided to the board level is:
board_earlyinitialize->
board_lateinitialize(Peripherals driver, core driver, ...)->
run rcS script(mount fs, run service) ->
board_appinitialize->
After this patch:
The boot sequence currently provided to the board level is:
board_earlyinitialize->
board_lateinitialize(core driver,...)->
run rc.sysinit script(mount fs, run core service) ->
board_appinitialize(Peripherals driver)->
run rcS script(run other service)->
So, Peripheral drivers can do more with the file system and
core services.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@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>
since this command change the parent environment variable and
add new '.' command which has the same functionality as 'source'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1.Avoid the code duplication
2.Call BOARDIOC_FINALINIT onnce and only once
3.Ensure BOARDIOC_FINALINIT get called in all case
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Set the 'exit on error control' and/or 'print a trace' of commands when parsing scripts in NSH. The settinngs are in effect from the point of exection, until they are changed again, or in the case of the init script, the settings are returned to the default settings when it exits.
Included child scripts will run with the parents settings and changes made in the child script will effect the parent on return.
Use 'set -e' to enable and 'set +e' to disable (ignore) the exit condition on commands. The default is -e. Errors cause script to exit.
Use 'set -x' to enable and 'set +x' to disable (silence) printing a trace of the script commands as they are ececuted. The default is +x. No printing of a trace of script commands as they are executed.