aboutsummaryrefslogtreecommitdiffstats
path: root/init/initramfs.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2009-01-14 14:28:35 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2009-01-14 14:28:35 -0500
commit73310a169aebe257efdd35a763cce1c7658f40c9 (patch)
tree4195dba6ed5c20fafc4d790167600433841f125e /init/initramfs.c
parent23a22d57a8962479ca630c9542e62d6f86fdf927 (diff)
init: make initrd/initramfs decompression failure a KERN_EMERG event
Impact: More consistent behaviour, avoid policy in the kernel Upgrade/downgrade initrd/initramfs decompression failure from inconsistently a panic or a KERN_ALERT message to a KERN_EMERG event. It is, however, possible do design a system which can recover from this (using the kernel builtin code and/or the internal initramfs), which means this is policy, not a technical necessity. A good way to handle this would be to have a panic-level=X option, to force a panic on a printk above a certain level. That is a separate patch, however. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r--init/initramfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 9a7290ec818..7dcde7ea660 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -528,7 +528,7 @@ static int __init populate_rootfs(void)
528 char *err = unpack_to_rootfs(__initramfs_start, 528 char *err = unpack_to_rootfs(__initramfs_start,
529 __initramfs_end - __initramfs_start, 0); 529 __initramfs_end - __initramfs_start, 0);
530 if (err) 530 if (err)
531 panic(err); 531 panic(err); /* Failed to decompress INTERNAL initramfs */
532 if (initrd_start) { 532 if (initrd_start) {
533#ifdef CONFIG_BLK_DEV_RAM 533#ifdef CONFIG_BLK_DEV_RAM
534 int fd; 534 int fd;
@@ -554,9 +554,12 @@ static int __init populate_rootfs(void)
554 printk(KERN_INFO "Unpacking initramfs..."); 554 printk(KERN_INFO "Unpacking initramfs...");
555 err = unpack_to_rootfs((char *)initrd_start, 555 err = unpack_to_rootfs((char *)initrd_start,
556 initrd_end - initrd_start, 0); 556 initrd_end - initrd_start, 0);
557 if (err) 557 if (err) {
558 panic(err); 558 printk(" failed!\n");
559 printk(" done\n"); 559 printk(KERN_EMERG "%s\n", err);
560 } else {
561 printk(" done\n");
562 }
560 free_initrd(); 563 free_initrd();
561#endif 564#endif
562 } 565 }