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

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

commit f827a9448fbcd687cbac5e3bf0488d149399e055
Author: wangjianyu3 <[email protected]>
AuthorDate: Tue Oct 27 00:05:38 2026 +0800

    system/nxinit: add board_finalinit builtin
    
    5341a2fc turned the BOARDIOC_FINALINIT call into a pure finalinit event,
    leaving rc no way to trigger it. Add a board_finalinit builtin gated on
    CONFIG_BOARDCTL_FINALINIT and run it under the preset's on finalinit.
    
    Assisted-by: OpenCode:mimo-v2.6-pro
    Signed-off-by: wangjianyu3 <[email protected]>
---
 system/nxinit/builtin.c | 16 ++++++++++++++++
 system/nxinit/parser.c  |  5 +++++
 2 files changed, 21 insertions(+)

diff --git a/system/nxinit/builtin.c b/system/nxinit/builtin.c
index 71a847382..a0ae5382a 100644
--- a/system/nxinit/builtin.c
+++ b/system/nxinit/builtin.c
@@ -98,6 +98,10 @@ static int cmd_start_cpu(FAR struct action_manager_s *am,
 static int cmd_netinit(FAR struct action_manager_s *am,
                        int argc, FAR char **argv);
 #endif
+#ifdef CONFIG_BOARDCTL_FINALINIT
+static int cmd_board_finalinit(FAR struct action_manager_s *am,
+                               int argc, FAR char **argv);
+#endif
 #ifdef CONFIG_RPTUN
 static int cmd_rptun(FAR struct action_manager_s *am,
                      int argc, FAR char **argv);
@@ -111,6 +115,9 @@ static int cmd_unlink(FAR struct action_manager_s *am,
 
 static const struct cmd_map_s g_builtin[] =
 {
+#ifdef CONFIG_BOARDCTL_FINALINIT
+  {"board_finalinit", 1, 1, cmd_board_finalinit},
+#endif
 #ifdef CONFIG_BOARDCTL_BOOT_IMAGE
   {"boot", 1, 3, cmd_boot},
 #endif
@@ -194,6 +201,15 @@ static int cmd_netinit(FAR struct action_manager_s *am,
 }
 #endif
 
+#ifdef CONFIG_BOARDCTL_FINALINIT
+static int cmd_board_finalinit(FAR struct action_manager_s *am,
+                               int argc, FAR char **argv)
+{
+  UNUSED(am);
+  return boardctl(BOARDIOC_FINALINIT, 0);
+}
+#endif
+
 static int cmd_class_start(FAR struct action_manager_s *am,
                            int argc, FAR char **argv)
 {
diff --git a/system/nxinit/parser.c b/system/nxinit/parser.c
index 8f2177cf8..e3f37ee15 100644
--- a/system/nxinit/parser.c
+++ b/system/nxinit/parser.c
@@ -346,6 +346,11 @@ int init_parse_configs(FAR const struct parser_s *parser)
 #ifdef CONFIG_NETUTILS_NETINIT
     "on netinit\n"
     "   netinit\n"
+#endif
+#if defined(CONFIG_SYSTEM_NXINIT_FINALINIT) && \
+    defined(CONFIG_BOARDCTL_FINALINIT)
+    "on finalinit\n"
+    "   board_finalinit\n"
 #endif
     ;
   FAR const char *path = CONFIG_SYSTEM_NXINIT_RC_FILE_PATH;

Reply via email to