Commit Graph

638 Commits

Author SHA1 Message Date
Gregory Nutt
bb4c5c49ef Replace usage of SIGKILL with SIGINIT 2018-08-28 12:02:26 -06:00
anchao
3c2396116d apps/nshlib/Kconfig: Move 'option modules' from NSH_FILE_APPS to BUILD_LOADABLE 2018-08-27 07:04:29 -06:00
ligd
d36e1c87fe apps/nshlib: Add control-C support for terminating built-in and exec'ed file tasks. 2018-08-26 07:48:38 -06:00
anchao
220653f21c Squashed commit of the following:
Author: anchao <anchao@pinecone.net>

     apps/, most main() function: Correct CONFIG_BUILD_LOADABLE usage
     Loadable apps/: Correct loadable symbol table generate
     apps/system/ubloxmodem:  Fix build break
     apps/examples/ostest: start restart/waitpid/user test from main loop
     apps/nshlib:  Expand reboot and poweroff commands to include a second, optional mode argument

    Author: Gregory Nutt <gnutt@nuttx.org>

     An attempt to fix build issues.  Does not work.
     apps/examples/ostest:  Fix some inappropriate renaming of static functions introduced with recent patches.
     apps/builtin/exec_builtin.c:  Fix a error introduced by recent comments.  Found in build testing.

    Author: anchao <anchao@pinecone.net>

     apps/builtin/exec_builtin.c:  Try posix_spawn if builtin apps do not have have an entry point.
     apps/Application.mk: introduce MODULE config to simplify tristate(m)
     apps/nsh:  Change the nuttx shell module type to tristate
     apps:  Add loadable application support
     script/mksymtab:  Generate symbol table name by default
     apps/builtin:  Allow loadable applications can register with apps/builtin.
2018-08-23 11:06:15 -06:00
Xiang Xiao
dbf152cbeb apps/nshlib: (1) NSH prompt string is now configurable. nsh> is still the default. (2) Increase the default configuration for the maximum number of command line arguments to 7 (CONFIG_NSH_MAXARGUMENTS). This is needed for 'mount' with the -o option. 2018-08-23 07:34:30 -06:00
Xiang Xiao
8116d10da3 apps/fsutils/mksmartfs: Add a check to see if the SmartFS is already formatted. apps/nshlib: Add a force flag (-f) to mksmartfs. SmartFS will be formatted only if (1) the FLASH does not already hold a SmartFS, or (2) the force flag is set 2018-08-23 07:14:30 -06:00
ligd
bee98898f0 apps/nshlib: Expand reboot and poweroff commands to include a second, optional mode argument 2018-08-23 06:21:47 -06:00
Gregory Nutt
2f982e9c77 Revert "Squashed commit of the following:"
This reverts commit 25b92edd9f.
2018-08-22 12:06:32 -06:00
anchao
25b92edd9f Squashed commit of the following:
apps/builtin/exec_builtin.c:  Try posix_spawn if builtin apps do not have have an entry point.
    apps/Application.mk: introduce MODULE config to simplify tristate(m)
    apps/nsh:  Change the nuttx shell module type to tristate
    apps:  Add loadable application support
    script/mksymtab:  Generate symbol table name by default
    apps/builtin:  Allow loadable applications can register with apps/builtin.
2018-08-22 09:30:38 -06:00
Gregory Nutt
32f50985a6 Fix references to examples/nsh left in previous commit. 2018-08-18 09:33:25 -06:00
Gregory Nutt
a57610c2c4 Remove trailing spaces at the end of lines. 2018-08-13 07:47:26 -06:00
Gregory Nutt
f2ef84f048 apps/nshlib: Back out 516a743344. While the change is fuly functional and adds a pleasing symmetry to the control commands, it is also redundant and serves no real purpose other than requiring more FLASH. 2018-08-12 06:15:29 -06:00
Gregory Nutt
f759ad3196 Backs out most of commit 093391fcff. I was confused. I re-emplemented a feature that already existed. Silly me. 2018-08-11 10:47:46 -06:00
Gregory Nutt
a7f4a9db23 Revert "apps/nshlib/nsh_command.c: Update help text."
This reverts commit 0511002543.
2018-08-11 10:39:48 -06:00
Gregory Nutt
0511002543 apps/nshlib/nsh_command.c: Update help text. 2018-08-11 10:34:57 -06:00
Gregory Nutt
093391fcff apps/nshlib/nsh_test.c: The test command will now accept '!' inversion when used in the form: [ ! <expression> ]. 2018-08-11 10:20:03 -06:00
Gregory Nutt
ff192a4a58 apps/nshlib: I was able to cause an assertion with some typos in an testing the 'fi' command. Not an important thing, but this will protect against the assertion. 2018-08-11 09:30:53 -06:00
Gregory Nutt
5cfe9c2787 Update README file. 2018-08-11 08:21:52 -06:00
Gregory Nutt
516a743344 apps/nshlib: Extend Beat Küng's commit 888ad352eb so that inverted logic may also be used in repeat and while loops. 2018-08-11 07:53:22 -06:00
Beat Küng
888ad352eb Merged in bkueng/nuttx-apps (pull request #150)
nsh: add inverted logic support in the form of 'if ! <cmd>'

Approved-by: GregoryN <gnutt@nuttx.org>
2018-08-11 13:14:41 +00:00
Gregory Nutt
303629dbe4 apps/nshlib: Small parsing improvement plus some added comments. 2018-08-06 15:52:02 -06:00
Gregory Nutt
cb556d6236 apps/nshlib: Add parsing support for back-slash quoted characters. Currenlty only implemented properly if CONFIG_NSH_ARGCAT is also selected. This commit is in response to Bitbucket Issue 11 opened by Maciej Wójcik 2018-08-06 13:28:31 -06:00
Gregory Nutt
922283ee5d Squashed commit of the following:
Merged in masayuki2009/nuttx.apps/loadable_app (pull request #148)

    loadable app support

    * apps: Introduce a build system for loadable apps for nsh.

        This PR consits of following changes. (NOTE: Changes to each
        application will be provided separately)

        apps/nshlib/Kconfig:
        Add 'option modules' to NSH_FILE_APPS so that a user can change
        an application configuration to tristate (y/n/m)

        apps/Make.defs:
        Override COMPILE and COMPILEXX macros to compile loadable apps.
        To make loadable apps, -DLOADABLE_APP is added to the flags.
        Also, introduce ELFLD to link a lodable app.
        Please note that the variable 'LOADABLE' must be defined in
        each application Makefile if you want to make a loadable app.

        apps/Application.mk:
        Add .build target in case of 'LOADABLE=y' which is used to
        link a final loadable application and install the app to
        apps/bin.

        apps/Makefile:
        Add SYMTABSRC and SYMTABOBJ variables for loadable apps which
        will be generated under the apps directory.
        Add make_symbols target which will be called when all applications
        are installed to generate symtab_app.c which is used for
        nsh to inform symbol information to the NuttX kernel.

        Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

    * apps/examples/hello: Apply changes to support a lodable app.

        Kconfig:
        Change the application state from bool to tristate

        Make.defs:
        Change the condition to build. By default, the application is
        not selected (i.e. 'n'), so if other states (i.e. y/m) are
        selected, the application will be compiled.

        Makefile:
        If the application is specified to 'm', the variable 'LOADABLE'
        must be defined here. Also note that other variables (PRIORITY
        and STACKSIZE) can only be used for built-in apps.

        hello_main.c
        Add LOADABLE_APP condition to main().

        Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

    * apps/examples/helloxx: Apply changes to support a lodable app.

        Kconfig:
        Change the application state from bool to tristate

        Make.defs:
        Change the condition to build. By default, the application is
        not selected (i.e. 'n'), so if other states (i.e. y/m) are
        selected, the application will be compiled.

        Makefile:
        If the application is specified to 'm', the variable 'LOADABLE'
        must be defined here. Also note that other variables (PRIORITY
        and STACKSIZE) can only be used for built-in apps.

        helloxx_main.c
        Add LOADABLE_APP condition to main().

        Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

    Approved-by: GregoryN <gnutt@nuttx.org>
2018-08-03 12:05:01 -06:00
Gregory Nutt
3403b1b0e9 apps/nshlib/README.txt: Clarify arguments to the mkrd command. 2018-06-22 11:35:44 -06:00
Gregory Nutt
36d6348368 apps/nslib: Try to eliminate and uninitialized variable warning. 2018-06-17 15:37:42 -06:00
Beat Küng
c6697c150d Merged in bkueng/nuttx-apps (pull request #138)
nsh_parse.c: fix 'while' and 'until' loop condition

The loop condition logic was inverted:
  while true; do echo "test"; done
would exit immediately, while using 'until' would stay in the loop.
This is the opposite of how it is supposed to work.
The reason is that 'state' was set wrong because 'whilematch' is a bool.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-06-06 12:50:41 +00:00
Boris Astardzhiev
940b7f8a3e apps/nshlib/nsh.h: Fix typo.. #undef not #undefine. 2018-05-14 07:24:46 -06:00
Boris Astardzhiev
2c2fc512d6 nshlib/nsh_fscmds.c: Add the -r option which can be used to specify the number of entries in the FAT12/FAT16 root directory. 2018-05-11 09:50:54 -06:00
Juha Niskanen
052a7009b3 Merged in juniskane/apps_upstream/echo_fix_pr (pull request #135)
apps/nshlib: Fix echo command with zero arguments, broken after commit 8ecf618

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-19 04:12:51 +00:00
Juha Niskanen
c4ca133b6f apps/nshlib: Remove non-existent CONFIG_NSH_TMPDIR from README.txt 2018-04-17 05:54:00 -06:00
Gregory Nutt
0094b411da apps/netutils/netlib: Various fixes needed to get a clean netlib build with Bluetooth only. 2018-04-03 10:01:55 -06:00
Gregory Nutt
467a7980f0 apps/nshlib/: In netcommds.c, the UNUSED() macro may be applied to an undefined symbol when IPv6 is enabled but IPv4 is not. 2018-03-31 09:27:52 -06:00
Gregory Nutt
bb6877ed78 apps/nshlib: Fix compile error when CONFIG_NSH_DISABLESCRIPT is not defined. The field np_flags does not exist if scripting is disabled. 2018-01-22 08:32:40 -06:00
Gregory Nutt
e2e53117a5 Remove some section headers when the sections are empty. 2018-01-13 08:35:44 -06:00
Gregory Nutt
661718ee19 apps/nshlib: Add irqinfo command. 2018-01-12 17:58:44 -06:00
Gregory Nutt
d96c236b31 Revert "apps/nshlib: restore space delimiter that was removed in last change to the NSH echo command."
This reverts commit 7cdf9b07d8.
2018-01-10 07:53:03 -06:00
Gregory Nutt
7cdf9b07d8 apps/nshlib: restore space delimiter that was removed in last change to the NSH echo command. 2018-01-10 07:46:24 -06:00
Gregory Nutt
99512b90db apps/nshlib: truncate command will now use ftruncate (vs. truncate) if it had to create the file with creat(). 2018-01-10 07:26:21 -06:00
Masayuki Ishikawa
8ecf618a4d apps/nshlib: Add support for '-n' option to the echo command. 2018-01-10 07:26:20 -06:00
Masayuki Ishikawa
bd6bf35ffd nshlib/nsh_telnetd.c: Add support for telnet character mode.
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-10 07:15:16 +09:00
Gregory Nutt
7a2aac8876 apps/nshlib: Add support for a truncate command. This will be used to test the new ftruncate file system support. 2018-01-04 12:52:17 -06:00
Gregory Nutt
626f41084b apps/nshlib: Correct error introduced to conditional compilation 2017-11-14 08:42:16 -06:00
Gregory Nutt
e37f4b7004 apps/nshlib: Big simplification of last change. /proc/kmm, umm, and progmem have been replaced with a single procfs file called /proc/meminfo. The NSH free command now degenerates to a simple dump of /proc/meminfo. 2017-11-13 13:35:04 -06:00
Gregory Nutt
0cda4cec15 apps/nshlib: The free commands no longer used mallinfo() to get the state of the use heap. Two reasons: That is not useful information in the kernel build. And (2) there are other memory resources of interest in other configurations such as the Kernel heap in PROTECTED and KERNEL builds, and the prog mem uses when FLASH is used to hold modifiable data. The free command has been extended to just dump the content of procfs entries and to include all of these other memory resources of the procfs entries are available. 2017-11-13 12:55:03 -06:00
Dmitriy Linikov
dea8d93f64 Merged in hardlulz/modem-3.0-nuttx-apps/fix-compile-nsh_routecmds (pull request #118)
Fixed the compilation of nsh_routecmds.c, broken after commit 6b9d23c6aa

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-03 12:28:19 +00:00
Gregory Nutt
7556eb3814 nshlib/: Fix some botched conditional compilation. 2017-11-02 17:13:49 -06:00
DL
bf209bcf1d Fixed misprint in cmd_wget 2017-11-01 06:18:40 +03:00
Gregory Nutt
ef353ed632 Fix parsing of empty strings when CONFIG_NSH_CMDPARMS is not defined. Problem noted by Juha Niskanen. 2017-10-27 06:41:26 -06:00
Gregory Nutt
62f7838c5e nshlib: Tighten up some conditional logic 2017-10-26 16:07:42 -06:00
Gregory Nutt
40d9701ea0 nshlib: Remove a dangling function that is no longer used after last mount/df chagnes 2017-10-26 13:38:30 -06:00