bzip2/lzma: centralize format detection

Centralize the compression format detection to a common routine in the
lib directory, and use it for both initramfs and initrd.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2009-01-08 15:14:17 -08:00
parent 6c11b12ac6
commit 889c92d21d
5 changed files with 72 additions and 67 deletions

View File

@ -26,5 +26,8 @@ typedef int (*decompress_fn) (unsigned char *inbuf, int len,
*fill should be called (repeatedly...) to read data, at most IOBUF_SIZE
*/
/* Utility routine to detect the decompression method */
decompress_fn decompress_method(const unsigned char *inbuf, int len,
const char **name);
#endif