mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-16 01:43:17 +00:00
When ETC_ROMFS is disabled to reduce the bin size, we can provide the init.rc
file via a pseudo-file in the boards/vendor directory. For example:
- CONFIG_ETC_ROMFS=n
- CONFIG_PSEUDOFS_FILE=y
- CONFIG_DISABLE_PSEUDOFS_OPERATIONS=n
```C
FAR const char *init_rc =
"on init\n"
" start console\n";
"service console sh\n"
" restart_period 100\n";
int fd = open("/etc/init.d/init.rc", O_WRONLY | O_CREAT);
/* ... */
ssize_t n = write(fd, init_rc, strlen(init_rc) + 1);
/* ... */
close(fd);
```
The last character '\0' in the file content will be treated as a new line,
and the number of parsed parameters will be zero (abnormal, there should be
at least one keyword).
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
|
||
|---|---|---|
| .. | ||
| action.c | ||
| action.h | ||
| builtin.c | ||
| builtin.h | ||
| CMakeLists.txt | ||
| import.c | ||
| import.h | ||
| init.c | ||
| init.h | ||
| Kconfig | ||
| Make.defs | ||
| Makefile | ||
| parser.c | ||
| parser.h | ||
| service.c | ||
| service.h | ||