Commit Graph

6644 Commits

Author SHA1 Message Date
Ville Juven
ad18a50282 nsh/nsh_parse.c: Fix variable expansion inside double quotes
This also prevents expanding anything when inside single quotes, for
full POSIX compliance.
2023-03-23 22:10:19 +02:00
Ville Juven
f9dfb51001 nsh/nshlib: Add alias support for nsh
This adds support for string aliases into nsh. There are some nuances that
are not handled correctly yet:

- Reserved words can be overloaded, which is a clear POSIX violation
2023-03-23 22:10:19 +02:00
Ville Juven
bf40833d2e nsh/nsh_parse.c: Add support for single ('') and double ("") quotes
The parser is modified to detect, handle and remove quotes from the
command string. Whatever is inside the quotes is treated as a string
literal. If no matching end quote is found, the terminal prints out
and error.
2023-03-23 22:10:19 +02:00
simbit18
800f1f4bae apps/examples/adc/adc.h: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
ad8478045e apps/examples/charger/Makefile: fix nxstyle
Add missing Apache Foundation copyright header
2023-03-23 00:52:38 +02:00
simbit18
d80b08d07e apps/examples/flash_test/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
simbit18
c86b154677 apps/examples/fboverlay/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-23 00:52:38 +02:00
Huang Qi
4079f6d613 system/cu: Let remote machine handle special character except Ctrl-C
Let remote machine handle special character except Ctrl-C, make cu's behavior more close to linux/bsd system.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-22 11:51:04 -03:00
chao an
b3cfcee47d netutils/iperf: guaranteed precision before division
Iperf test on photon/wlan
Before:
   0.00-   1.08 sec      65536 Bytes    0.00 Mbits/sec
After:
   0.00-   1.04 sec      74970 Bytes    0.58 Mbits/sec

Signed-off-by: chao an <anchao@xiaomi.com>
2023-03-22 11:47:01 -03:00
Zhe Weng
412505d286 ostest: Introduce basic work queue test
The test consists of two parts:
- A tester that tries to trigger wrong states of work queue
- A verifier that checks whether the wqueue is still working properly

The tester is trying to queue and cancel work several times with
priority lower/same/higher than the work queue.

Most wrong cases are likely to happen with high priority like:
- If `cancel` never decreases semcount, the count may keep growing
  and finally overflow
- If `cancel` is decreasing semcount too much, the `work_thread` may
  be waken up less times than expected

The lower/same priority testers are just added for covering other
unexpected situations.

The verifier is trying to queue some works and check they are called as
expected:
- Frist queue a 'sleep' worker, to let a work queue thread be in busy
  status and not waiting on sem, while other work queue thread(s) (if
  any) still waiting for sem. If sem is in wrong state, it may cause
  wrong behavior in either thread waiting/not waiting on the sem.
- Then queue a few count works, if the work queue(s) are still working
  properly, these works should finally be all called once.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-22 12:56:01 +02:00
Huang Qi
8ae5a1b148 Fix some hard coded buffer len of snprintf
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-21 20:57:56 -03:00
Zhe Weng
86d084fe21 netutils/ftpc: Cancel wdog on error state in ftpc_reconnect.
The timer is for connect timeout, but is not cancelled on connect error,
then it may be triggered after ftpc quit and cause heap-use-after-free.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-21 20:40:38 -03:00
Xu Xingliang
f32aa2df59 lua: download tarball from github release tag
The tarball from github has same file layout as git repo while the tarball from ftp doesn't.
Update Makefile to accommodate this change.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-03-21 20:38:29 -03:00
simbit18
48928e1c68 apps/system/dumpstack/Makefile: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
0e04cd75f8 apps/system/dumpstack/Make.defs: fix style
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
d65c51b0c6 apps/platform/bin/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
04c31b820c apps/testing/crypto/Makefile: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
simbit18
ab675c5b7d apps/testing/crypto/Make.defs: fix nxstyle
fix error: Relative file path does not match actual file
2023-03-21 20:37:38 -03:00
Tiago Medicci Serrano
3a1893ba7e nxplayer: read file completely until 0 bytes are returned
Previously, if the read bytes were less than the requested, the
file was closed immediately. This behavior, however, does not
consider the fact that the read operation may be blocking when
no bytes are available at the moment. That is true for a named pipe
(FIFO), for instance. Thus, reading it again lets to the underlying
file system the decision of 1) blocking until bytes become
available or 2) return 0 immediately (the case for actual files) or
3) read available bytes.
2023-03-21 07:51:18 +09:00
simbit18
d3c3a6ebe0 apps/netutils/xmlrpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
7560a5e80d apps/netutils/webserver/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
79b72c0302 apps/netutils/webclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2f1ab31c7 apps/netutils/thttpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
b2d24f7688 apps/netutils/tftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
98a1618202 apps/netutils/telnetd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
4b401d95b1 apps/netutils/telnetc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
17103a6b3d apps/netutils/smtp/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
27a17df69d apps/netutils/rexecd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
19d6f40767 apps/netutils/rexec/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
af4e177722 apps/netutils/pppd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
257719d65a apps/netutils/ntpclient/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
804762c72d apps/netutils/netlib/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
e1357fa6c9 apps/netutils/netinit/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6529e74326 apps/netutils/libcurl4nx/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
2c2577fc75 apps/netutils/ftpd/Make.defs: nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
8bc93e07ce apps/netutils/ftpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
a75dd4be40 apps/netutils/esp8266/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
cf0ee4354c apps/netutils/discover/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
585d0e083b apps/netutils/dhcpd/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5137e6f3db apps/netutils/dhcpc/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
5736d2adfd apps/netutils/dhcp6c/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
simbit18
6978a65293 apps/netutils/codecs/Make.defs: fix nxstyle
Add missing first line header
2023-03-20 14:17:07 +01:00
Xiang Xiao
f3c104b99a Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
Xiang Xiao
86080a110e apps: Remove the check of CONFIG_SERIAL_TERMIOS
If the code only change c_oflag, c_iflag and c_lflag, not c_cflag in termios.
Follow up the change from kernel: https://github.com/apache/nuttx/pull/8843

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-19 14:53:44 -06:00
anjiahao
369c354dc7 support ymodem protocal and sb rb application
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-03-17 12:17:14 -03:00
yinshengkai
fb0ab1b4c6 nshlib: one-time output uname
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-17 12:10:00 -03:00
Huang Qi
0af64dc045 system/cle: Remove cle_getcursor()
Fix https://github.com/apache/nuttx/issues/8731, don't rely on the vt100 to report
the cursor position.

This avoid the implicit input (response of get cursor command) during the user inputs.

Notice: This assume that the nsh prompt is always shown at line start.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:08:04 -03:00
YAMAMOTO Takashi
04a156e0d0 toywasm: regen config-dependent files
With the regen script:

```
REF=7c6ff3925d0b0f4d5122df9b1b5761bc2954e014 ./regen.sh
```
2023-03-17 12:07:02 -03:00
YAMAMOTO Takashi
b962c02c05 toywasm: add a script to regenerate config-dependent files
This is a manual step mainly because it involves extra
tools including cmake.
2023-03-17 12:07:02 -03:00
Huang Qi
4b1d59d40d bas: Don't ECHO input in repl
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 12:00:55 -03:00