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
Jiuzhu Dong
63f28099e3
nsh/timedatectl: add timedatectl to get/set TZ
...
follow https://man7.org/linux/man-pages/man1/timedatectl.1.html
nsh> timedatectl
TimeZone: CST, 28800
Local time: Sat, Apr 02 05:59:43 2022 CST
Universal time: Fri, Apr 01 21:59:43 2022 GMT
RTC time: Sun, Apr 01 21:59:42 2022
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-07 02:52:11 +08:00
ligd
470174260c
rptun: update rptun cmd usage
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
f5d2c64556
rptun: add rptun ping support
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
622784be89
rptun cmd: add broadcast rptun cmd
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
e0e5652de4
rptun: add rptun dump support
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
d5aae96523
apps: add rptun reset /dev/rptun/xx cmd
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
ligd
c57677c3ce
apps: add rptun /dev/rptun/xx panic cmd
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-04-01 17:36:51 +08:00
Jiuzhu Dong
de61706552
nsh/memdump: support dynamic turn on/off backtrace in heap
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-01 13:31:28 +08:00
田昕
cbc9163266
apps/nsh:add resetcause command
...
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
2022-03-31 12:09:24 +03:00
ligd
9730eaad9e
nsh: sh_main also support isctty = true
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 22:47:37 +03:00
ligd
d6a187efed
nshlib: merge nsh_getdirpath() to nsh_fsutils.c
...
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-30 02:36:13 +08:00
Petro Karashchenko
d868387148
fsutils/passwd: fix out of bounds array access during password encryption
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 22:11:01 +08:00
Petro Karashchenko
566be8c7b1
definitions: unify MAX and MIN macro definitions
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:20:17 +08:00
anjiahao
7d10751037
nshlib/nsh_fscmds:use strchr instead of strstr
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-03-16 20:05:51 +08:00
anjiahao
eabba4ca20
cmd_mkdir:support mkdir opthon -p
...
use "mkdir -p /test/test" to ceate a dir
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-03-16 13:53:45 +08:00
Petro Karashchenko
f9baa422c1
style: unify path to files in comment section
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-09 10:37:33 +08:00
Xiang Xiao
aac20c317c
Fix compiler warning
...
chrono_main.c: In function 'chrono_main':
Error: chrono_main.c:396:11: error: 'strncpy' output truncated before terminating nul copying 7 bytes from a string of the same length [-Werror=stringop-truncation]
396 | strncpy(str, "00:00.0", 7);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Error: chrono_main.c:434:25: error: '%02ld' directive writing between 2 and 9 bytes into a region of size 8 [-Werror=format-overflow=]
434 | sprintf(str, "%02ld:%02ld:%01ld", min, sec,
| ^~~~~
chrono_main.c:434:24: note: directive argument in the range [-35791394, 35791394]
434 | sprintf(str, "%02ld:%02ld:%01ld", min, sec,
| ^~~~~~~~~~~~~~~~~~~
chrono_main.c:434:24: note: directive argument in the range [-59, 59]
chrono_main.c:434:24: note: directive argument in the range [-21, 21]
chrono_main.c:434:11: note: 'sprintf' output between 8 and 18 bytes into a destination of size 8
434 | sprintf(str, "%02ld:%02ld:%01ld", min, sec,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435 | (priv->ts_end.tv_nsec / 100000000));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nsh_routecmds.c: In function 'cmd_delroute':
Error: nsh_routecmds.c:611:11: error: 'memset' forming offset [16, 27] is out of the bounds [0, 16] of object 'inaddr' with type 'union <anonymous>' [-Werror=array-bounds]
611 | memset(&inaddr.ipv6, 0, sizeof(struct sockaddr_in6));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nsh_routecmds.c:491:5: note: 'inaddr' declared here
491 | } inaddr;
| ^~~~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-07 13:34:28 +02:00
Xiang Xiao
d4290b3e93
Fix error: 'memset' forming offset [16, 27] is out of the bounds [0, 16] of object 'inaddr' with type 'union <anonymous>'
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-05 17:02:43 +01:00
Xiang Xiao
82b94fc76f
Simplify DEFAULT_SMALL usage in Kconfig
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-01 22:46:47 +08:00
anjiahao
4680a25a8c
cmd_dd:if read nbyte less than bs,must write nbyte
...
if a file size is 10
use dd if=a of=b bs = 8
b file size will 16, is a error
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-02-24 10:21:33 -03:00
Jiuzhu Dong
283b1a4dfc
nshlib/cmd_memdump: support new command: memdump
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-24 02:16:00 +08:00
Jiuzhu Dong
372621ed06
nshlib/ps: support display heap info for every task by cmd ps
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-02-24 02:16:00 +08:00
Xiang Xiao
0b722cc864
nshlib: Remove format variable from date_showtime
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:44 +08:00
Xiang Xiao
4cc0c755bf
Remove CONFIG_CLOCK_MONOTONIC special code
...
since this opion doesn't exist anymore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:44 +08:00
Xiang Xiao
f6f4bbff3a
Replace EXIT_SUCCESS with 0 for BOARDIOC_[POWEROFF|RESET]
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-29 12:44:41 +01:00
Fotis Panagiotopoulos
6daec61423
Typo fix.
2022-01-28 00:02:08 +08:00
Norman Rasmussen
374cb9230a
Fix boarctl typos
2022-01-16 08:07:47 +01:00
Fotis Panagiotopoulos
bc5d8034f1
Typo fixes.
2022-01-06 10:30:41 +08:00
Norman Rasmussen
6285990a5c
Remove trailing whitespace from commands as parameters
2022-01-01 22:18:07 +08:00
Norman Rasmussen
92287e2b14
Fix some edge case bugs in nsh_parse
...
- Handle nsh_filecat returning NULL on failure
- Background and redirect must be restored after an empty line
- Output redirection should be removed from argv like background
2022-01-01 22:18:07 +08:00
Norman Rasmussen
41ce7d40f6
Fix incorrect argument count error message
...
The `too many arguments` and `missing required argument(s)` messages
should be switched in order for the correct message to be shown to the
user.
2021-12-31 20:54:05 +08:00
Xiang Xiao
66dbaa4539
Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
...
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-20 16:04:29 -03:00
ligd
a4dd508c9c
nshlib/nsh_proccmds.c: update ps_callback when get Group
...
Cause of "Group:" always have in file "status"
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-11-11 11:13:04 -03:00
Xiang Xiao
850c036c58
nshlib/stdsession: Handle the command arguments in any order
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 13:39:10 -03:00
Xiang Xiao
ad09ca2a80
nshlib: sync nsh_stdsession.c with nsh_session.c
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 13:39:10 -03:00
Xiang Xiao
a0f773b318
nshlib/nsh_session: Handle the command arguments in any order
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-09 09:35:40 -03:00