mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Kitching <skitching@apache.org>
To: linux-kernel@vger.kernel.org
Cc: Simon Kitching <skitching@apache.org>
Subject: [PATCH] initramfs: prevent initramfs printk message being split by messages from other code.
Date: Fri, 20 Mar 2009 21:18:05 +0100	[thread overview]
Message-ID: <1237580285-25792-1-git-send-email-skitching@apache.org> (raw)

initramfs uses printk without a linefeed, then does some work, then uses printk
to finish the message off. However if some other code does a printk in between,
then the messages get mixed together. Better for each message to be an independent
line...

  Example of problem that this fixes:
    checking if image is initramfs...<7>Switched to high resolution mode on CPU 1
    Switched to high resolution mode on CPU 0
    it is

Signed-off-by: Simon Kitching <skitching@apache.org>
---
 init/initramfs.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index d9c941c..948a2c6 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -583,17 +583,18 @@ static int __init populate_rootfs(void)
 	if (initrd_start) {
 #ifdef CONFIG_BLK_DEV_RAM
 		int fd;
-		printk(KERN_INFO "checking if image is initramfs...");
+		printk(KERN_INFO "Checking if rootfs image is initramfs...\n");
 		err = unpack_to_rootfs((char *)initrd_start,
 			initrd_end - initrd_start, 1);
 		if (!err) {
-			printk(" it is\n");
+			printk(KERN_INFO "rootfs image is initramfs; unpacking...\n");
 			unpack_to_rootfs((char *)initrd_start,
 				initrd_end - initrd_start, 0);
 			free_initrd();
 			return 0;
 		}
-		printk("it isn't (%s); looks like an initrd\n", err);
+		printk(KERN_INFO "rootfs image is not initramfs (%s)"
+			"; looks like an initrd\n", err);
 		fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700);
 		if (fd >= 0) {
 			sys_write(fd, (char *)initrd_start,
-- 
1.6.0.4


                 reply	other threads:[~2009-03-20 20:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237580285-25792-1-git-send-email-skitching@apache.org \
    --to=skitching@apache.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome