initramfs.c (30d65dbfe3add7f010a075991dc0bfeaebb7d9e1) | initramfs.c (a26ee60f90daffe1de6be0d093af86e7279b3dfd) |
---|---|
1#include <linux/init.h> 2#include <linux/fs.h> 3#include <linux/slab.h> 4#include <linux/types.h> 5#include <linux/fcntl.h> 6#include <linux/delay.h> 7#include <linux/string.h> 8#include <linux/syscalls.h> --- 375 unchanged lines hidden (view full) --- 384 count = len; 385 victim = buf; 386 387 while (!actions[state]()) 388 ; 389 return len - count; 390} 391 | 1#include <linux/init.h> 2#include <linux/fs.h> 3#include <linux/slab.h> 4#include <linux/types.h> 5#include <linux/fcntl.h> 6#include <linux/delay.h> 7#include <linux/string.h> 8#include <linux/syscalls.h> --- 375 unchanged lines hidden (view full) --- 384 count = len; 385 victim = buf; 386 387 while (!actions[state]()) 388 ; 389 return len - count; 390} 391 |
392 | 392#if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA |
393static int __init flush_buffer(void *bufv, unsigned len) 394{ 395 char *buf = (char *) bufv; 396 int written; 397 int origLen = len; 398 if (message) 399 return -1; 400 while ((written = write_buffer(buf, len)) < len && !message) { --- 6 unchanged lines hidden (view full) --- 407 buf += written; 408 len -= written; 409 state = Reset; 410 } else 411 error("junk in compressed archive"); 412 } 413 return origLen; 414} | 393static int __init flush_buffer(void *bufv, unsigned len) 394{ 395 char *buf = (char *) bufv; 396 int written; 397 int origLen = len; 398 if (message) 399 return -1; 400 while ((written = write_buffer(buf, len)) < len && !message) { --- 6 unchanged lines hidden (view full) --- 407 buf += written; 408 len -= written; 409 state = Reset; 410 } else 411 error("junk in compressed archive"); 412 } 413 return origLen; 414} |
415#endif |
|
415 416static unsigned my_inptr; /* index of next byte to be processed in inbuf */ 417 418#include <linux/decompress/bunzip2.h> 419#include <linux/decompress/unlzma.h> 420#include <linux/decompress/inflate.h> 421 422static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) --- 21 unchanged lines hidden (view full) --- 444 } 445 if (!*buf) { 446 buf++; 447 len--; 448 this_header++; 449 continue; 450 } 451 this_header = 0; | 416 417static unsigned my_inptr; /* index of next byte to be processed in inbuf */ 418 419#include <linux/decompress/bunzip2.h> 420#include <linux/decompress/unlzma.h> 421#include <linux/decompress/inflate.h> 422 423static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) --- 21 unchanged lines hidden (view full) --- 445 } 446 if (!*buf) { 447 buf++; 448 len--; 449 this_header++; 450 continue; 451 } 452 this_header = 0; |
453#ifdef CONFIG_RD_GZIP |
|
452 if (!gunzip(buf, len, NULL, flush_buffer, NULL, 453 &my_inptr, error) && 454 message == NULL) 455 goto ok; | 454 if (!gunzip(buf, len, NULL, flush_buffer, NULL, 455 &my_inptr, error) && 456 message == NULL) 457 goto ok; |
458#endif |
|
456 457#ifdef CONFIG_RD_BZIP2 458 message = NULL; /* Zero out message, or else cpio will 459 think an error has already occured */ 460 if (!bunzip2(buf, len, NULL, flush_buffer, NULL, 461 &my_inptr, error) && 462 message == NULL) { 463 goto ok; --- 4 unchanged lines hidden (view full) --- 468 message = NULL; /* Zero out message, or else cpio will 469 think an error has already occured */ 470 if (!unlzma(buf, len, NULL, flush_buffer, NULL, 471 &my_inptr, error) && 472 message == NULL) { 473 goto ok; 474 } 475#endif | 459 460#ifdef CONFIG_RD_BZIP2 461 message = NULL; /* Zero out message, or else cpio will 462 think an error has already occured */ 463 if (!bunzip2(buf, len, NULL, flush_buffer, NULL, 464 &my_inptr, error) && 465 message == NULL) { 466 goto ok; --- 4 unchanged lines hidden (view full) --- 471 message = NULL; /* Zero out message, or else cpio will 472 think an error has already occured */ 473 if (!unlzma(buf, len, NULL, flush_buffer, NULL, 474 &my_inptr, error) && 475 message == NULL) { 476 goto ok; 477 } 478#endif |
479#if defined CONFIG_RD_GZIP || defined CONFIG_RD_BZIP2 || defined CONFIG_RD_LZMA |
|
476ok: | 480ok: |
481#endif |
|
477 if (state != Reset) 478 error("junk in compressed archive"); 479 this_header = saved_offset + my_inptr; 480 buf += my_inptr; 481 len -= my_inptr; 482 } 483 dir_utime(); 484 kfree(name_buf); --- 92 unchanged lines hidden --- | 482 if (state != Reset) 483 error("junk in compressed archive"); 484 this_header = saved_offset + my_inptr; 485 buf += my_inptr; 486 len -= my_inptr; 487 } 488 dir_utime(); 489 kfree(name_buf); --- 92 unchanged lines hidden --- |