aboutsummaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /init/initramfs.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 4b9c20205092..2531811d42cb 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -483,7 +483,8 @@ static int __init retain_initrd_param(char *str)
483} 483}
484__setup("retain_initrd", retain_initrd_param); 484__setup("retain_initrd", retain_initrd_param);
485 485
486extern char __initramfs_start[], __initramfs_end[]; 486extern char __initramfs_start[];
487extern unsigned long __initramfs_size;
487#include <linux/initrd.h> 488#include <linux/initrd.h>
488#include <linux/kexec.h> 489#include <linux/kexec.h>
489 490
@@ -528,7 +529,7 @@ static void __init clean_rootfs(void)
528 struct linux_dirent64 *dirp; 529 struct linux_dirent64 *dirp;
529 int num; 530 int num;
530 531
531 fd = sys_open("/", O_RDONLY, 0); 532 fd = sys_open((const char __user __force *) "/", O_RDONLY, 0);
532 WARN_ON(fd < 0); 533 WARN_ON(fd < 0);
533 if (fd < 0) 534 if (fd < 0)
534 return; 535 return;
@@ -570,8 +571,7 @@ static void __init clean_rootfs(void)
570 571
571static int __init populate_rootfs(void) 572static int __init populate_rootfs(void)
572{ 573{
573 char *err = unpack_to_rootfs(__initramfs_start, 574 char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
574 __initramfs_end - __initramfs_start);
575 if (err) 575 if (err)
576 panic(err); /* Failed to decompress INTERNAL initramfs */ 576 panic(err); /* Failed to decompress INTERNAL initramfs */
577 if (initrd_start) { 577 if (initrd_start) {
@@ -585,12 +585,12 @@ static int __init populate_rootfs(void)
585 return 0; 585 return 0;
586 } else { 586 } else {
587 clean_rootfs(); 587 clean_rootfs();
588 unpack_to_rootfs(__initramfs_start, 588 unpack_to_rootfs(__initramfs_start, __initramfs_size);
589 __initramfs_end - __initramfs_start);
590 } 589 }
591 printk(KERN_INFO "rootfs image is not initramfs (%s)" 590 printk(KERN_INFO "rootfs image is not initramfs (%s)"
592 "; looks like an initrd\n", err); 591 "; looks like an initrd\n", err);
593 fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); 592 fd = sys_open((const char __user __force *) "/initrd.image",
593 O_WRONLY|O_CREAT, 0700);
594 if (fd >= 0) { 594 if (fd >= 0) {
595 sys_write(fd, (char *)initrd_start, 595 sys_write(fd, (char *)initrd_start,
596 initrd_end - initrd_start); 596 initrd_end - initrd_start);