summaryrefslogtreecommitdiffstats
path: root/lib/uncompress.c
Commit message (Collapse)AuthorAgeFilesLines
* string: Fix (v)asprintf prototypesSascha Hauer2016-04-151-1/+2
| | | | | | | | | | Our asprintf and vasprintf have different prototypes than the glibc functions. This causes trouble when we want to share barebox code with userspace code. Change the prototypes for (v)asprintf to match the glibc prototypes. Since the current (v)asprintf are convenient to use change the existing functions to b(v)asprintf. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add xz decompression supportSascha Hauer2014-11-041-0/+6
| | | | | | | | This adds xz decompression support from the kernel. Both compressing the barebox binary with xz and decompressing xz files on the commandline is supported. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: Add support for LZ4-compressed kernelKyungsik Lee2013-07-161-0/+6
| | | | | | | | | | | | This patch adds support for extracting LZ4-compressed kernel images, as well as LZ4-compressed ramdisk images in the kernel boot process. This depends on the patch below decompressor: Add LZ4 decompressor module Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* filetype: Pass bufsizeSascha Hauer2012-12-031-2/+2
| | | | | | | | | | Pass the buffer size to the file detection code. This makes sure we do not read past the buffer. This is especially useful for ext filesystem detection as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE define which is set to the minimum bufsize the detection code needs to detect all known filetypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>
* uncompress: implement uncompress_fd_to_bufSascha Hauer2011-12-151-0/+8
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* uncompress: fix uncompress_buf usageSascha Hauer2011-12-081-1/+2
| | | | | | | | uncompress_buf is used each time uncompress is called, so make sure it is initialized correctly so that we do not call free() on an already free pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add generic uncompress functionSascha Hauer2011-11-291-0/+159
uncompress() has the same prototype as the various kernel decompress functions. It automatically detects the compression type and selects the correct uncompress function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>