Commit Graph

791 Commits

Author SHA1 Message Date
Xiang Xiao
942f32e22a Fix nxsytle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36099dc6c07c7ada2f9fcb06fe0267b8d213a61a
2020-07-12 13:56:00 +01:00
Xiang Xiao
deaa6c5b7b build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
and move NUTTXLIB defintion to the common place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 15:17:37 -03:00
Xiang Xiao
95d7e9b191 nshlib: Call symlink if user pass -s for ln command
since NuttX kernel support really support symlink not link.
Note: link equal symlink now because the hard link doesn't support yet

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I47437f5fd8bbab3a5539d0eb6f690f633b422345
2020-07-01 11:59:00 +02:00
Gregory Nutt
192273da2e Revert "nshlib: remove the dependency of date on RTC"
This is a bad change.  It has been show to cause an increase in size by around 2.3Kb in minimal configurations that cannot tolerate that massive size increase.

This reverts commit 4adb83c754.
2020-06-24 16:07:55 -07:00
Xiang Xiao
69f013e74e build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 15:56:35 +01:00
Xiang Xiao
ead498a788 build: Remove the workaround for the inexistence of .config/Make.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-21 17:43:42 +01:00
Masayuki Ishikawa
bd47c468c5 nshlib: Introduce CONFIG_NSH_WGET_BUFF_SIZE
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-05-18 20:00:28 -06:00
chao.an
898c1ce4d2 Revert "This critical behavior was broken by this commit:"
This reverts commit 9b06b508f9.

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-05-18 06:53:57 -06:00
Gregory Nutt
4f54a75c48 apps/nshlib/nsh_parse.c: Add some comments.
Add some comments to nsh_parse.c emphasizing the reason that things are done in the order that they are.  Perhaps such comments will avoid similar breakage in the future.
2020-05-18 10:03:17 +08:00
Gregory Nutt
60428baed6 apps/nshlib/nsh_parse.c: Run through nxstyle. 2020-05-17 23:38:05 +01:00
Gregory Nutt
9b06b508f9 This critical behavior was broken by this commit:
commit 9a28ccf836
    Author: chao.an <anchao@xiaomi.com>
    Date:   Fri Feb 21 09:54:47 2020 +0800

        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.

This commit breaks the feature because it changes the order to that the built-in application is tried first.  Hence, the version on the file system will never replace the built-in version.

That commit must be reverted in order to restore the correct functionality.

    Revert "nsh/parse: try the builtin configuration first"

    This reverts commit 9a28ccf836.
2020-05-17 23:38:05 +01:00
Gregory Nutt
b2d8c501f6 Remove use of set_errno() from application code.
The normal assignment errno = errcode should work fine now.
2020-05-07 22:23:19 +01:00
Xiang Xiao
e72608e0d8 Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-02 09:45:44 -06:00
Ouss4
679896328d nshlib/nsh_telnetd.c: Print the end line of the MOTD correctly. 2020-04-29 14:46:13 +08:00
Juha Niskanen
f18b283ea8 nshlib: add printf command to README.TXT
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-21 08:02:32 -06:00
Xiang Xiao
a82d74b8a1 nshlib: Call BOARDIOC_FINALINIT in nsh_telnetstart if CONFIG_NSH_CONSOLE not define
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-19 10:15:23 -06:00
Xiang Xiao
b1b45de3db Revert "nshlib: Move BOARDIOC_FINALINIT into nsh_initscript"
This reverts commit ac5632fc50.
2020-04-19 10:15:23 -06:00
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