This is an automated email from the ASF dual-hosted git repository.

linguini1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 73c949c87e5 boards/lckfb-szpi-esp32s3: switch adb config to nxinit 
entrypoint
73c949c87e5 is described below

commit 73c949c87e5a02e1342c10f027430f1a831daad2
Author: wangjianyu3 <[email protected]>
AuthorDate: Tue Jun 2 18:56:37 2026 +0800

    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 <[email protected]>
---
 boards/xtensa/esp32s3/common/src/Make.defs         |  3 ++
 .../xtensa/esp32s3/common/src/etc/init.d/init.rc   | 47 ++++++++++++++++++++++
 .../lckfb-szpi-esp32s3/configs/adb/defconfig       |  3 ++
 3 files changed, 53 insertions(+)

diff --git a/boards/xtensa/esp32s3/common/src/Make.defs 
b/boards/xtensa/esp32s3/common/src/Make.defs
index 2e82b0c5849..2a8c30a8588 100644
--- a/boards/xtensa/esp32s3/common/src/Make.defs
+++ b/boards/xtensa/esp32s3/common/src/Make.defs
@@ -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
diff --git a/boards/xtensa/esp32s3/common/src/etc/init.d/init.rc 
b/boards/xtensa/esp32s3/common/src/etc/init.d/init.rc
new file mode 100644
index 00000000000..44d885ea956
--- /dev/null
+++ b/boards/xtensa/esp32s3/common/src/etc/init.d/init.rc
@@ -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
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/adb/defconfig 
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/adb/defconfig
index b7c2ec9ef9e..51e828310a4 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/adb/defconfig
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/adb/defconfig
@@ -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

Reply via email to