Commit Graph

1029 Commits

Author SHA1 Message Date
Xiang Xiao
4f7dd7be7c nshlib: Add boot command
boot [<image path> [<header size>]]

Boot a new firmware image. This command depends on hardware support
CONFIG_BOARDCTL_BOOT_IMAGE. <image path> may point to a partion or file
which contain the firmware to boot. The optional, numeric argument
<header size> may be useful for skipping metadata information preprended
to the firmware image.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-04 13:53:28 +03:00
Masayuki Ishikawa
125cf7abe2 nshlib: Fix the ps command format
Summary:
- I noticed that the ps command shows the wrong format due to
  recent changes on sigmask length from 32bits to 64bits
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with sabre-6quad:smp on qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-03-29 14:50:26 +03:00
Ville Juven
e20d2688ab nsh/alias: Do not expand argument lists, only the command
A resulting word that is identified to be the command name word of a
simple command shall be examined to determine whether it is an unquoted,
valid alias name.

The keyword here being "a simple command", arguments are not subject to
expansion.
2023-03-23 22:10:19 +02:00
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
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
yinshengkai
fb0ab1b4c6 nshlib: one-time output uname
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-17 12:10:00 -03:00
Ville Juven
5d9811a03d nshlib/nsh_vars.c: Add missing stdio.h
nsh_vars.c: In function 'nsh_setvar':
nsh_vars.c:285:3: error: incompatible implicit declaration of built-in function 'sprintf' [-Werror]
  285 |   sprintf(pair, "%s=%s", name, value);
2023-03-17 11:59:37 -03:00
Huang Qi
ea4437fc76 termios: Fix wrong ECHO flag
Follow https://github.com/apache/nuttx/pull/8800

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-17 03:22:08 +01:00
Huang Qi
dbf7d34a2a nsh: Fix a potential buffer overflow in cmd help
Follow https://github.com/apache/nuttx-apps/pull/1621, fix issue of builtin command list.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-09 01:42:38 +08:00
Fotis Panagiotopoulos
dd2c3b3f6a nsh: Added conditional include of netinit. 2023-03-09 01:41:10 +08:00
Gustavo Henrique Nihei
b61686b866 nshlib: Include missing "sched.h" header
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-06 18:52:31 +02:00
Huang Qi
12d31075eb nsh: Fix a buffer overflow in help
Introduced by https://github.com/apache/nuttx-apps/pull/1610,
internal line buffer should have more bytes for tab before newline and '\0'.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-05 11:18:59 +02:00
Huang Qi
9bb730fb6b nsh: Don't echo password during login
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
Huang Qi
2e49d78400 nsh/login: FIx error prompt length
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-04 01:44:40 +08:00
Huang Qi
f1ba1a40ed nsh: Improve performance of ps by merge nsh_output
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
Huang Qi
e957e1633c nsh: Improve performance of help by line buffer
This change reduce the usage of `printf`,
which will improve both CPU usage and IO performance.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-03 17:41:39 +09:00
yinshengkai
fa589ae622 nsh: fix nsh startup failure
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-01 21:26:01 +08:00
Xiang Xiao
a4f7129984 Fix nsh_builtin.c:91:22: error: 'SA_NOCLDWAIT' undeclared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-26 19:02:28 +02:00
Xiang Xiao
359f66ad37 nshlib: Remove the remaining CONFIG_FILE_STREAM dependence
continue the change from https://github.com/apache/nuttx-apps/pull/1559

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
Xiang Xiao
80feb2432d nshlib: Shouldn't set TIOCSCTTY with STDOUT_FILENO directly
to handle the shell redirection correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-24 17:38:19 +08:00
lilei19
41f60bd669 change strcpy to strlcpy
Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-22 23:09:55 +08:00
Huang Qi
95f32fd018 nsh: Decouple with CONFIG_FILE_STREAM
Replace all fwrite/fread/fgets/... to write/read/...

Before:
```
       text    data     bss     dec     hex filename
 109827     601    6608  117036   1c92c nuttx/nuttx
```
    After:
```
       text    data     bss     dec     hex filename
108053     601    6608  115262   1c23e nuttx/nuttx
```
    After with CONFIG_FILE_STREAM disabled:
```
       text    data     bss     dec     hex filename
 105667     601    6608  112876   1b8ec nuttx/nuttx
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-22 13:47:41 +08:00
Oreh
f63a3cac0e Add NSH lomtd command (creates MTD loop device) 2023-02-19 19:55:52 +08:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08:00
Xiang Xiao
a29d9ea9da fsutils/examples: Include unistd.h explicitly
to get the prototypes or macros are defined in it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-05 08:46:59 +02:00
Gustavo Henrique Nihei
b0da60e498 apps: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-02 00:35:14 +02:00
Zhe Weng
93b4dc2692 ifconfig: Support ifconfig interface and update arg limit
From comment in cmd_ifconfig, it seems that we support `ifconfig [interface]`, but actually not considering the interface param now. After this commit, we only print the information of interface specified in param, just like linux.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-02-01 11:12:24 +08:00
Fotis Panagiotopoulos
464607dc90 Fixed compiler warnings in dd. 2023-01-30 10:59:07 +08:00
Alan Carvalho de Assis
4ed5bec472 Enable TMPFS and NSH_QUOTE to get CONFIG_NSH_CMDPARMS working 2023-01-24 13:24:23 +01:00
dongjiuzhu1
542558f2c1 nshlib/script: avoid output unnecessary log when missing rc.sysinit file
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2022-12-31 00:40:00 +08:00
Zhe Weng
2ad05e3062 ifconfig: Support prefixlen/CIDR for IPv6
Linux:
ifconfig eth0 [inet6] add 2022::2/96

FreeBSD:
ifconfig eth0 inet6 2022::2/96
ifconfig eth0 inet6 2022::2 prefixlen 96

NuttX newly supported:
ifconfig eth0 inet6 [add] 2022::2/96
ifconfig eth0 inet6 [add] 2022::2 prefixlen 96

Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Zhe Weng
8f10dde6ad ifconfig: Allow hostip on first non-option place after inet/inet6
NuttX previous:

ifconfig eth0 10.0.0.1 [inet]
ifconfig eth0 2022::2 inet6

Try to be compatible with other systems:

Linux:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 [inet6] add 2022::2

FreeBSD:
ifconfig eth0 inet 10.0.0.1
ifconfig eth0 inet6 2022::2

NuttX newly supported:
ifconfig eth0 [inet] 10.0.0.1
ifconfig eth0 inet6 [add] 2022::2

Ref:
https://man7.org/linux/man-pages/man8/ifconfig.8.html
https://www.freebsd.org/cgi/man.cgi?ifconfig

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2022-12-29 17:33:59 +08:00
Xiang Xiao
d1e46c2d3e compiler.h: Add _ between format|printf|syslog|scanf|strftime and like
align with other macro naming style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-21 01:05:12 +02:00
huangjian
78020aec0d nshlib:nsh login include nshlib/nshlib.h
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-20 23:39:36 +08:00
Xiang Xiao
cfc005a460 arp: Remove the unnecessary inclusion of nuttx/net/arp
and change the remain inclusion to netinet/arp.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 22:11:10 +02:00
Xiang Xiao
9884159346 nshlib: Add login skip, invalid name ignore and password challenge to telnet login
forget in the follow patches:
commit 6aef469c19
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:37:04 2022 +0800

    nshlib:judge whether nsh login username is a valid input

    Signed-off-by: huangjian <huangjian@xiaomi.com>

commit 88fff23d34
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:39:26 2022 +0800

    nshlib:add platform skip login function

    Signed-off-by: huangjian <huangjian@xiaomi.com>

commit 5a623cc9e3
Author: huangjian <huangjian@xiaomi.com>
Date:   Fri Nov 4 20:35:07 2022 +0800

    nshlib:add platform challenge function for nsh login

    Signed-off-by: huangjian <huangjian@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 16:31:05 +02:00
zhanghongyu
c7e8ade590 arp: change arptable get struct from arp_entry_s to arpreq
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
zhanghongyu
df3121213e cmd_arp: add device input for arp interface
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-12-14 21:19:37 +08:00
huangjian
6aef469c19 nshlib:judge whether nsh login username is a valid input
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
88fff23d34 nshlib:add platform skip login function
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
huangjian
5a623cc9e3 nshlib:add platform challenge function for nsh login
Signed-off-by: huangjian <huangjian@xiaomi.com>
2022-12-04 19:24:57 +08:00
anjiahao
14465b85c4 cmd_dd:support dd can do verify
After writing the file, compare the contents of the two files again

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
anjiahao
c2f07a4d5a dd:simplified cmd_dd code steps
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-11-14 20:40:43 +08:00
Xiang Xiao
36a0c924f7 netutils: Support telnetd in the kernel mode
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
12863fbd52 system/telnet: Fix the style warning
and remove the unused code

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 15:24:08 +09:00
Xiang Xiao
678415c6fa Rename task_spawnattr_setstacksize to posix_spawnattr_setstacksize
follow up the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:08 +09:00
Xiang Xiao
757552e759 Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Petro Karashchenko
ec1c5f9273 Revert "Revert "nshlib: fix possible out of bounds array access""
This reverts commit fe4b44e3ff.
2022-10-24 01:13:27 +08:00
Petro Karashchenko
fe4b44e3ff Revert "nshlib: fix possible out of bounds array access"
This reverts commit f6a86a578d.
2022-10-23 08:29:01 +02:00
Petro Karashchenko
f6a86a578d nshlib: fix possible out of bounds array access
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-23 11:45:52 +08:00
Xiang Xiao
0d2ef47192 nshlib: Rename CONFIG_SYSTEM_NSH_SYMTAB to CONFIG_NSH_SYMTAB
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 22:18:38 +02:00
Xiang Xiao
b659f0fbdf Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 18:40:23 +02:00
Xiang Xiao
6944c5a0a1 nshlib: Fix warning reported by clang
nsh_telnetlogin.c:62:15: error: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Werror,-Wconstant-conversion]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:14:20 +02:00
Xiang Xiao
75455d3788 nshlib: Reuse nsh_session logic in nsh_telnetmain
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 09:41:43 -03:00
Xiang Xiao
8e460e7e19 nshlib: Move symbol table initialization from nsh_main to nsh_initialize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
0d210c3227 nshlib: Move commoin initialization from console_main to nsh_initialize
to avoid the code duplication

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
964747dd36 nshlib: Call nsh_telnetstart in nsh_initialize to avoid the dupliation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
cf70d8f95b nshlib: Call nsh_sysinitscript in usb or alt console like normal one
forget in the pull request:
https://github.com/apache/incubator-nuttx-apps/pull/1142

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 15:39:10 -04:00
Xiang Xiao
893387b2c5 Fix the minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Junbo Zheng
79e770b0c6 apps/nshlib: add the missing FAR macro for all source files
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-22 14:22:13 +08:00
Junbo Zheng
45ef7f948f apps/nshlib: fix CI error
Error: /home/runner/work/incubator-nuttx-apps/incubator-nuttx-apps/apps/nshlib/nsh_proccmds.c:574:40: error: Operator/assignment must be preceded with whitespace
Error: Process completed with exit code 1.

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-21 16:37:34 +02:00
Junbo Zheng
06f39d10f1 apps/nshlib: add uptime command support
run uptime command on sim:
nsh>
nsh>
nsh> uptime
19:35:01 up  1:40, load average: 0.00, 0.00, 0.00
nsh>
nsh>
nsh> uptime -s
2022-09-16 17:54:26
nsh>
nsh>
nsh> uptime -p
up 1 hour, 40 minutes
nsh>
nsh>
nsh> uptime -h
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> uptime -abc
uptime: invalid option -- -abc
Usage:
uptime [options]
Options:
-p, show uptime in pretty format
-h, display this help and exit
-s, system up since
nsh>
nsh>
nsh> date
Fri, Sep 16 19:35:18 2022
nsh>
nsh>

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-21 16:37:34 +02:00
Junbo Zheng
732450d42a apps/nshlib: correct commands with alphabet order in kconfig
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2022-09-16 15:59:30 +08:00
chao an
e6e4661131 nshlib/netcmd: add sanity check for netdev
Signed-off-by: chao an <anchao@xiaomi.com>
2022-09-06 23:01:18 +08:00
Fotis Panagiotopoulos
1c7839c28c Fixed compiler warnings. 2022-08-30 12:10:49 +08:00
liyi
7035546422 fix use of addroute/delroute
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-27 23:50:46 +08:00
Fotis Panagiotopoulos
0cdb2cfa48 Fixed compiler warnings. 2022-08-23 01:39:59 +08:00
Huang Qi
511d9d59de nshlib: Disable dmesg if RAMLOG_SYSLOG disabled
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-22 13:56:54 +08:00
baggio63446333
0d3a2bbae8 nshlib: Change ELF priority and stack size based on builtin list
When an application is used as a loadable ELF module, the priority and
stack size of the application task is always fixed at the default values.

This commit changes to get the priority and stack size of the application
from the bulitin list. If it is not on the list, it still works as before.
2022-08-16 23:19:00 +08:00
Masayuki Ishikawa
3f70a78dd3 nshlib: Make nsh_telnetmain() in public
Summary:
- This commit makes nsh_telnetmain() in public so that we can
  call it from applications.
- Also, CONFIG_NSH_DISABLE_TELNETSTART is introduced so that
  we can disable nsh_telnetstart()

Impact:
- nsh with telnet daemon

Testing:
- Tested with sabre-6quad:netknsh (will be updated later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-08-09 23:17:25 +08:00
Peter van der Perk
dcd60a2abe Use thread-safe ntoa functions
NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Use thread-safe ntoa functions

NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

API fixes and NXStyle fixes

Apply suggestions from code review

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-08-04 23:18:06 +08:00
liyi
c5102fe504 ifconfig support set IPv6 DNS server
Signed-off-by: liyi <liyi25@xiaomi.com>
2022-08-04 19:47:15 +08:00
ligd
75155532b6 pmconfig: update pmconfig dump
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-30 03:15:01 +08:00
ligd
a109a6e58b rptun_ping: add sleep param to rptun_ping
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-30 03:15:01 +08:00
Jiuzhu Dong
ab43c625d1 nshlib/ps: update config MM_BACKTRACE to int type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-27 02:43:28 +08:00
Jiuzhu Dong
45615a8d9d nshlib/dmesg: update config about enable dmesg
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 08:27:48 +02:00
anjiahao
beb9188cee nshlib:support nsh can redirect
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-22 13:52:34 +08:00
Fotis Panagiotopoulos
2d2e36c5e9 Fixed heap information output in nsh ps command. 2022-07-22 00:03:41 +08:00
Fotis Panagiotopoulos
d7ec4e51b5 nsh: Fixed typos in comments. 2022-07-22 00:03:22 +08:00
anjiahao
dbfe5fb573 cmd_reset_cause:remove ouput space.
can use ouput string set a env to argv
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-21 21:13:11 +08:00
anjiahao
29be9e3d1b apps:fix reset cuase wraming
nsh_syscmds.c:352:40: error: passing argument 2 of 'boardctl' makes integer from pointer without a cast [-Werror=int-conversion]
352 |   ret = boardctl(BOARDIOC_RESET_CAUSE, &cause);
    |                                        ^~~~~~
    |                                        |
    |                                        struct boardioc_reset_cause_s *
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-07-21 19:41:05 +08:00
Denis Tolstov
5ae2e1034b nshlib/netcmds: Decouple nslookup from netdb_dnsclient
Allow disabling nslookup even when not using dnsclient.
2022-07-20 15:54:52 +08:00
Xiang Xiao
c252ec1481 Add printflike to all printf like functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-18 14:09:10 +03:00
pengyiqiang
71ea8b052d nshlib/nsh_ddcmd: calculate time difference with microsecond precision
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-07-17 14:06:40 +08:00
zhuyanlin
23584669c5 pmconfig: add last state and modify current state to next state
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-05-22 22:00:11 +08:00
Jiuzhu Dong
1444e0dc76 apps/nshlib: fix unreachable code about i++
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 08:36:42 +03:00
Jiuzhu Dong
1f093da6a4 Revert "apps/nshlib: fix unreachable code about i++"
This reverts commit 467de8ca83.
2022-05-07 08:36:42 +03:00
Jiuzhu Dong
b3a5b56ff3 apps/nshlib: fix warning by tool converity report
uninit_use_in_call addr before call netlib_set_ipv4addr at line 780

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
Jiuzhu Dong
234e297cd9 apps/nshlib: fix warning by tools converity report
uninit_use_in_call inaddr.sin_zero before call
netlib_set_arpmapping

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
Jiuzhu Dong
467de8ca83 apps/nshlib: fix unreachable code about i++
Report by the tool coverity

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-05-07 10:30:47 +08:00
zhuyanlin
a5a4c561fb pmconfig: add mulit domain support
pmconfig [domain]
pmconfig relax/stay state [domain]

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-28 00:36:36 +08:00
Alin Jerpelea
d60fb1168d nxstyle fixes
fixes for nxstyle errors reported by CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Alin Jerpelea
54ce2e0ab9 nshlib: Add Apache License
The initial contribution was missing a license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-04-22 11:14:17 +08:00
Ville Juven
0957a740cb nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp
Now that the environ pointer is a list of pointers-to-string, it can be
passed to the standard posix_spawn function as-is.
2022-04-21 20:58:05 +08:00
Jiuzhu Dong
9f79bf183a nsh/script: support rc.sysinit script
Follow: http://glennastory.net/boot/sysinit.html

This is first script that init runs is rc.sysinit. This
script does serval initialization tasks about basic service.

The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(Peripherals driver, core driver, ...)->
	run rcS script(mount fs, run service) ->
	    board_appinitialize->

After this patch:
The boot sequence currently provided to the board level is:
board_earlyinitialize->
    board_lateinitialize(core driver,...)->
	run rc.sysinit script(mount fs, run core service) ->
	    board_appinitialize(Peripherals driver)->
		run rcS script(run other service)->

So, Peripheral drivers can do more with the file system and
core services.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-21 12:54:24 +03:00
田昕
cc7653b8c7 fix resetcause nsh command print
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-04-14 16:43:45 +03:00
YAMAMOTO Takashi
c7fcffd09a nshlib/nsh_fscmds.c: Make losetup command take optional sector size 2022-04-11 22:19:19 +08:00