Skip to content

Commit 9459225

Browse files
!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>
1 parent c5eb05c commit 9459225

6 files changed

Lines changed: 4 additions & 6 deletions

File tree

boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ endif
4646

4747
ifeq ($(CONFIG_ETC_ROMFS),y)
4848
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
49-
RCRAWS = etc/group etc/passwd
49+
RCRAWS = etc/group
5050
endif
5151

5252
DEPPATH += --dep-path board

boards/risc-v/esp32c3-legacy/esp32c3-legacy-devkit/src/etc/passwd

Lines changed: 0 additions & 1 deletion
This file was deleted.

boards/sim/sim/sim/configs/login/defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CONFIG_ARCH_CHIP="sim"
1313
CONFIG_ARCH_SIM=y
1414
CONFIG_BOARDCTL_APP_SYMTAB=y
1515
CONFIG_BOARDCTL_POWEROFF=y
16+
CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y
1617
CONFIG_BOARD_LOOPSPERMSEC=0
1718
CONFIG_BOOT_RUNFROMEXTSRAM=y
1819
CONFIG_BUILTIN=y
@@ -50,7 +51,7 @@ CONFIG_NSH_BUILTIN_APPS=y
5051
CONFIG_NSH_CONSOLE_LOGIN=y
5152
CONFIG_NSH_FILE_APPS=y
5253
CONFIG_NSH_MOTD=y
53-
CONFIG_NSH_MOTD_STRING="MOTD: username=admin password=Administrator"
54+
CONFIG_NSH_MOTD_STRING="This is an example NuttX Message Of The Day (MOTD). Have fun!"
5455
CONFIG_NSH_READLINE=y
5556
CONFIG_PATH_INITIAL="/bin"
5657
CONFIG_PSEUDOFS_ATTRIBUTES=y

boards/sim/sim/sim/src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ if(CONFIG_ETC_ROMFS)
7777
etc/init.d/rc.sysinit
7878
RCRAWS
7979
etc/group
80-
etc/passwd
8180
PATH
8281
${CMAKE_CURRENT_BINARY_DIR}/etc)
8382

boards/sim/sim/sim/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656

5757
ifeq ($(CONFIG_ETC_ROMFS),y)
5858
RCSRCS = etc/init.d/rc.sysinit etc/init.d/rcS
59-
RCRAWS = etc/group etc/passwd
59+
RCRAWS = etc/group
6060
endif
6161

6262
ifeq ($(CONFIG_ARCH_BUTTONS),y)

boards/sim/sim/sim/src/etc/passwd

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)