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

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

commit 5eae4c8f15d5d142ea31e65f8865c7655ff0531d
Author: yangsong8 <[email protected]>
AuthorDate: Sun Jul 27 21:08:05 2025 +0800

    apps/fastboot: Enable network via ioctl during fastboot initialization
    
    Bring up the network when do fastboot tcp init.
    
    Signed-off-by: yangsong8 <[email protected]>
---
 system/fastboot/Kconfig    |  7 +++++++
 system/fastboot/fastboot.c | 10 ++++++++++
 2 files changed, 17 insertions(+)

diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig
index f5b14cd02..0842bcb0d 100644
--- a/system/fastboot/Kconfig
+++ b/system/fastboot/Kconfig
@@ -45,4 +45,11 @@ config SYSTEM_FASTBOOTD_SHELL
                e.g. fastboot oem shell ps
                e.g. fastboot oem shell "mkrd -m 10 -s 512 640"
 
+config SYSTEM_FASTBOOTD_NET_INIT
+       bool "Network initialization"
+       default n
+       select NETUTILS_NETINIT
+       ---help---
+               This option enables/disables all network initialization in 
fastboot server.
+
 endif # SYSTEM_FASTBOOTD
diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c
index b20be6b7d..2a24e9b9f 100644
--- a/system/fastboot/fastboot.c
+++ b/system/fastboot/fastboot.c
@@ -52,6 +52,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#ifdef CONFIG_SYSTEM_FASTBOOTD_NET_INIT
+#  include "netutils/netinit.h"
+#endif
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
@@ -1259,6 +1263,12 @@ static int fastboot_tcp_initialize(FAR struct 
fastboot_ctx_s *ctx)
 {
   struct sockaddr_in addr;
 
+#ifdef CONFIG_SYSTEM_FASTBOOTD_NET_INIT
+  /* Bring up the network */
+
+  netinit_bringup();
+#endif
+
   ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM,
                            SOCK_CLOEXEC | SOCK_NONBLOCK);
   if (ctx->tran_fd[0] < 0)

Reply via email to