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


The following commit(s) were added to refs/heads/master by this push:
     new a65a5372f examples/fbcon: Do not require a builtin registry to spawn 
the shell.
a65a5372f is described below

commit a65a5372f9b3c44820102b7a551aeb9d9435b186
Author: Justin Hammond <[email protected]>
AuthorDate: Fri Aug 7 19:52:24 2026 +0800

    examples/fbcon: Do not require a builtin registry to spawn the shell.
    
    fbcon asked the registry of built-in applications for the stack size and
    priority to spawn its shell with.  A kernel build has no such registry:
    its programs are ELF files in a filesystem, which is exactly what the
    posix_spawn() below already handles, PATH search and all.  The lookup
    therefore fails to compile there.
    
    Ask the registry only where there is one, and take the numbers from this
    example's own configuration otherwise.
    
    Tested on an EIC7700 EVB in a kernel build: fbcon renders its console on
    a 1080p HDMI framebuffer and spawns a shell whose prompt appears on the
    monitor.
    
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Justin Hammond <[email protected]>
---
 examples/fbcon/fbcon_main.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/examples/fbcon/fbcon_main.c b/examples/fbcon/fbcon_main.c
index da0833800..7736d36e6 100644
--- a/examples/fbcon/fbcon_main.c
+++ b/examples/fbcon/fbcon_main.c
@@ -2379,7 +2379,9 @@ int main(int argc, FAR char *argv[])
   pid_t                       pid;
   posix_spawn_file_actions_t  actions;
   posix_spawnattr_t           attr;
+#ifdef CONFIG_BUILTIN
   FAR const struct builtin_s *builtin;
+#endif
   int                         exitcode = FBCON_EXIT_SUCCESS;
   FAR const char             *fbdev   = CONFIG_EXAMPLES_FBCON_DEF_FB;
 
@@ -2583,6 +2585,7 @@ int main(int argc, FAR char *argv[])
 
 #endif /* CONFIG_EXAMPLES_FBCON_PIPE_STDIN */
 
+#ifdef CONFIG_BUILTIN
   index = builtin_isavail(SPAWN_TASK);
   if (index < 0)
     {
@@ -2600,6 +2603,7 @@ int main(int argc, FAR char *argv[])
       exitcode = FBCON_EXIT_APP_INDEX_UNAVAILABLE;
       goto errout;
     }
+#endif
 
   /* Set up for app/task spawn */
 
@@ -2612,8 +2616,19 @@ int main(int argc, FAR char *argv[])
       goto errout;
     }
 
+#ifdef CONFIG_BUILTIN
   attr.stacksize = builtin->stacksize;
   attr.priority  = builtin->priority;
+#else
+  /* No registry of built-in applications to ask: a kernel build spawns
+   * programs from the filesystem, and posix_spawn() below finds this one
+   * on PATH.  Its stack and priority come from this example's own
+   * configuration instead.
+   */
+
+  attr.stacksize = CONFIG_EXAMPLES_FBCON_STACKSIZE;
+  attr.priority  = CONFIG_EXAMPLES_FBCON_PRIORITY;
+#endif
 
   /* Spawn required application                                             */
 

Reply via email to