Create Shell task in kernel when PLATFORM_ROOTFS is disabled

If the platform doesn't support rootfs but shell and serial
console are enabled, create Shell task in kernel.
Note that normally, shell task is created by /bin/init.

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Change-Id: If3bf55313d897569b59902b07eaa042eee71a8df
This commit is contained in:
Zbigniew Bodek 2020-10-09 18:22:12 +08:00 committed by Wojciech Zmuda WX948747
parent cef02d9340
commit 01cd099ea9
1 changed files with 10 additions and 1 deletions

View File

@ -100,7 +100,16 @@ STATIC UINT32 OsShellSourceInit(INT32 consoleId)
ret = LOS_NOK;
goto ERR_OUT4;
}
if (consoleId == CONSOLE_TELNET) {
if ((consoleId == CONSOLE_TELNET)
#if !defined(LOSCFG_PLATFORM_ROOTFS)
/*
* In case of ROOTFS disabled but
* serial console enabled, it is required
* to create Shell task in kernel for it.
*/
|| (consoleId == CONSOLE_SERIAL)
#endif
) {
ret = OsShellCreateTask(shellCB);
if (ret != LOS_OK) {
goto ERR_OUT4;