Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

initramfs: clean up messages related to initramfs unpacking

With the removal of duplicate unpack_to_rootfs() (commit
df52092f3c97788592ef72501a43fb7ac6a3cfe0) the messages displayed do not
actually correspond to what the kernel is doing. In addition, depending
if ramdisks are supported or not, the messages are not at all the same.

So keep the messages more in sync with what is really doing the kernel,
and only display a second message in case of failure. This also ensure
that the printk message cannot be split by other printk's.

Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Eric Piel and committed by
Linus Torvalds
a1e6b6c1 fc4d5c29

+4 -9
+4 -9
init/initramfs.c
··· 574 574 if (initrd_start) { 575 575 #ifdef CONFIG_BLK_DEV_RAM 576 576 int fd; 577 - printk(KERN_INFO "checking if image is initramfs...\n"); 577 + printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n"); 578 578 err = unpack_to_rootfs((char *)initrd_start, 579 579 initrd_end - initrd_start); 580 580 if (!err) { 581 - printk(KERN_INFO "rootfs image is initramfs; unpacking...\n"); 582 581 free_initrd(); 583 582 return 0; 584 583 } else { ··· 595 596 free_initrd(); 596 597 } 597 598 #else 598 - printk(KERN_INFO "Unpacking initramfs..."); 599 + printk(KERN_INFO "Unpacking initramfs...\n"); 599 600 err = unpack_to_rootfs((char *)initrd_start, 600 601 initrd_end - initrd_start); 601 - if (err) { 602 - printk(" failed!\n"); 603 - printk(KERN_EMERG "%s\n", err); 604 - } else { 605 - printk(" done\n"); 606 - } 602 + if (err) 603 + printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err); 607 604 free_initrd(); 608 605 #endif 609 606 }