boards/lckfb-szpi-esp32s3: switch adb config to nxinit entrypoint

Replace the default nsh-based init flow on the lckfb-szpi-esp32s3 :adb
defconfig with system/nxinit so that services (sh console, adbd) are
spawned and reaped by init through /etc/init.d/init.rc.

- Enable CONFIG_SYSTEM_NXINIT and set INIT_ENTRYPOINT to init_main
  (CONFIG_EXPERIMENTAL is required by SYSTEM_NXINIT).
- Add a common init.rc under boards/xtensa/esp32s3/common/src/etc/init.d
  defining 'console' (sh) and 'adbd' services and starting both on init.
  fastbootd is wired in for completeness when configured.
- Append the new init.rc to RCSRCS only when SYSTEM_NXINIT is enabled
  so existing nsh-based configs remain unaffected.

Verified on lckfb-szpi-esp32s3 hardware: init_main spawns sh and adbd
(both with PPID=init), 'adb shell' reaches a working NuttShell.

Assisted-by: GitHubCopilot:claude-4.8-opus
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2026-06-02 18:56:37 +08:00 committed by Lup Yuen Lee
parent db1035f820
commit 9e66023307
3 changed files with 53 additions and 0 deletions

View file

@ -112,6 +112,9 @@ endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
ifeq ($(CONFIG_SYSTEM_NXINIT),y)
RCSRCS += etc/init.d/init.rc
endif
ifeq ($(CONFIG_TXTABLE_PARTITION),y)
RCRAWS = etc/txtable.txt
endif

View file

@ -0,0 +1,47 @@
/****************************************************************************
* boards/xtensa/esp32s3/common/src/etc/init.d/init.rc
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#include <nuttx/config.h>
#ifdef CONFIG_SYSTEM_NSH
service console sh
restart_period 1000
#endif
#ifdef CONFIG_SYSTEM_ADBD
service adbd adbd
#endif
#ifdef CONFIG_SYSTEM_FASTBOOTD
service fastbootd fastbootd
#endif
on init
#ifdef CONFIG_SYSTEM_NSH
start console
#endif
#ifdef CONFIG_SYSTEM_ADBD
start adbd
#endif
#ifdef CONFIG_SYSTEM_FASTBOOTD
start fastbootd
#endif

View file

@ -10,7 +10,9 @@ CONFIG_DEBUG_MM=y
CONFIG_ESP32S3_OTG_ENDPOINT_NUM=2
CONFIG_ETC_ROMFS=y
CONFIG_EXAMPLES_USBSERIAL=n
CONFIG_EXPERIMENTAL=y
CONFIG_FS_ROMFS=y
CONFIG_INIT_ENTRYPOINT="init_main"
CONFIG_LIBC_EXECFUNCS=y
CONFIG_LIBUV=y
CONFIG_MM_BACKTRACE=0
@ -25,6 +27,7 @@ CONFIG_STACK_COLORATION=y
CONFIG_STACK_USAGE=y
CONFIG_SYSLOG_CHARDEV=y
CONFIG_SYSTEM_ADBD=y
CONFIG_SYSTEM_NXINIT=y
CONFIG_TLS_NCLEANUP=4
CONFIG_TLS_NELEM=4
CONFIG_TLS_TASK_NELEM=4