Skip to content

Conversation

@JianyuWang0623
Copy link
Contributor

@JianyuWang0623 JianyuWang0623 commented Oct 20, 2025

Summary

Switch the INIT_ENTRYPOINT from nsh_main to init_main, and let Init launch the necessary services: console and fastboot.

Related changes:

The impact of Init and NSH on ELF size

Typical scenario: High sensitivity to code size, with no requirement for a shell.

Config Changes ELF Size(bytes)
defconfig 7,008,056
+ETC_ROMFS 7,066,048
+INIT 7,127,536
-TELENT 7,127,024
-NSH_LIBRARY
-SYSTEM_NSH
6,509,392

For the ELF file, Init requires 61,488 bytes, while NSH and NSH_LIBRARY together require 617,632 bytes(without non-essential functions: 220,184 bytes). Switching from NSH to Init can save a significant amount of space. (updated)

Depends on apache/nuttx-apps#3192

Impact

  • qemu-armv8a:fastboot

Testing

Selftest

LD: nuttx
Memory region         Used Size  Region Size  %age Used
CP: nuttx.hex
CP: nuttx.bin
[    0.010000] parsing /etc/init.d/init.rc
[    0.010000] line   1: 'on init'
[    0.010000] new section (on)
[    0.010000] add action 0x4042a270(init) to manager 0x4042a090
[    0.010000] line   2: '    class_start core'
[    0.010000] add command 0x4042a2d0(class_start) to action 0x4042a270
[    0.010000]   argv[0] 'class_start'
[    0.010000]   argv[1] 'core'
[    0.010000] line   3: 'service console sh'
[    0.010000] new section (service)
[    0.010000] line   4: '    class core'
[    0.010000] apply option[0] 0x40290b68 for class
[    0.010000]   argv[0] 'class'
[    0.010000]   argv[1] 'core'
[    0.020000] line   5: '    restart_period 1000'
[    0.020000] apply option[2] 0x40290b48 for restart_period
[    0.020000]   argv[0] 'restart_period'
[    0.020000]   argv[1] '1000'
[    0.020000] line   6: 'service fastboot fastbootd'
[    0.020000] new section (service)
[    0.020000] line   7: '    class core'
[    0.020000] apply option[0] 0x40290b68 for class
[    0.020000]   argv[0] 'class'
[    0.020000]   argv[1] 'core'
[    0.020000] line   8: '    restart_period 7000'
[    0.020000] apply option[2] 0x40290b48 for restart_period
[    0.020000]   argv[0] 'restart_period'
[    0.020000]   argv[1] '7000'
[    0.020000] == Dump Actions ==
[    0.020000] action 0x4042a270
[    0.020000]   event trigger: 'init'
[    0.020000]   argv[0] 'class_start'
[    0.020000]   argv[1] 'core'
[    0.020000] == Dump Services ==
[    0.020000] Service 0x4042a370 name 'console' path 'sh'
[    0.020000]   pid: 0
[    0.020000]   arguments:
[    0.020000]       [0] 'service'
[    0.020000]       [1] 'console'
[    0.020000]       [2] 'sh'
[    0.020000]   classes:
[    0.020000]     'core'
[    0.020000]   restart_period: 1000
[    0.020000] Service 0x4042a490 name 'fastboot' path 'fastbootd'
[    0.020000]   pid: 0
[    0.020000]   arguments:
[    0.020000]       [0] 'service'
[    0.020000]       [1] 'fastboot'
[    0.020000]       [2] 'fastbootd'
[    0.020000]   classes:
[    0.020000]     'core'
[    0.020000]   restart_period: 7000
[    0.020000] add event [0] 'boot'
[    0.040000] add event [1] 'init'
[    0.040000] add event [2] 'netinit'
[    0.040000] remove event [0] 'boot'
[    0.040000] add ready 0x4042a2d0 class_start
[    0.040000] executing command 'class_start'
[    0.040000] starting service 'console' ...
[    0.040000] service 'console' flag 0x0 add 0x4
[    0.040000]   +flag 'running'
[    0.040000] service 'console' flag 0x4 add 0x8
[    0.040000]   -flag 'restarting'
[    0.040000] service 'console' flag 0x4 add 0x1
[    0.040000]   -flag 'disabled'
[    0.040000] started service 'console' pid 4
[    0.040000] starting service 'fastboot' ...
[    0.040000] service 'fastboot' flag 0x0 add 0x4
[    0.040000]   +flag 'running'
[    0.040000] service 'fastboot' flag 0x4 add 0x8
[    0.040000]   -flag 'restarting'
[    0.040000] service 'fastboot' flag 0x4 add 0x1
[    0.040000]   -flag 'disabled'
[    0.040000] started service 'fastboot' pid 5
[    0.050000] remove event [1] 'init'
[    0.050000] remove event [2] 'netinit'
nsh> ps
  PID  PPID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK    USED FILLED COMMAND
    0     0     0   0 FIFO     Kthread   - Ready              0000000000000000 0008160 0000928  11.3%  Idle_Task
    1     0     0 192 RR       Kthread   - Waiting  Semaphore 0000000000000000 0008096 0001040  12.8%  hpwork 0x403f5540 0x403f55c0
    2     0     0 100 RR       Kthread   - Waiting  Semaphore 0000000000000000 0008096 0001040  12.8%  lpwork 0x403f5490 0x403f5510
    3     0     3 100 RR       Task      - Waiting  Semaphore 0000000000000000 0008128 0002112  25.9%  init_main
    4     3     4 100 RR       Task      - Running            0000000000000000 0008128 0003344  41.1%  sh
    5     3     5 100 RR       Task      - Waiting  Semaphore 0000000000000000 0008128 0002144  26.3%  fastbootd
nsh>
nsh>

Switch the `INIT_ENTRYPOINT` from nsh_main to init_main, and let Init launch
the necessary services: console and fastboot.

Signed-off-by: wangjianyu3 <[email protected]>
@github-actions github-actions bot added Board: arm64 Size: S The size of the change in this PR is small labels Oct 20, 2025
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a feedback after dev@ mailing list discussion, thank you for understanding / considering @JianyuWang0623 :

  1. We clearly need to use "Android System Init" naming here and update all kconfig/global variables names to clearly distinguish from current NuttX Init, Android System Init, and SystemV Init (there is sill a change it will show up here one day), maybe others. "system_system" or "system_init" or "init_main" is really confusing and not self-explanatory, does not even point to "android_system_init". I know this is a bit longer but will provide important context and clear separation between completely different functionalities / implementations.
  2. We need better documentation for this "Android System Init" as well as "Fastboot". These functionalities are welcome, people want to use it, but users / developers ask questions like: Why do we need another init system? What should happen with the previous ones? What does this new init system solve? How this relates to Fastboot? When, why, and how can I use it? What are best use cases with some examples? Please consider approach like explaining and convincing someone who wants to use it but has zero knowledge about the solution.

Copy link
Contributor

@anchao anchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any advantage to using Android init? Besides the service look-aside, I don't see any other benefits. Why is Android necessarily the right path?

CONFIG_DRIVERS_VIRTIO_RNG=y
CONFIG_DRIVERS_VIRTIO_SERIAL=y
CONFIG_DRIVERS_VIRTIO_SOUND=y
CONFIG_ETC_ROMFS=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new config named fastboot_init?

Copy link
Contributor Author

@JianyuWang0623 JianyuWang0623 Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anchao Sorry for the overly brief PR title(updated). Fastboot has no direct connection with init. The modification of this PR is to switch the init entry point of the configuration "qemu-armv8a:fastboot" from nsh_main to init_main; For the function of "qemu-armv8a:fastboot", this modification may not be mandatory, and it is more of an example for the newly added Init component(apache/nuttx-apps#3192).

endif()

if(CONFIG_FS_ROMFS)
list(APPEND RCSRCS etc/init.d/init.rc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate this commit with defconfig

@JianyuWang0623 JianyuWang0623 changed the title qemu-armv8a/fastboot: Switch from NSH to Init qemu-armv8a/fastboot: Switch init entry point from NSH to Init Oct 21, 2025
@JianyuWang0623
Copy link
Contributor Author

Just a feedback after dev@ mailing list discussion, thank you for understanding / considering @JianyuWang0623 :

  1. We clearly need to use "Android System Init" naming here and update all kconfig/global variables names to clearly distinguish from current NuttX Init, Android System Init, and SystemV Init (there is sill a change it will show up here one day), maybe others. "system_system" or "system_init" or "init_main" is really confusing and not self-explanatory, does not even point to "android_system_init". I know this is a bit longer but will provide important context and clear separation between completely different functionalities / implementations.
  2. We need better documentation for this "Android System Init" as well as "Fastboot". These functionalities are welcome, people want to use it, but users / developers ask questions like: Why do we need another init system? What should happen with the previous ones? What does this new init system solve? How this relates to Fastboot? When, why, and how can I use it? What are best use cases with some examples? Please consider approach like explaining and convincing someone who wants to use it but has zero knowledge about the solution.

Is there any advantage to using Android init? Besides the service look-aside, I don't see any other benefits. Why is Android necessarily the right path?

@anchao As the data above , NSH, when used as an initialization program, may seem relatively bloated in scenarios where code size is a major concern. NSH and Init can coexist, allowing users to choose based on their own needs. Init addresses issues such as the excessive code size of NSH when used as an initialization program, and its lack of management (e.g., restarting) for daemons.

Config Changes ELF Size(bytes)
defconfig 7,008,056
+ETC_ROMFS 7,066,048
+INIT 7,127,536
-TELENT 7,127,024
-NSH_LIBRARY
-SYSTEM_NSH
6,509,392

For the ELF file, Init requires 61,488 bytes, while NSH and NSH_LIBRARY together require 617,632 bytes. Switching from NSH to Init can save a significant amount of space(556,144 bytes).

@anchao
Copy link
Contributor

anchao commented Oct 22, 2025

Just a feedback after dev@ mailing list discussion, thank you for understanding / considering @JianyuWang0623 :

  1. We clearly need to use "Android System Init" naming here and update all kconfig/global variables names to clearly distinguish from current NuttX Init, Android System Init, and SystemV Init (there is sill a change it will show up here one day), maybe others. "system_system" or "system_init" or "init_main" is really confusing and not self-explanatory, does not even point to "android_system_init". I know this is a bit longer but will provide important context and clear separation between completely different functionalities / implementations.
  2. We need better documentation for this "Android System Init" as well as "Fastboot". These functionalities are welcome, people want to use it, but users / developers ask questions like: Why do we need another init system? What should happen with the previous ones? What does this new init system solve? How this relates to Fastboot? When, why, and how can I use it? What are best use cases with some examples? Please consider approach like explaining and convincing someone who wants to use it but has zero knowledge about the solution.

Is there any advantage to using Android init? Besides the service look-aside, I don't see any other benefits. Why is Android necessarily the right path?

@anchao As the data above , NSH, when used as an initialization program, may seem relatively bloated in scenarios where code size is a major concern. NSH and Init can coexist, allowing users to choose based on their own needs. Init addresses issues such as the excessive code size of NSH when used as an initialization program, and its lack of management (e.g., restarting) for daemons.

Config Changes ELF Size(bytes)
defconfig 7,008,056
+ETC_ROMFS 7,066,048
+INIT 7,127,536
-TELENT 7,127,024
-NSH_LIBRARY
-SYSTEM_NSH 6,509,392
For the ELF file, Init requires 61,488 bytes, while NSH and NSH_LIBRARY together require 617,632 bytes. Switching from NSH to Init can save a significant amount of space(556,144 bytes).

This isn't a fair comparison, and I'm not convinced that nsh could disable more commands to align with init.

@JianyuWang0623
Copy link
Contributor Author

This isn't a fair comparison, and I'm not convinced that nsh could disable more commands to align with init.

@anchao You're right. When making comparisons, the non-essential functions of NSH should be turned off.

A rough estimate shows that after disabling the non-essential functions of NSH (as listed below), the ELF size has decreased by 397,448 bytes. It is estimated that the space required for NSH is approximately 220,184 bytes, and the init component takes up 61,488 bytes.

$ diff defconfig  boards/arm64/qemu/qemu-armv8a/configs/fastboot/defconfig
9d8
< # CONFIG_NSH_CONSOLE is not set
47c46
< CONFIG_INIT_ENTRYPOINT="nsh_main"
---
> CONFIG_INIT_ENTRYPOINT="init_main"
78,135d76
< CONFIG_NSH_DISABLE_ARP=y
< CONFIG_NSH_DISABLE_BASENAME=y
< CONFIG_NSH_DISABLE_CAT=y
< CONFIG_NSH_DISABLE_CD=y
< CONFIG_NSH_DISABLE_CMP=y
< CONFIG_NSH_DISABLE_CP=y
< CONFIG_NSH_DISABLE_DF=y
< CONFIG_NSH_DISABLE_DIRNAME=y
< CONFIG_NSH_DISABLE_DMESG=y
< CONFIG_NSH_DISABLE_ECHO=y
< CONFIG_NSH_DISABLE_ENV=y
< CONFIG_NSH_DISABLE_ERROR_PRINT=y
< CONFIG_NSH_DISABLE_EXEC=y
< CONFIG_NSH_DISABLE_EXIT=y
< CONFIG_NSH_DISABLE_EXPORT=y
< CONFIG_NSH_DISABLE_EXPR=y
< CONFIG_NSH_DISABLE_FDINFO=y
< CONFIG_NSH_DISABLE_FREE=y
< CONFIG_NSH_DISABLE_GET=y
< CONFIG_NSH_DISABLE_HELP=y
< CONFIG_NSH_DISABLE_HEXDUMP=y
< CONFIG_NSH_DISABLE_IFCONFIG=y
< CONFIG_NSH_DISABLE_IFUPDOWN=y
< CONFIG_NSH_DISABLE_KILL=y
< CONFIG_NSH_DISABLE_LOSETUP=y
< CONFIG_NSH_DISABLE_LS=y
< CONFIG_NSH_DISABLE_MD5=y
< CONFIG_NSH_DISABLE_MKDIR=y
< CONFIG_NSH_DISABLE_MKFATFS=y
< CONFIG_NSH_DISABLE_MKFIFO=y
< CONFIG_NSH_DISABLE_MKRD=y
< CONFIG_NSH_DISABLE_MOUNT=y
< CONFIG_NSH_DISABLE_MV=y
< CONFIG_NSH_DISABLE_NFSMOUNT=y
< CONFIG_NSH_DISABLE_NSLOOKUP=y
< CONFIG_NSH_DISABLE_PIDOF=y
< CONFIG_NSH_DISABLE_PKILL=y
< CONFIG_NSH_DISABLE_PRINTF=y
< CONFIG_NSH_DISABLE_PS=y
< CONFIG_NSH_DISABLE_PUT=y
< CONFIG_NSH_DISABLE_PWD=y
< CONFIG_NSH_DISABLE_RM=y
< CONFIG_NSH_DISABLE_RMDIR=y
< CONFIG_NSH_DISABLE_SET=y
< CONFIG_NSH_DISABLE_SLEEP=y
< CONFIG_NSH_DISABLE_SOURCE=y
< CONFIG_NSH_DISABLE_TEST=y
< CONFIG_NSH_DISABLE_TIME=y
< CONFIG_NSH_DISABLE_TRUNCATE=y
< CONFIG_NSH_DISABLE_UMOUNT=y
< CONFIG_NSH_DISABLE_UNAME=y
< CONFIG_NSH_DISABLE_UNSET=y
< CONFIG_NSH_DISABLE_UPTIME=y
< CONFIG_NSH_DISABLE_USLEEP=y
< CONFIG_NSH_DISABLE_WAIT=y
< CONFIG_NSH_DISABLE_WATCH=y
< CONFIG_NSH_DISABLE_WGET=y
< CONFIG_NSH_DISABLE_XD=y

@cederom
Copy link
Contributor

cederom commented Oct 22, 2025

Okay now I see this update is also a showcase for both Android System Init and Fastboot and this it was created for this reason :-)

Lets sort out the naming stuff (gh and dev@) and we will be ready to go :-)

Thank you @JianyuWang0623 amazing work :-)

@anchao
Copy link
Contributor

anchao commented Oct 22, 2025

This isn't a fair comparison, and I'm not convinced that nsh could disable more commands to align with init.

@anchao You're right. When making comparisons, the non-essential functions of NSH should be turned off.

A rough estimate shows that after disabling the non-essential functions of NSH (as listed below), the ELF size has decreased by 397,448 bytes. It is estimated that the space required for NSH is approximately 220,184 bytes, and the init component takes up 61,488 bytes.

$ diff defconfig  boards/arm64/qemu/qemu-armv8a/configs/fastboot/defconfig
9d8
< # CONFIG_NSH_CONSOLE is not set
47c46
< CONFIG_INIT_ENTRYPOINT="nsh_main"
---
> CONFIG_INIT_ENTRYPOINT="init_main"
78,135d76
< CONFIG_NSH_DISABLE_ARP=y
< CONFIG_NSH_DISABLE_BASENAME=y
< CONFIG_NSH_DISABLE_CAT=y
< CONFIG_NSH_DISABLE_CD=y
< CONFIG_NSH_DISABLE_CMP=y
< CONFIG_NSH_DISABLE_CP=y
< CONFIG_NSH_DISABLE_DF=y
< CONFIG_NSH_DISABLE_DIRNAME=y
< CONFIG_NSH_DISABLE_DMESG=y
< CONFIG_NSH_DISABLE_ECHO=y
< CONFIG_NSH_DISABLE_ENV=y
< CONFIG_NSH_DISABLE_ERROR_PRINT=y
< CONFIG_NSH_DISABLE_EXEC=y
< CONFIG_NSH_DISABLE_EXIT=y
< CONFIG_NSH_DISABLE_EXPORT=y
< CONFIG_NSH_DISABLE_EXPR=y
< CONFIG_NSH_DISABLE_FDINFO=y
< CONFIG_NSH_DISABLE_FREE=y
< CONFIG_NSH_DISABLE_GET=y
< CONFIG_NSH_DISABLE_HELP=y
< CONFIG_NSH_DISABLE_HEXDUMP=y
< CONFIG_NSH_DISABLE_IFCONFIG=y
< CONFIG_NSH_DISABLE_IFUPDOWN=y
< CONFIG_NSH_DISABLE_KILL=y
< CONFIG_NSH_DISABLE_LOSETUP=y
< CONFIG_NSH_DISABLE_LS=y
< CONFIG_NSH_DISABLE_MD5=y
< CONFIG_NSH_DISABLE_MKDIR=y
< CONFIG_NSH_DISABLE_MKFATFS=y
< CONFIG_NSH_DISABLE_MKFIFO=y
< CONFIG_NSH_DISABLE_MKRD=y
< CONFIG_NSH_DISABLE_MOUNT=y
< CONFIG_NSH_DISABLE_MV=y
< CONFIG_NSH_DISABLE_NFSMOUNT=y
< CONFIG_NSH_DISABLE_NSLOOKUP=y
< CONFIG_NSH_DISABLE_PIDOF=y
< CONFIG_NSH_DISABLE_PKILL=y
< CONFIG_NSH_DISABLE_PRINTF=y
< CONFIG_NSH_DISABLE_PS=y
< CONFIG_NSH_DISABLE_PUT=y
< CONFIG_NSH_DISABLE_PWD=y
< CONFIG_NSH_DISABLE_RM=y
< CONFIG_NSH_DISABLE_RMDIR=y
< CONFIG_NSH_DISABLE_SET=y
< CONFIG_NSH_DISABLE_SLEEP=y
< CONFIG_NSH_DISABLE_SOURCE=y
< CONFIG_NSH_DISABLE_TEST=y
< CONFIG_NSH_DISABLE_TIME=y
< CONFIG_NSH_DISABLE_TRUNCATE=y
< CONFIG_NSH_DISABLE_UMOUNT=y
< CONFIG_NSH_DISABLE_UNAME=y
< CONFIG_NSH_DISABLE_UNSET=y
< CONFIG_NSH_DISABLE_UPTIME=y
< CONFIG_NSH_DISABLE_USLEEP=y
< CONFIG_NSH_DISABLE_WAIT=y
< CONFIG_NSH_DISABLE_WATCH=y
< CONFIG_NSH_DISABLE_WGET=y
< CONFIG_NSH_DISABLE_XD=y

So nsh still has room for improvement, right?

If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path?

My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source?

If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems.

@cederom
Copy link
Contributor

cederom commented Oct 22, 2025

@anchao: So nsh still has room for improvement, right?

If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path?

My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source?

If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems.

This PR is only dedicated to changing configuration. I think source PR apache/nuttx-apps#3192 would be better place for general discussion about the solution. Best place would be the dev@ mailing list as some folks are not on GH and does not follow specific PRs. Can you please switch to dev@ mailing list so we have better community coverage and awareness? :-)

@JianyuWang0623
Copy link
Contributor Author

So nsh still has room for improvement, right?

If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path?

My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source?

If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems.

@anchao Beyond code size, also take into account the monitoring and management of daemons. As a shell, NSH may already have sufficiently rich functions; however, much of the work in system initialization is irrelevant to the core responsibilities of the shell. Separating and organizing them may make the overall logic clearer.

@anchao
Copy link
Contributor

anchao commented Oct 22, 2025

So nsh still has room for improvement, right?
If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path?
My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source?
If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems.

@anchao Beyond code size, also take into account the monitoring and management of daemons. As a shell, NSH may already have sufficiently rich functions; however, much of the work in system initialization is irrelevant to the core responsibilities of the shell. Separating and organizing them may make the overall logic clearer.

So you're also going to provide capabilities similar to Android's Zygote/SystemServer/Firmware Manager, right? So if an app using NSH wants to use these capabilities, it must use Android Init, right? Why this strange design? Is it difficult for NSH to implement these capabilities?

@JianyuWang0623
Copy link
Contributor Author

So you're also going to provide capabilities similar to Android's Zygote/SystemServer/Firmware Manager, right? So if an app using NSH wants to use these capabilities, it must use Android Init, right? Why this strange design? Is it difficult for NSH to implement these capabilities?

@anchao The management of daemons/services does not refer to complex functions like Zygote/SystemServer, but rather the status monitoring of daemons such as sh and telnetd. For example, monitoring their exit and then restarting them with a specified interval, configuring the signal sent when stopping the daemons, and determining whether the entire system needs to restart if the daemons encounter exceptions.

@JianyuWang0623 JianyuWang0623 marked this pull request as draft October 23, 2025 03:28
@xiaoxiang781216
Copy link
Contributor

So nsh still has room for improvement, right?
If it's just a size issue, why can't nsh be optimized to support Android init syntax, rather than making a drastic change like replacing the initialization path?
My other question is, why is Android's approach the right one? Is it because apple IOS isn't open source?
If functionality is aligned with Android, I don't think it's necessary. Each operating system has its own unique characteristics. I like implementations that are superior to Nuttx/Android systems.

@anchao Beyond code size, also take into account the monitoring and management of daemons. As a shell, NSH may already have sufficiently rich functions; however, much of the work in system initialization is irrelevant to the core responsibilities of the shell. Separating and organizing them may make the overall logic clearer.

So you're also going to provide capabilities similar to Android's Zygote/SystemServer/Firmware Manager, right? So if an app using NSH wants to use these capabilities, it must use Android Init, right? Why this strange design? Is it difficult for NSH to implement these capabilities?

It's more strange to couple the initialization into shell, do you see any other POSIX OS implement in this way? From the concept, init must be one instance and never exit, but shell may be lunched many times(telnet, ssh, adb shell...) or killed.

@JianyuWang0623 's work is the right direction to decouple the initialization from nsh from the architecture. But, it's also has other benefit too:

  1. In many simple case(bootloader, ota), we can enable init, but disable nsh
  2. Implement the different init solution

@7rx8
Copy link

7rx8 commented Oct 23, 2025

This is a very good init system, thank you for contributing it.

I also see required improvements in nuttx for netinit

all our programs have an independent network monitor daemon to manage plug and unplug of cable and manage link up/down and async DHCP and stuff. Having this init system means we can put this net daemon in this init system instead of having weird nsh shell scripts to do it.

let' s remember that scripting in nsh is weirdly linked to some automount code that is absolutely not flexible and that we re always patching out to mount our filesystems in our board code.

this init system provides a clean solution for all of this, including fs mounts.

Has any consensual decision been made on the naming side of things?

PS: If you know or guessed who I am please keep it for youself.

@JianyuWang0623
Copy link
Contributor Author

@7rx8 Thank you so much for your recognition and valuable feedback. Regarding the naming, we are still coordinating :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: arm64 Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants