diff options
Diffstat (limited to 'init/initramfs.c')
| -rw-r--r-- | init/initramfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index 40bd4fb95788..a3ba91cdab89 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
| @@ -389,7 +389,7 @@ static int __init write_buffer(char *buf, unsigned len) | |||
| 389 | return len - count; | 389 | return len - count; |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | 392 | #if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA | |
| 393 | static int __init flush_buffer(void *bufv, unsigned len) | 393 | static int __init flush_buffer(void *bufv, unsigned len) |
| 394 | { | 394 | { |
| 395 | char *buf = (char *) bufv; | 395 | char *buf = (char *) bufv; |
| @@ -412,6 +412,7 @@ static int __init flush_buffer(void *bufv, unsigned len) | |||
| 412 | } | 412 | } |
| 413 | return origLen; | 413 | return origLen; |
| 414 | } | 414 | } |
| 415 | #endif | ||
| 415 | 416 | ||
| 416 | static unsigned my_inptr; /* index of next byte to be processed in inbuf */ | 417 | static unsigned my_inptr; /* index of next byte to be processed in inbuf */ |
| 417 | 418 | ||
| @@ -449,10 +450,12 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) | |||
| 449 | continue; | 450 | continue; |
| 450 | } | 451 | } |
| 451 | this_header = 0; | 452 | this_header = 0; |
| 453 | #ifdef CONFIG_RD_GZIP | ||
| 452 | if (!gunzip(buf, len, NULL, flush_buffer, NULL, | 454 | if (!gunzip(buf, len, NULL, flush_buffer, NULL, |
| 453 | &my_inptr, error) && | 455 | &my_inptr, error) && |
| 454 | message == NULL) | 456 | message == NULL) |
| 455 | goto ok; | 457 | goto ok; |
| 458 | #endif | ||
| 456 | 459 | ||
| 457 | #ifdef CONFIG_RD_BZIP2 | 460 | #ifdef CONFIG_RD_BZIP2 |
| 458 | message = NULL; /* Zero out message, or else cpio will | 461 | 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) | |||
| 473 | goto ok; | 476 | goto ok; |
| 474 | } | 477 | } |
| 475 | #endif | 478 | #endif |
| 479 | #if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA | ||
| 476 | ok: | 480 | ok: |
| 481 | #endif | ||
| 477 | if (state != Reset) | 482 | if (state != Reset) |
| 478 | error("junk in compressed archive"); | 483 | error("junk in compressed archive"); |
| 479 | this_header = saved_offset + my_inptr; | 484 | this_header = saved_offset + my_inptr; |
