From 01cd099ea98a051a9f12c38e116b13a8d31357e0 Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Fri, 9 Oct 2020 18:22:12 +0800 Subject: [PATCH] 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 Change-Id: If3bf55313d897569b59902b07eaa042eee71a8df --- shell/full/src/base/show.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/shell/full/src/base/show.c b/shell/full/src/base/show.c index 4b9cce00..122c0480 100644 --- a/shell/full/src/base/show.c +++ b/shell/full/src/base/show.c @@ -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;