Commit a1e6b6c1 authored by Eric Piel's avatar Eric Piel Committed by Linus Torvalds

initramfs: clean up messages related to initramfs unpacking

With the removal of duplicate unpack_to_rootfs() (commit
df52092f) 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: default avatarEric Piel <eric.piel@tremplin-utc.net>
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fc4d5c29
...@@ -574,11 +574,10 @@ static int __init populate_rootfs(void) ...@@ -574,11 +574,10 @@ static int __init populate_rootfs(void)
if (initrd_start) { if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_RAM
int fd; int fd;
printk(KERN_INFO "checking if image is initramfs...\n"); printk(KERN_INFO "Trying to unpack rootfs image as initramfs...\n");
err = unpack_to_rootfs((char *)initrd_start, err = unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start); initrd_end - initrd_start);
if (!err) { if (!err) {
printk(KERN_INFO "rootfs image is initramfs; unpacking...\n");
free_initrd(); free_initrd();
return 0; return 0;
} else { } else {
...@@ -596,15 +595,11 @@ static int __init populate_rootfs(void) ...@@ -596,15 +595,11 @@ static int __init populate_rootfs(void)
free_initrd(); free_initrd();
} }
#else #else
printk(KERN_INFO "Unpacking initramfs..."); printk(KERN_INFO "Unpacking initramfs...\n");
err = unpack_to_rootfs((char *)initrd_start, err = unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start); initrd_end - initrd_start);
if (err) { if (err)
printk(" failed!\n"); printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
printk(KERN_EMERG "%s\n", err);
} else {
printk(" done\n");
}
free_initrd(); free_initrd();
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment