Skip to content

Commit

Permalink
sim/login: remove login restrictions to improve the experience for gr…
Browse files Browse the repository at this point in the history
…een 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 <[email protected]>
  • Loading branch information
anchao committed Aug 9, 2024
1 parent 0be6dfb commit 2e0581f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 15 deletions.
26 changes: 16 additions & 10 deletions Documentation/platforms/sim/sim/boards/sim/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
==========
Expand Down
67 changes: 67 additions & 0 deletions boards/sim/sim/sim/configs/login/defconfig
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions boards/sim/sim/sim/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2e0581f

Please sign in to comment.