From 6c97a8f4681fc79182bb624f062318ffb5096b54 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 9 Aug 2024 15:20:48 +0800 Subject: [PATCH] sim/login: remove login restrictions to improve the experience for green hands Most developers start learning Nuttx from sim/nsh, but the login experience is very bad, they don't know where to get the username and password, this commit will remove the limitation of sim/nsh login, and add sim/login configuration to ensure the feature of NSH_CONSOLE_LOGIN is verified. Signed-off-by: chao an --- .../platforms/sim/sim/boards/sim/index.rst | 26 ++++--- boards/sim/sim/sim/configs/login/defconfig | 67 +++++++++++++++++++ boards/sim/sim/sim/configs/nsh/defconfig | 5 -- 3 files changed, 83 insertions(+), 15 deletions(-) create mode 100644 boards/sim/sim/sim/configs/login/defconfig diff --git a/Documentation/platforms/sim/sim/boards/sim/index.rst b/Documentation/platforms/sim/sim/boards/sim/index.rst index 472bfdabfd..2026534ffc 100644 --- a/Documentation/platforms/sim/sim/boards/sim/index.rst +++ b/Documentation/platforms/sim/sim/boards/sim/index.rst @@ -849,16 +849,7 @@ NOTES: apps/examples/hello. - 2. This version has password protection enabled. Here is the login info:: - - USERNAME: admin - PASSWORD: Administrator - - The encrypted password is retained in /etc/passwd. I am sure that - you will find this annoying. You can disable the password protection - by de-selecting CONFIG_NSH_CONSOLE_LOGIN=y. - - 3. This configuration has BINFS enabled so that the builtin applications can + 2. This configuration has BINFS enabled so that the builtin applications can be made visible in the file system. Because of that, the builtin applications do not work as other examples. @@ -1807,6 +1798,21 @@ This is a configuration with sim usbhost support. Run sim usbhost with root mode, run sim usbdev or plug-in cdcacm usb device. Then you can use /dev/ttyACM to transfer data. +login +----- + +This is a configuration with login password protection for nuttx shell. + +NOTES: + + This config has password protection enabled. Here is the login info:: + + USERNAME: admin + PASSWORD: Administrator + + The encrypted password is retained in /etc/passwd. I am sure that + you will find this annoying. You can disable the password protection + by de-selecting CONFIG_NSH_CONSOLE_LOGIN=y. README.txt ========== diff --git a/boards/sim/sim/sim/configs/login/defconfig b/boards/sim/sim/sim/configs/login/defconfig new file mode 100644 index 0000000000..fbb4f2874e --- /dev/null +++ b/boards/sim/sim/sim/configs/login/defconfig @@ -0,0 +1,67 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +# CONFIG_NSH_CMDOPT_HEXDUMP is not set +CONFIG_ARCH="sim" +CONFIG_ARCH_BOARD="sim" +CONFIG_ARCH_BOARD_SIM=y +CONFIG_ARCH_CHIP="sim" +CONFIG_ARCH_SIM=y +CONFIG_BOARDCTL_APP_SYMTAB=y +CONFIG_BOARDCTL_POWEROFF=y +CONFIG_BOARD_LOOPSPERMSEC=0 +CONFIG_BOOT_RUNFROMEXTSRAM=y +CONFIG_BUILTIN=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DEV_GPIO=y +CONFIG_DEV_LOOP=y +CONFIG_DEV_ZERO=y +CONFIG_ETC_FATDEVNO=2 +CONFIG_ETC_ROMFS=y +CONFIG_ETC_ROMFSDEVNO=1 +CONFIG_EXAMPLES_GPIO=y +CONFIG_EXAMPLES_HELLO=y +CONFIG_FAT_LCNAMES=y +CONFIG_FAT_LFN=y +CONFIG_FSUTILS_PASSWD=y +CONFIG_FSUTILS_PASSWD_READONLY=y +CONFIG_FS_BINFS=y +CONFIG_FS_FAT=y +CONFIG_FS_PROCFS=y +CONFIG_FS_RAMMAP=y +CONFIG_FS_ROMFS=y +CONFIG_GPIO_LOWER_HALF=y +CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_IOEXPANDER=y +CONFIG_IOEXPANDER_DUMMY=y +CONFIG_LIBC_ENVPATH=y +CONFIG_LIBC_EXECFUNCS=y +CONFIG_LIBC_LOCALE=y +CONFIG_LIBC_LOCALE_CATALOG=y +CONFIG_LIBC_LOCALE_GETTEXT=y +CONFIG_LIBC_MAX_EXITFUNS=1 +CONFIG_LIBC_NUMBERED_ARGS=y +CONFIG_NSH_ARCHINIT=y +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_READLINE=y +CONFIG_PATH_INITIAL="/bin" +CONFIG_PSEUDOFS_ATTRIBUTES=y +CONFIG_PSEUDOFS_SOFTLINKS=y +CONFIG_READLINE_TABCOMPLETION=y +CONFIG_SCHED_BACKTRACE=y +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_WAITPID=y +CONFIG_SIM_WALLTIME_SIGNAL=y +CONFIG_START_MONTH=6 +CONFIG_START_YEAR=2008 +CONFIG_SYSTEM_DUMPSTACK=y +CONFIG_SYSTEM_NSH=y diff --git a/boards/sim/sim/sim/configs/nsh/defconfig b/boards/sim/sim/sim/configs/nsh/defconfig index fbb4f2874e..094b594c88 100644 --- a/boards/sim/sim/sim/configs/nsh/defconfig +++ b/boards/sim/sim/sim/configs/nsh/defconfig @@ -27,8 +27,6 @@ CONFIG_EXAMPLES_GPIO=y CONFIG_EXAMPLES_HELLO=y CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y -CONFIG_FSUTILS_PASSWD=y -CONFIG_FSUTILS_PASSWD_READONLY=y CONFIG_FS_BINFS=y CONFIG_FS_FAT=y CONFIG_FS_PROCFS=y @@ -48,10 +46,7 @@ CONFIG_LIBC_MAX_EXITFUNS=1 CONFIG_LIBC_NUMBERED_ARGS=y CONFIG_NSH_ARCHINIT=y 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_READLINE=y CONFIG_PATH_INITIAL="/bin" CONFIG_PSEUDOFS_ATTRIBUTES=y