!boards: migrate SIM and ESP32-C3-legacy to generated passwd files.

Migrate boards from static /etc/passwd files to build-time generation:

* Remove static etc/passwd files from SIM and ESP32-C3-legacy boards
* Update board configurations to enable BOARD_ETC_ROMFS_PASSWD_ENABLE
* Configure SIM board with login demo user (root/Administrator)
* Update board build rules to use newly generated passwd files
* Remove CMakeLists.txt dependency on static passwd in SIM
* Update MOTD string from username=admin to username=root

This completes the infrastructure migration for boards supporting
login functionality.

BREAKING CHANGE: The static etc/passwd files have been removed from
  boards/sim/sim/sim/src/etc/passwd
  boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/etc/passwd
These boards now require CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y and a
configured password. Any board carrying a custom static passwd file must
set RCRAWS to exclude etc/passwd and manage credentials via the new
Kconfig options or provide their own passwd generation. To fix: run
'make menuconfig' and navigate to:
  Board Selection --->
    Auto-generate /etc/passwd at build time --->
      Admin password

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
This commit is contained in:
Abhishek Mishra 2026-04-13 19:53:29 +00:00 committed by Xiang Xiao
parent ab6b1fd6f9
commit 86a7fa9246
6 changed files with 4 additions and 6 deletions

View file

@ -46,7 +46,7 @@ endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
RCRAWS = etc/group etc/passwd
RCRAWS = etc/group
endif
DEPPATH += --dep-path board

View file

@ -1 +0,0 @@
admin:8Tv+Hbmr3pLVb5HHZgd26D:0:0:/

View file

@ -13,6 +13,7 @@ CONFIG_ARCH_CHIP="sim"
CONFIG_ARCH_SIM=y
CONFIG_BOARDCTL_APP_SYMTAB=y
CONFIG_BOARDCTL_POWEROFF=y
CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y
CONFIG_BOARD_LOOPSPERMSEC=0
CONFIG_BOOT_RUNFROMEXTSRAM=y
CONFIG_BUILTIN=y
@ -50,7 +51,7 @@ CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_CONSOLE_LOGIN=y
CONFIG_NSH_FILE_APPS=y
CONFIG_NSH_MOTD=y
CONFIG_NSH_MOTD_STRING="MOTD: username=admin password=Administrator"
CONFIG_NSH_MOTD_STRING="This is an example NuttX Message Of The Day (MOTD). Have fun!"
CONFIG_NSH_READLINE=y
CONFIG_PATH_INITIAL="/bin"
CONFIG_PSEUDOFS_ATTRIBUTES=y

View file

@ -77,7 +77,6 @@ if(CONFIG_ETC_ROMFS)
etc/init.d/rc.sysinit
RCRAWS
etc/group
etc/passwd
PATH
${CMAKE_CURRENT_BINARY_DIR}/etc)

View file

@ -56,7 +56,7 @@ endif
ifeq ($(CONFIG_ETC_ROMFS),y)
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
RCRAWS = etc/group etc/passwd
RCRAWS = etc/group
endif
ifeq ($(CONFIG_ARCH_BUTTONS),y)

View file

@ -1 +0,0 @@
admin:8Tv+Hbmr3pLVb5HHZgd26D:0:0:/