summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* menu: fix support for "\n", "\n\r" and "\r"Jean-Christophe PLAGNIOL-VILLARD2012-04-231-1/+7
| | | | | | If "\n\r" or "\r\n" is ignore one. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Introduce binfmt supportJean-Christophe PLAGNIOL-VILLARD2012-04-184-12/+120
| | | | | | | | | | | | | 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>
* filetype: add Bourne Shell supportJean-Christophe PLAGNIOL-VILLARD2012-04-181-0/+3
| | | | | | Put it at first as it's the most likely to detect Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'master' into nextSascha Hauer2012-04-171-2/+2
|\
| * filetype: Make it work on files < 512 bytesSascha Hauer2012-04-171-2/+2
| | | | | | | | | | | | | | 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>
* | Merge branch 'work/dns' into nextSascha Hauer2012-04-161-1/+1
|\ \
| * | Use DEVICE_ID_DYNAMIC where applicableSascha Hauer2012-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids, Use it where applicable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'work/build-timestamp' into nextSascha Hauer2012-04-162-1/+20
|\ \ \
| * | | Makefile: fix build timestampsSascha Hauer2012-04-152-1/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* / / menu: enable the fancy color support only if HUSH is enabledJean-Christophe PLAGNIOL-VILLARD2012-04-151-6/+15
|/ / | | | | | | | | | | | | 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>
* | console simple: return with a proper error valueSascha Hauer2012-04-131-6/+8
| | | | | | | | | | | | | | 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>
* | make building of bareboxenv-target optionalSascha Hauer2012-04-131-0/+7
| | | | | | | | | | | | | | 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>
* | filetype: add Android boot image supportJean-Christophe PLAGNIOL-VILLARD2012-04-121-0/+3
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | menu: add color fancy supportJean-Christophe PLAGNIOL-VILLARD2012-04-101-5/+45
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | menu: fix double action when "\n\r" or "\r\n" is receivedJean-Christophe PLAGNIOL-VILLARD2012-04-101-2/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush source: expand $PATHSascha Hauer2012-03-181-1/+16
| | | | | | | | 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>
* Merge branch 'work/thumb2' into nextSascha Hauer2012-03-061-0/+3
|\
| * ARM: Allow to compile in thumb-2 modeSascha Hauer2012-03-061-0/+3
| | | | | | | | | | | | | | | | | | 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>
* | commands: remove struct command pointer from commandsSascha Hauer2012-02-272-6/+6
| | | | | | | | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | command: do not allow abbreviated commands anymoreSascha Hauer2012-02-271-19/+3
|/ | | | | | | | | | | | 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>
* getopt: save and restore contextSascha Hauer2012-02-272-9/+18
| | | | | | | | | | | | 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>
* console: use container_of instead of type_dataSascha Hauer2012-02-251-3/+4
| | | | | | This reduces the usage of type_data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add string for -ETIMEDOUTSascha Hauer2012-02-191-1/+1
| | | | | | | -ETIMEDOUT is a common error value, so print the string rather than just the number. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make uimages work on tftpfsSascha Hauer2012-02-191-0/+25
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/device-cleanup' into nextSascha Hauer2012-02-171-1/+1
|\
| * dos partitions: Do not register as fixed partitionsSascha Hauer2012-02-171-1/+1
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'pu/block' into nextSascha Hauer2012-02-171-73/+201
|\ \
| * | block: reimplement cachingSascha Hauer2012-02-151-73/+201
| |/ | | | | | | | | | | | | | | | | | | | | 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>
* / readkey: add define for Ascii keysJean-Christophe PLAGNIOL-VILLARD2012-02-161-3/+3
|/ | | | | | this will simplify the usage of gpio keyboard Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Select CMD_LOADENV with DEFAULT_ENVIRONMENTSanjeev Premi2012-02-071-0/+1
| | | | | | | | | | 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>
* Merge branch 'pu/debug' into nextSascha Hauer2012-01-272-24/+35
|\
| * startup: use regular debug statements in initcall debuggingSascha Hauer2012-01-261-4/+3
| | | | | | | | | | | | | | | | 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>
| * initcalls: do not hang if an initcall failsSascha Hauer2012-01-261-4/+1
| | | | | | | | | | | | | | | | | | 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>
| * console: make it work without mallocSascha Hauer2012-01-261-17/+32
| | | | | | | | | | | | | | | | 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>
* | introduce barebox_bare_init_size to known the bare_init size and check itJean-Christophe PLAGNIOL-VILLARD2012-01-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | 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>
* | add config to check if the size of barebox exceed the target sizeJean-Christophe PLAGNIOL-VILLARD2012-01-171-0/+7
| | | | | | | | | | | | | | CONFIG_BAREBOX_MAX_IMAGE_SIZE will allow to detected silent oversize result Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | param: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-111-0/+2
| | | | | | | | | | | | this will allow to save 992 Bytes for TI xlaoder or AT91 bootstrap Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | filetype: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-112-1/+4
| | | | | | | | | | | | remove 160 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | banner: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-112-1/+5
| | | | | | | | | | | | this will allow to save 144 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | dummy_malloc: add calloc supportJean-Christophe PLAGNIOL-VILLARD2012-01-111-0/+12
|/ | | | | | | needed to use menu framework Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* poller_call: move from getc to is_timeoutJean-Christophe PLAGNIOL-VILLARD2012-01-042-2/+4
| | | | | | | | 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>
* Merge branch 'pu/tlsf' into nextSascha Hauer2012-01-033-12/+85
|\
| * tlsf: remove unused stuff from tlsfbits.hSascha Hauer2011-12-231-0/+55
| | | | | | | | | | | | | | Also, as this file is locally used by the tlsf implementation, move this file to common. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * tlsf: implement malloc_statsSascha Hauer2011-12-231-2/+23
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * tlsf: enable assertionsSascha Hauer2011-12-231-10/+7
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | defaultenv: use a compressed version when embedded in bareboxJean-Christophe PLAGNIOL-VILLARD2012-01-023-3/+81
|/ | | | | | | | | | | | | | | | | | | 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>
* add tlsf-based malloc implementationAntony Pavlov2011-12-234-0/+91
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* adapt tlsf for bareboxAntony Pavlov2011-12-231-0/+11
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* import TLSF 2.0 from http://tlsf.baisoku.org/tlsf-2.0.zipAntony Pavlov2011-12-231-0/+961
| | | | | | | | | 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>
* auto-completion: add auto-completion for path filesAlexander Aring2011-12-211-2/+68
| | | | | | | Add auto-completion for path files. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>