nuttx-apps/system/nxinit/Kconfig
wangjianyu3 99dd131a72 system/nxinit: Add support for action triggers
Previously only supported event trigger, now added support for
action triggers (property setting).

Steps to enable action triggers:
  - Define all init_property_*() interfaces declared in this file.
  - Data structures or functions that will likely be used:
    - struct action_trigger_s
    - init_action_for_every()

Example
  ```
  on boot
     setprop key_test
     setprop key_test value_test  /* property changed and matched */
     trigger event_test

  on event_test && property:key_test=value_test
     echo "on event_test, property changed!"

  on property:key_test=value_test
     echo "property changed!"
  ```

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-08-15 18:51:45 +08:00

131 lines
2.8 KiB
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config SYSTEM_NXINIT
tristate "NuttX Init"
default n
depends on EXPERIMENTAL
depends on LIBC_EXECFUNCS
depends on SCHED_CHILD_STATUS
---help---
Enable NxInit(NuttX Init) component for system initialization.
The script of NxInit(init.rc) is compatible with the Android Init Language syntax.
if SYSTEM_NXINIT
comment "NXInit Basic"
config SYSTEM_NXINIT_PRIORITY
int "Thread priority"
default 100
config SYSTEM_NXINIT_STACKSIZE
int "Stack size"
default DEFAULT_TASK_STACKSIZE
config SYSTEM_NXINIT_PROGNAME
string "Program name"
default "init"
comment "NXInit Run Control(RC)"
config SYSTEM_NXINIT_RC_FILE_PATH
string "Path to RC file"
default "/etc/init.d/init.rc"
---help---
Path to the init.rc file to use for NXInit's boot logic.
config SYSTEM_NXINIT_RC_LINE_MAX
int "Max line length of RC file"
default 128
---help---
Maximum line length of RC file.
More details: https://android.googlesource.com/platform/system/core/+/master/init/README.md
comment "NXInit Action"
config SYSTEM_NXINIT_ACTION_CMD_ARGS_MAX
int "Max number of command arguments"
default 8
---help---
Maximum number of command arguments.
Form:
```
on <event> [&& <event>]*
<command>
<command>
<command>
...
```
config SYSTEM_NXINIT_ACTION_WARN_SLOW
int "Slow command warning timeout"
default 50
depends on SYSTEM_NXINIT_WARN
---help---
Warning if command took more than `SYSTEM_NXINIT_ACTION_WARN_SLOW` ms.
config SYSTEM_NXINIT_ACTION_EVENTS_MAX
int "Max number of events"
default 1
range 1 64
---help---
Maximum number of event and action events.
See action.h:
```
struct action_s
{
...
struct action_event_s events[CONFIG_SYSTEM_NXINIT_ACTION_EVENTS_MAX];
...
};
```
config SYSTEM_NXINIT_FINALINIT
bool "Enable NXInit final event"
default n
---help---
Enable support to run the "final" event. Currently only "boot",
and "init" event are enabled by default, where "netinit" and
"final" are optional.
comment "NXInit Service"
config SYSTEM_NXINIT_SERVICE_ARGS_MAX
int "Max number of service arguments"
default 8
range 3 64
---help---
Maximum number of service arguments,
including "name", "pathname" and key word "service"(at least 3). Form:
```
service <name> <pathname> [ <argument> ]*
<option>
<option>
...
```
config SYSTEM_NXINIT_SERVICE_RESTART_PERIOD
int "Service restart period in ms"
default 5000
comment "NXInit Log level"
config SYSTEM_NXINIT_ERR
bool "Enable error log"
default !DEFAULT_SMALL
config SYSTEM_NXINIT_WARN
bool "Enable warning log"
depends on SYSTEM_NXINIT_ERR
config SYSTEM_NXINIT_INFO
bool "Enable info log"
depends on SYSTEM_NXINIT_WARN
config SYSTEM_NXINIT_DEBUG
bool "Enable debug log"
depends on SYSTEM_NXINIT_INFO
endif