summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* uncompress: drop wrong BUG(uncompress_size)Jean-Christophe PLAGNIOL-VILLARD2012-09-101-2/+0
| | | | | | | | As uncompress_size is a static and will set if call uncompress_size multiple time. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pbl'Sascha Hauer2012-09-051-0/+1
|\
| * Merge tag 'pbl' of git://git.jcrosoft.org/barebox into for-next/pblSascha Hauer2012-08-031-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add pre-bootloader (pbl) image support This allows for creating a pre-bootloader binary for - nand boot - mmc boot - compressed image Currently on the compressed image is implemented the boot really on current lowlevel init support. In a second step this could be move to the pbl c code with generic framework. The pbl will be incharge of the lowlevel init if needed. The barebox will skip it. The decompressor support lzo and gzip and allow to add easly more. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| | * compressed image: add gzip supportJean-Christophe PLAGNIOL-VILLARD2012-08-031-0/+1
| | | | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | | recursive_action: add ACTION_FOLLOWLINKS supportJean-Christophe PLAGNIOL-VILLARD2012-09-051-1/+6
| | | | | | | | | | | | | | | | | | this is need to support symlink in envfs Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | | stringlist: fix division by zeroEric Bénard2012-08-291-2/+2
|/ / | | | | | | | | | | | | | | len is checked instead of num so when num is zero, we get a division by zero a few lines later Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | glob: fix GLOB_SORTSascha Hauer2012-08-031-2/+2
| | | | | | | | | | | | | | The arguments to collated_compare are actually pointers to pointers to char, not pointers to char. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | qsort: Fix wrong checkSascha Hauer2012-08-031-1/+1
|/ | | | | | The check for overflow accidently was exactly the opposite. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/onfi'Sascha Hauer2012-08-011-0/+39
|\
| * string: add strim for ONFI codeEric Bénard2012-07-051-0/+39
| | | | | | | | | | Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2012-08-011-1/+1
|\ \
| * | lib/Kconfig: Fix alignment of arrows in labelBernhard Walle2012-07-241-1/+1
| |/ | | | | | | | | Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/compressed-prepare'Sascha Hauer2012-08-012-3/+9
|\ \
| * | decompress_unlzo: define decompress_unlzo as decompressJean-Christophe PLAGNIOL-VILLARD2012-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | so we can use decompress in the decompressor this will simplify multi decompress support Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lzo: Allow for static inliningSascha Hauer2012-07-232-3/+8
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / vsprintf: fix EXPORT_SYMBOL typo on simple_strtoullJean-Christophe PLAGNIOL-VILLARD2012-07-251-1/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/64bit'Sascha Hauer2012-07-022-9/+16
|\
| * make parse_area_spec arguments loff_tSascha Hauer2012-06-301-5/+5
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * introduce strtoull_suffix functionSascha Hauer2012-06-302-4/+11
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Unused files removedAlexander Shiyan2012-06-302-3/+0
|/ | | | | | | | Files "modules.builtin" probably have been copied from kernel tree. This files not used by barebox and can be removed safely. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* glob: Add sorted output supportSascha Hauer2012-05-141-6/+5
| | | | | | | This allows us for example to execute init scripts in the correct order. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add qsort supportSascha Hauer2012-05-143-0/+83
| | | | | | | This is based on U-Boot code which in turn is based on uclibc code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make errno a positive valueSascha Hauer2012-05-142-12/+17
| | | | | | | | | Normally errno contains a positive error value. A certain unnamed developer mixed this up while implementing U-Boot-v2. Also, normally errno is never set to zero by any library function. This patch fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* parameter: return empty string for unset parametersSascha Hauer2012-05-131-1/+1
| | | | | | | | Currently we return NULL for unset parameters. As we can't set them back to NULL once set this is not very consistent. Return an empty string instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge tag 'complete_update_support' of git://git.jcrosoft.org/barebox into nextSascha Hauer2012-05-011-5/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | improve complete support The following patch serie improve the complete support by adding a complete framework to allow commands complete support. The add also car complete support for eval and setting and executable file support This also include an update of the stringlist API to support asprintf API
| * stringlist: implement string_list_add_asprintfSascha Hauer2012-04-301-0/+24
| | | | | | | | | | | | | | Useful for allocating a string list entry on the fly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| * stringlist: use seperately allocated stringSascha Hauer2012-04-301-6/+4
| | | | | | | | | | | | | | | | | | | | Allocate the string in string list seperately instead of embedding a zero length string into struct stringlist. Besides looking cleaner this allows us to implement a string_list_asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | glob: activate GLOB_NOCHECK flagSascha Hauer2012-04-301-6/+4
|/ | | | | | Needed for hush. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dev_add_param: check if param exists alreadySascha Hauer2012-04-241-0/+4
| | | | | | | Before adding a new parameter to a device we should check if it already exists. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* param: make return value of param getter function constSascha Hauer2012-04-241-5/+5
| | | | | | | The string returned by the getter function should not be changed. Make it const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: use static string in string_to_ipSascha Hauer2012-04-151-5/+1
| | | | | | Simplify usage of ip_to_string by using a static string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* string: remove unused bcopy functionSascha Hauer2012-04-051-24/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* getopt: save and restore contextSascha Hauer2012-02-271-2/+20
| | | | | | | | | | | | 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>
* getopt: turn commented out printf into debug()Sascha Hauer2012-02-271-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* copy_file: limit progress bar to sensible limitsSascha Hauer2012-02-191-3/+2
| | | | | | | | | When copying in verbose mode from a tftp server we might not know the size of the file being transfered. In this case print one progress item per 16k instead of one for each single byte. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/debug' into nextSascha Hauer2012-01-272-14/+11
|\
| * Add dump_stack functionSascha Hauer2012-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | At least ARM allows us to dump the stack, but we currently have no prototype for this. Add a dump_stack prototype and provide a static inline function for architectures without stack dump support. Also, call dump_stack() in panic() to provide more information in the case of a panic. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kfifo: change kfifo_init to work with a preallocated fifoSascha Hauer2012-01-261-14/+9
| | | | | | | | | | | | | | | | kfifo currently only works with dynamically allocated fifos. Change the currently unused kfifo_init to take a preallocated fifo. This allows for statically initialized fifos. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | show_progress: fix progress bar for files > 32 MiBMarc Kleine-Budde2012-01-251-2/+6
| | | | | | | | | | | | | | The next limit with the current code will probably 2GiB. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | param: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-112-1/+4
| | | | | | | | | | | | 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-111-0/+1
| | | | | | | | | | | | remove 160 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | uncompress: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-113-2/+7
|/ | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'next'Sascha Hauer2012-01-058-2/+1535
|\
| * lib: add bitrev utilityRobert Jarzmik2012-01-023-0/+72
| | | | | | | | | | | | | | Add bit reversing utility, taken from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lib: add BCH encoding/decodingRobert Jarzmik2012-01-023-0/+1371
| | | | | | | | | | | | | | | | As flash memories need BCH correcting codes, add the BCH library, taken from the linux kernel. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * stringlist-functions: add sorted insertAlexander Aring2011-12-211-0/+34
| | | | | | | | | | | | | | | | | | Add sorted insert in stringlist functions. Also added function to checked if string is already in string list. Signed-off-by: Alexander Aring <a.aring@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove undefined WATCHDOG_RESETSascha Hauer2011-12-191-1/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'work/uimage' into nextSascha Hauer2011-12-172-0/+58
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: arch/ppc/lib/ppclinux.c commands/bootm.c include/boot.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * libbb: add read_full/write_full functionsSascha Hauer2011-12-151-0/+50
| | | | | | | | | | | | | | | | | | These functions read/write all data or return with an error. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| | * uncompress: implement uncompress_fd_to_bufSascha Hauer2011-12-151-0/+8
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>