2020-03-23 |
common: fix typos found with codespell
...
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Yegor Yefremov
authored
on 20 Mar 2020
Sascha Hauer
committed
on 23 Mar 2020
|
2019-05-28 |
libbb: Drop simple_itoa()
...
Hush is the only one user of simple_itoa() and the code there can be
re-implemented using snprintf(). Change the code to get rid of
simple_itoa().
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Andrey Smirnov
authored
on 28 May 2019
Sascha Hauer
committed
on 28 May 2019
|
2019-04-24 |
Shell: Handle aborting loops better
...
It's easy to get stuck in an infinite loop in the hush shell:
while true; do sleep 1; done
The 'sleep' command will check for ctrl-c with the ctrlc() function. This
will abort the sleep command. Hush then checks for ctrl-c again in the
loop. The ctrl-c in the buffer has already been eaten by the sleep
command, so the loop will continue.
With this patch we remember the presence of a ctrl-c character in a
variable instead of checking for a new character each time. The
variable must be resetted explicitly by calling ctrlc_handled() which
will be called by the shell in the outer loop.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 24 Apr 2019
|
2018-11-27 |
hush: Add extra define for hush debugging
...
I've seen people increasing the compile loglevel to get more debugging
output from barebox. This is generally a good idea, but the tons of hush
debugging printed makes barebox quite unusable. This patch puts hush
debugging behind an extra HUSH_DEBUG define so increasing the compile
loglevel no longer results in hush debugging.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 27 Nov 2018
|
hush: Add pr_fmt define
...
To give the hush debug output more context.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 27 Nov 2018
|
2017-05-19 |
hush: make source_aliases[] const
...
Although the elements of `source_aliases[]` are of type `const char *`,
the elements themselves are not const-qualified. Make them `const`.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Ian Abbott
authored
on 17 May 2017
Sascha Hauer
committed
on 19 May 2017
|
2016-01-11 |
hush: fix indentation
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jan 2016
|
hush: Initialize struct p_context
...
The hush context must be initialized before it is used. Add
initialization where necessary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 11 Jan 2016
|
2015-11-05 |
hush: Add missing initialize_context() in some places
...
Before a context can be used it must be initialized. This was forgotten
in several places. Add the missing calls to initialize_context().
This fixes crashes when sourcing empty files
Reported-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 5 Nov 2015
|
2015-08-28 |
login: rework login mechanism
...
We used to have the login functionality in the /env/bin/init script.
This is hard to review and it's too easy to break the login functionality
with changes to this script. Move the places to ask for a password to
C code where we have only a few places where we have to ask for a password.
Mainly these are run_shell() and the menutree command.
This patch introduces a login() function which will only return if the correct
password has been entered. Following calls will return immediately without
asking for a password again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 28 Aug 2015
|
2015-01-28 |
Fix spelling: pathes -> paths
...
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Wadim Egorov
authored
on 27 Jan 2015
Sascha Hauer
committed
on 28 Jan 2015
|
2014-08-07 |
Merge branch 'for-next/misc'
...
Conflicts:
lib/Makefile
Sascha Hauer
committed
on 7 Aug 2014
|
move file helper functions to separate file
...
We have our file helper functions in several places. Move them
all to lib/libfile.c.
With this we no longer have file helpers in fs/fs.c which contains
the core fs functions and no functions in lib/libbb.c which are
not from busybox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Aug 2014
|
2014-07-09 |
hush: Fix error code returned value
...
Just returns error code instead of 0 or 1.
With this fix, $? is set to child exit code in all cases.
Without this fix, /child $PATH;echo $? displays 1 even if
child script calls exit with a specific non zero error code.
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Herve Codina
authored
on 7 Jul 2014
Sascha Hauer
committed
on 9 Jul 2014
|
2014-06-04 |
Merge branch 'for-next/misc'
...
Conflicts:
commands/devinfo.c
Sascha Hauer
committed
on 4 Jun 2014
|
2014-05-16 |
hush: setting variables may fail
...
In case of device parameters setting variables may fail. return
the result of set_local_var so that the user has a chance to detect
the failure with $?.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 16 May 2014
|
2014-05-14 |
commands: HUSH_GETOPT -> CMD_GETOPT
...
* this compile option actually turns on a command, so name it
accordingly
* also move the Kconfig definition into commands/Kconfig, thus
placing getopt into the "Shell scripting commands" section
* while at it, improve Kconfig documention
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Holger Schurig
authored
on 13 May 2014
Sascha Hauer
committed
on 14 May 2014
|
commands: harmonize in-barebox documentation
...
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:
* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
is listed by character in this (short) option string (the long
description is in the long help text, as before)
* help texts have been reworked, to make them
- sometimes smaller
- sometimes describe the options better
- more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
compiled long help texts
* 'help -v' gives a list of commands with their short description, this
is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Holger Schurig
authored
on 13 May 2014
Sascha Hauer
committed
on 14 May 2014
|
commands: group 'help' output
...
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.
The old output format (plus grouping) is now available with 'help -v'.
Example:
Information commands:
?, devinfo, help, iomem, meminfo, version
Boot commands:
boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
...
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Holger Schurig
authored
on 13 May 2014
Sascha Hauer
committed
on 14 May 2014
|
2014-03-28 |
Add shell_expand function
...
shell_expand expands shell variables in a string.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 28 Mar 2014
|
2014-03-07 |
run_command: remove unused flag parameter
...
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 7 Mar 2014
|
2013-11-12 |
hush: refactor reserved_word()
...
Save indentation level for easier readability.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: use standard ARRAY_SIZE
...
Use standard ARRAY_SIZE instead of handcrafted NRES.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: Be more informative on syntax error
...
Print the token that led to a syntax error, at least for the common
case.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
consolidate syntax() and syntax_err()
...
syntax is defined as syntax_err. Drop syntax_err and call syntax instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: rename __promptme to interrupt
...
the name '__promptme' does not make clear what the variable means. rename
it to 'interrupt' which is set to true when the user has hit ctrl-c.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: refactor file_get()
...
Save indentation level by returning early.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: refactor get_user_input()
...
Save indentation level by returning early.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: refactor readline call
...
Don't call readline in if/else, instead setup a variable and call
it once.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|
hush: fix exit on syntax error behaviour
...
input.__promptme is no valid indicator that run_shell should be left.
It should be left on executing the 'exit' builtin which is indicated
by a return code < 0 from parse_stream_outer(). Track this with an extra
variable and use it as a condition to return from an interactive shell.
This fixes the weird behaviour that hush exits (and the user finds itself
in the menu) when a syntax error occured.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha Hauer
committed
on 12 Nov 2013
|