Commit Graph

774 Commits

Author SHA1 Message Date
Xiang Xiao
650b58d6b2 nshlib: Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
3f9302561c nshlib: Enhance nsh to execute the shell script
and support the interactive shell too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
d307758c3c nshlib: Rename 'sh' command to 'source' command
since this command change the parent environment variable and
add new '.' command which has the same functionality as 'source'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
9ab5e2ff45 nshlib: Add login argument to nsh_session for controling the login process
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
9dbdc73df6 nshlib: Reset NSH_NP_SET_OPTIONS_INIT in nsh_initscript
to ensure the reset get executed in all console implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
ac5632fc50 nshlib: Move BOARDIOC_FINALINIT into nsh_initscript
1.Avoid the code duplication
2.Call BOARDIOC_FINALINIT onnce and only once
3.Ensure BOARDIOC_FINALINIT get called in all case

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
Xiang Xiao
6c4dc44e04 nshlib: Ensure nsh_initscript always follow usbtrace_enable immediately
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 08:07:06 -06:00
chao.an
4adb83c754 nshlib: remove the dependency of date on RTC
Change-Id: I98bd022fdc901ecb4e2e45a0faf779d83c260844
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-18 07:35:40 -06:00
Alan C. Assis
6e403fc343 Fix remaining issues with nxstyle 2020-04-16 20:39:47 -06:00
Alan C. Assis
d10eb2ae3a Fix nxstyle issue for Juha patch 2020-04-16 20:39:47 -06:00
Juha Niskanen
89b981bdb6 nshlib/nsh_codeccmd.c: fix potential NULL dereference and check malloc return values 2020-04-16 20:39:47 -06:00
Xiang Xiao
8fd8aad5c4 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-13 08:32:42 -06:00
Xiang Xiao
5720d72b71 apps: Fix the nightly build warning
src/cwindowfactory.cxx: In member function 'void Twm4Nx::CWindowFactory::redrawIcons(const nxgl_rect_s*)':
src/cwindowfactory.cxx:461:38: warning: 'iconPos.nxgl_point_s::y' may be used uninitialized in this function [-Wmaybe-uninitialized]
  461 |           iconBounds.pt2.y = iconPos.y + iconSize.h - 1;
      |                              ~~~~~~~~^
src/cwindowfactory.cxx:460:38: warning: 'iconPos.nxgl_point_s::x' may be used uninitialized in this function [-Wmaybe-uninitialized]
  460 |           iconBounds.pt2.x = iconPos.x + iconSize.w - 1;
      |                              ~~~~~~~~^

nsh_netcmds.c:424:20: warning: 'nsh_addrconv' defined but not used [-Wunused-function]
 static inline bool nsh_addrconv(FAR const char *hwstr,
                    ^
nsh_netcmds.c:446:20: warning: 'nsh_sethwaddr' defined but not used [-Wunused-function]
 static inline void nsh_sethwaddr(FAR const char *ifname,
                    ^

nsh_envcmds.c:94:21: warning: 'nsh_getdirpath' defined but not used [-Wunused-function]
 static inline char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl,
                     ^

In file included from bas.c:84:0:
bas.c: In function 'bas_interpreter':
bas_error.h:110:37: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 #define NOSUCHLINE         STATIC+40, _("No such line")
                                     ^
bas.c:2425:52: note: in expansion of macro 'NOSUCHLINE'
                           FS_putChars(STDCHANNEL, (NOSUCHLINE));
                                                    ^~~~~~~~~~
bas_fs.c:107:22: warning: 'g_vt100_colormap' defined but not used [-Wunused-const-variable=]
 static const uint8_t g_vt100_colormap[8] =
                      ^~~~~~~~~~~~~~~~
<stdout>:4048:16: warning: 'input' defined but not used [-Wunused-function]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I62610b4c90e67637250cbd0107c2935c8abc542f
2020-04-13 08:32:42 -06:00
chao.an
9968461c2b nsh/command: do not show the module application in built-in list
Change-Id: Ia6dd5dcf7d7eb829fde67c522f7ee2155a4051ce
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 15:59:45 +09:00
Xiang Xiao
b92a10ad74 nshlib/nsh_netcmds.c: fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:43:49 -06:00
Xiang Xiao
8da81578b0 nsh: Call getaddrinfo in cmd_nslookup to support the dual stack host
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iac7a9a6b871d473e4720db1d6cbfeea3dc9796a0
2020-03-30 09:43:49 -06:00
YAMAMOTO Takashi
e7156be066 Change the defaults of stack size configs to DEFAULT_TASK_STACKSIZE
This commit changes only ones with the default 2048 and
leaves the others.
E.g. this leaves SYSTEM_RAMTEST_STACKSIZE, whose default is 1024.
I guess those need to be inspected one-by-one.
2020-03-27 02:43:11 -05:00
Xiang Xiao
1511403fdf Revert "Don't generate .depend anymore"
This reverts commit cc5ad09caa.
2020-03-22 23:09:40 -05:00
Xiang Xiao
cc5ad09caa
Don't generate .depend anymore 2020-03-22 18:15:21 +00:00
Gregory Nutt
da31673ddf Run nxstyle against all modified .c and .h files 2020-03-22 08:23:28 -05:00
Gregory Nutt
1a9444a68b Remove support for CONFIG_FS_WRITABLE and CONFIG_FS_READABLE 2020-03-22 08:23:28 -05:00
YAMAMOTO Takashi
e1d9e82273 nshlib: Fix a few strange whitespace in command help text 2020-03-18 00:39:17 -05:00
YAMAMOTO Takashi
382284b43c nsh_dbgcmds.c: Appease nxstyle complaints 2020-03-17 21:45:37 -06:00
YAMAMOTO Takashi
2b47187a83 nsh_command.c: Appease nxstyle complaints 2020-03-17 21:45:37 -06:00
Xiang Xiao
5f273b2c5c nshlib: cmd_nfsmount support the mount with TCP protocol
And make TCP as the default like Linux
2020-02-27 12:53:54 -06:00
Xiang Xiao
26a5fb0e74 nshlib: cmd_nfsmount support the mount through domain name
Change-Id: I9e4bfd6aee9ac4bd625e3bc66b6e196b013ca172
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-27 12:49:54 -06:00
Xiang Xiao
11fedb6b95 nshlib: cmd_nfsmount should try IPv6 then IPv4 if dual stack is enabled
Change-Id: I0126a97a74008a860beeff363090ee6933286d45
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-27 12:49:54 -06:00
chao.an
86bfe13399 net/bringup: late net init after nsh script done 2020-02-26 16:11:44 +00:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Xiang Xiao
d660492289 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:41:36 -06:00
chao.an
9a28ccf836 nsh/parse: try the builtin configuration first
In the case of enable the BUILTIN_APPS/FILE_APPS at the same time, try the builtin list first to ensure that the relevant configuration(stacksize, priority) can be set normally.
2020-02-21 07:40:47 -06:00
Xiang Xiao
eb8678cfeb Remove CONFIG_DEV_LOWCONSOLE from source code
Follow the nuttx side change
2020-02-18 13:13:29 -06:00
YAMAMOTO Takashi
afa51c2e00 Fix documentation typos 2020-02-14 16:08:07 +08:00
Gregory Nutt
724a34bd3b Run all files modified by pr45 through nxstyle. 2020-02-03 07:38:57 -06:00
Xiang Xiao
37135e5dfe telnetd should listen both IPv4 and IPv6 for the dual stack
Change-Id: Ic1c2878f2eda721ccdf667b0a634289c643f5220
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
c44f271195 Fix ret undefined error in nsh_telnetlogin when CONFIG_NSH_LOGIN_PLATFORM enable
Change-Id: Ib1fa8ba6879a5b330201f1144a2e5827cc4b1d0a
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-02-03 07:17:22 -06:00
Xiang Xiao
1154735ca6 Refine the preprocess conditional guard style 2020-01-31 11:04:10 -06:00
Xiang Xiao
e0dcfa0c55 Remove extra whitespace from files (#43)
* Remove multiple newlines at the end of file
* Remove the white space from the end of line
2020-01-31 08:29:24 -06:00
Xiang Xiao
fd3775e068 Remove CONFIG_TIME_EXTENDED conditioning
Remove CONFIG_TIME_EXTENDED related stuff since kernel remove this option
2020-01-23 08:36:03 -06:00
Alin Jerpelea
5c936ce0e4 Various fixes (#6)
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h affected by this PR through nxstyle.

Author: Alin Jerpelea <alin.jerpelea@sony.com>

    * system/usbmsc: Fix accessing uninitialized pointer
    * fsutils/inifile: Fix a memory leak in inifile error case
    * fsutils/mksmartfs: Fix uninitialized return code
    * system/zmodem: Fix a compile error in zmodem debug enabled
    * nshlib/nsh_fscmds.c: Add syntax check to cp command

    If the destication of NutShell cp command is the same with the source,
    it may cause the file corruption. Add the syntax check of argument to
    avoid this problem.
2020-01-07 09:01:23 -06:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Gregory Nutt
0536c5b523 apps/nshlib/nsh_parse.c: Correct an error found in build testing. Commit 2a462c78aa was insufficient. It was a mistake to revert Xiang's change of commit 9defae8af6. But we are on a different vector now. 2019-12-24 12:18:30 -06:00
Gregory Nutt
2a462c78aa nshlib/nsh_parse.c: Replacement implementation for 9defae8af6. This addes conditional compilation on the definition of g_nullstring[] to avoid the warning. Suggested by SUZUKI Y <NBG03015@nifty.ne.jp> 2019-12-19 07:59:30 -06:00
Gregory Nutt
6bfd6166dd Revert "apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination."
Per SUZUKI Y <NBG03015@nifty.ne.jp>, changing:

-      return (FAR char *)g_nullstring;
+      return "";

causes a bad return value because "" lies on the stack.

This reverts commit 9defae8af6.
2019-12-19 07:52:00 -06:00
Xiang Xiao
9defae8af6 apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 2019-12-18 09:43:31 -06:00
Xiang Xiao
5ec8fc9427 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found":
nsh> /bin/ping
ERROR: Missing required <ip-address> argument
...
nsh: /bin/ping: command not found
2019-12-10 10:05:51 -06:00
Gregory Nutt
77a3b08302 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 2019-12-10 08:40:29 -06:00
Gregory Nutt
e89a1aa54d README.txt: Update to include a description of the 'dmesg' command which was apparently never documented. 2019-11-21 12:23:50 -06:00
Juha Niskanen
eaeb6cc105 nshlib/Kconfig: Add missing NSH_DISABLE_DMESG, typos. 2019-11-08 07:52:22 -06:00
Dave Marples
dbd4e67241 apps/system/cle/cle.c: This commit modifies the cle to use the streams file interface more consistently and has removed the observed race conditions. It was previously a mix of streams and fileio. It also simplifies the VT100 cursor position handling. 2019-11-04 11:35:18 -06:00