bzip2/lzma: fix built-in initramfs vs CONFIG_RD_GZIP
Impact: Resolves build failures in some configurations Makes it possible to disable CONFIG_RD_GZIP . In that case, the built-in initramfs will be compressed by whatever compressor is available (bzip2 or lzma) or left uncompressed if none is available. It also removes a couple of warnings which occur when no ramdisk compression at all is chosen. It also restores the select ZLIB_INFLATE in drivers/block/Kconfig which somehow came missing. This is needed to activate compilation of the stuff in zlib_deflate. Signed-off-by: Alain Knaff <alain@knaff.lu> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
committed by
H. Peter Anvin
parent
fb9a4ca982
commit
a26ee60f90
@@ -389,7 +389,7 @@ static int __init write_buffer(char *buf, unsigned len)
|
||||
return len - count;
|
||||
}
|
||||
|
||||
|
||||
#if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA
|
||||
static int __init flush_buffer(void *bufv, unsigned len)
|
||||
{
|
||||
char *buf = (char *) bufv;
|
||||
@@ -412,6 +412,7 @@ static int __init flush_buffer(void *bufv, unsigned len)
|
||||
}
|
||||
return origLen;
|
||||
}
|
||||
#endif
|
||||
|
||||
static unsigned my_inptr; /* index of next byte to be processed in inbuf */
|
||||
|
||||
@@ -449,10 +450,12 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
|
||||
continue;
|
||||
}
|
||||
this_header = 0;
|
||||
#ifdef CONFIG_RD_GZIP
|
||||
if (!gunzip(buf, len, NULL, flush_buffer, NULL,
|
||||
&my_inptr, error) &&
|
||||
message == NULL)
|
||||
goto ok;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RD_BZIP2
|
||||
message = NULL; /* Zero out message, or else cpio will
|
||||
@@ -473,7 +476,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
|
||||
goto ok;
|
||||
}
|
||||
#endif
|
||||
#if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA
|
||||
ok:
|
||||
#endif
|
||||
if (state != Reset)
|
||||
error("junk in compressed archive");
|
||||
this_header = saved_offset + my_inptr;
|
||||
|
Reference in New Issue
Block a user