This will allow to execute any file and detect it's type to handle it.
This will allow to use shell for bootp bootfile or dfu.
You can register multiple hook for the same filetype. They will be execute
in the invert order of register. If a hook does not handle the file you just
return -ERESTARTNOHAND;
This is only available with hush parser.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This is a brown paper bag type of bugs. Do not assume that a file
has to be at minimun 512 bytes to be detectable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
So we can use the menu for the xloader too.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch adds the scripts/mkcompile_h from the Kernel. This gives
us additional information about the build like who built this binary
and with which compiler. Currently the only information used is the
build timestamp and the generation number.
This also fixes the build timestamp in the banner which is now correct
even with consecutive builds without making clean in between.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
There can be only one console for console_simple, so
return with -EBUSY when the second gets registered.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bareboxenv script build for the target does not work on
all architectures, so make it optional.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
You can now use AINSI color in the display of the menu or menu_entry.
As the length of the string is not any more the same as the display simplify
the invertion display managemnent.
We just now invert the fontground and backgound on the string itself as done
in Kconfig.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The behaviour of other shells suggest that with source or '.'
the path should be resolved using the PATH environment variable. Do
the same in barebox.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This shrinks the resulting binary size by ~25%. Exceptions
are still handled in arm mode, so we have to explicitely
put .arm directives into the exception code. Thumb-2 mode
has been tested on i.MX51 Babbage board.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
abbreviated commands are derived from U-Boot and are only
partly useful. Noone expects from a shell to support this,
also we have tab completion. They also have some funny
side effects. For example we have a 'time' command. If this
command is not compiled in, the time command is interpreted
as an abbreviated version of the 'timeout' command. So remove
support for abbreviated commands and safe the binary space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
execute_command is the single point where commands are executed and thus a new
getopt context is needed. currently we call getopt_reset here to reset the
context. This breaks though when a command tries to run a command itself by
calling execute_command or run_command. In this case we have to store the
context and restore it afterwards. The same is necessary in builtin_getopt.
Currently noone does this so this one shouldn't fix a bug, but merely allows
us to do such things later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
A fixed partition means that we can't remove it. This is only suitable
for our vital /dev/self0 and /dev/env0 partitions, so remove the fixed
flag.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The current caching layer only has a single buffer for
writing and reading. The FAT driver often accesses the
fat and then data again, which currently can't be cached.
Reimplement this with a list of cached chunks. The number
of chunks and their sizes are currently hardcoded, but
that could be easily made configurable.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The environment isn't loaded until this command is
is selected - even if compiled in.
This patch makes the dependency explicit.
Signed-off-by: Sanjeev Premi <premi@ti.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Now that we don't need malloc for the console anymore it's
safe to call printf anytime, so switch the initcall debugging
to regular debug() statements..
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently we just hang when an initcall fails. This resulted
in most initcalls just returning 0 unconditionally. Instead
of hanging which usually leaves the user without a clue what
happened just continue and hope for the best.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This changes the dynamically allocated kfifos to statically initialized
ones. This makes the console work without malloc and thus safe to be
called before malloc is initialized.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this allow to check we do not exceed the size of the SRAM as example
introduce BAREBOX_MAX_BARE_INIT_SIZE the maximum size of bare_init
this will allow your bare_init will fit in SRAM as example
ARCH can overwrite it via ARCH_BAREBOX_MAX_BARE_INIT_SIZE
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
needed to use menu framework
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
this will allow to always call poller_call even durring timeout
and still the case in getc
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
enable it only if a compression is enabled
support gzip, bzip2 and lzo
you will be able to choose which compression to use
-rw-r--r-- 1 root root 8436 Dec 15 01:35 barebox_default_env
-rw-r--r-- 1 root root 2782 Dec 15 01:35 barebox_default_env.bz2
-rw-r--r-- 1 root root 2691 Dec 15 01:38 barebox_default_env.gz
-rw-r--r-- 1 root root 3262 Dec 15 01:38 barebox_default_env.lzo
with using gzip and the default env we can save 5.6KiB (5,745 bytes)
with using bzip2 and the default env we can save 5.5KiB (5,654 bytes)
with using lzo and the default env we can save 5.1KiB (5,174 bytes)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
TLSF: Two Level Segregated Fit memory allocator implementation.
Written by Matthew Conte (matt@baisoku.org).
Public Domain, no restrictions.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>