nsh_syscmds.c: In function ‘cmd_rpmsg_once’:
nsh_syscmds.c:567:13: error: ‘RPMSGIOC_PANIC’ undeclared (first use in this function)
567 | cmd = RPMSGIOC_PANIC;
| ^~~~~~~~~~~~~~
nsh_syscmds.c:567:13: note: each undeclared identifier is reported only once for each function it appears in
nsh_syscmds.c:571:13: error: ‘RPMSGIOC_DUMP’ undeclared (first use in this function); did you mean ‘FIOC_DUMP’?
571 | cmd = RPMSGIOC_DUMP;
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
1. struct rpmsg_ping_s ack change to cmd;
2. Update the help descrption based on the new cmd
meaning;
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This command looks through the currently running processes and kills
the those that match the selection criteria. This way system can send
signal to processes by name and without knowing the IDs.
Example (kill application hello):
pkill -15 hello
The command can be turned off by NSH_DISABLE_PKILL option and depends
on FS_PROCFS.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
In below two cases "rm" command with "-f" option will return 0:
a. Bad arguments
b. File not exists
Following "rm" of GNU coreutils 8.32
GNU coreutils
$ rm --version
rm (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim Meyering.
$ rm /FILE_NOT_EXISTS
rm: cannot remove '/FILE_NOT_EXISTS': No such file or directory
$ echo $?
1
$ rm -f
$ echo $?
0
$ rm -f /FILE_NOT_EXISTS
$ echo $?
0
Without this patch
nsh> rm
nsh: rm: missing required argument(s)
nsh> rm /FILE_NOT_EXISTS
nsh: rm: unlink failed: 2
nsh> echo $?
1
With this patch
nsh> rm -f
nsh> echo $?
0
nsh> rm -f /FILE_NOT_EXISTS
nsh> echo $?
0
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
In file included from nsh_ddcmd.c:44:
nsh_ddcmd.c: In function 'cmd_dd':
nsh_ddcmd.c:456:20: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
456 | nsh_output(vtbl, "%llu bytes copied, %u usec, ",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457 | total, (unsigned int)elapsed);
| ~~~~~
| |
| uint64_t {aka long unsigned int}
nsh_console.h:55:49: note: in definition of macro 'nsh_output'
55 | # define nsh_output(v, ...) (v)->output(v, ##__VA_ARGS__)
| ^~~~~~~~~~~
nsh_ddcmd.c:456:24: note: format string is defined here
456 | nsh_output(vtbl, "%llu bytes copied, %u usec, ",
| ~~~^
| |
| long long unsigned int
| %lu
cc1: all warnings being treated as errors
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Summary:
do
{
nbyteswritten = write(wrfd, iobuffer, nbytesread);
if (nbyteswritten >= 0)
The write return type is ssize_t, which is different in size from the originally declared type, so the unified type is ssize_t
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Currently new users when try to run NuttX using the SIM
get stuck into simulator, because they have no idea that
poweroff command is used to leave it. Let use KISS approach
and use quit as an alias to poweroff command.
Signed-off-by: Alan C. Assis <acassis@gmail.com>
The behavior of mkdir is used during the cp -r process, and the mkdir behavior is skipped when mkdir is unavailable (this may cause unpredictable behavior of cp -r)
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Now the dd command can use the "seek" parameter to adjust how many bytes need to be skipped before being written to the target.
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Currently NSH prompt is defined at build time, thus improper for AMP cases
where the same NSH binary is used on different nodes as the same NSH prompt
shows on all nodes.
This patch attempts to support runtime prompt string population from ordered
sources:
- the environment variable defined by NSH_PROMPT_ENV plus suffix
- the NSH_PROMPT_STRING
- the HOSTNAME plus suffix
The suffix is defined by NSH_PROMPT_SUFFIX so that to clearly separate the
command inputs.
Changes in `nshlib/`
- Kconfig: add configs NSH_PROMPT_MAX/ENV/SUFFIX etc
- nsh.h: adjust g_nshprompt defs, add nsh_update_prompt
- nsh_parse.c relocate g_nshpromt to nsh_prompt.c
- nsh_init.c revise to use nsh_update_prompt once
- nsh_session.c revise to use methods in nsh_prompt.c
- Makefile add nsh_prompt.c
- CMakeLists.txt add nsh_prompt.c
New additions in `nshlib/`
- nsh_prompt.c prompt related data structures and methods.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This patch guards help message for ping sub-command so that it only
shows when the sub-command is enabled.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
The alloca() function is machine- and compiler-dependent. For certain
applications, its use can improve efficiency compared to the use of
malloc(3) plus free(3). In certain cases, it can also simplify memory
deallocation in applications that use longjmp(3) or siglongjmp(3).
Otherwise, its use is discouraged.
Signed-off-by: chao an <anchao@lixiang.com>
To support rpmsg ioctl, add cmd_rpmsg function, and update rptun ping to rpmsg ping.
depends on apache/nuttx#11618
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
the ping subcommand is guarded with RPTUN_PING in its handler.
its help mesg should have same guard to avoid confusing user.
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit corresponds to apache/nuttx#11498 in nuttx.
Move etc romfs mount to sched/init for compatibility with kernel/protected mode.
changes:
- move etc romfs mount from nsh to Nuttx, but keep the script to parse and execute.
- move and rename the related CONFIG, move customized nsh_romfsimg.h to etc_romfs.c
in boards, and no need declaration for romfs_img/romfs_img_len.
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
"dns" option of `ifconfig` can work just with `CONFIG_NETDB_DNSCLIENT`,
no need to depend on `CONFIG_NETINIT_DNS` or `CONFIG_NETINIT_DHCPC`.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
Switch the order of setting network mask and gateway, re-order only, no
logic change.
In IPv6 cases, we may set `addr6` and prefix length together to an
interface, but the gateway logic may change the value in `addr6`, and
result in wrong address set to the interface.
The order doesn't change behavior in network stack, so we just need to
make sure the value is correct.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>