All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: Matt Mackall <mpm@selenic.com>,
	Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Subject: [PATCH] skip initramfs check
Date: Thu, 17 Nov 2005 12:14:32 -0200	[thread overview]
Message-ID: <20051117141432.GD9753@logos.cnet> (raw)


Hi, 

The initramfs check at populate_rootfs() can consume significant time
(several seconds) on slow/embedded platforms, since it has to decompress
the image.

Add an option to skip it under CONFIG_EMBEDDED.

Is there a nicer way to achieve the same result?

diff --git a/init/Kconfig b/init/Kconfig
index ea097e0..a9d709e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -398,6 +398,16 @@ config CC_ALIGN_JUMPS
 	  no dummy operations need be executed.
 	  Zero means use compiler's default.
 
+config INITRAMFS_SKIP
+	bool "Skip initramfs verification of initrd" if EMBEDDED
+	default n
+	help
+	  By default the initialization code uncompresses the initrd image to 
+	  verify if it is a initramfs image. 
+
+	  Say Y here if you are sure not to be using initramfs and want to
+	  skip that test.
+
 endmenu		# General setup
 
 config TINY_SHMEM
diff --git a/init/initramfs.c b/init/initramfs.c
index 0c5d9a3..92628b0 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -486,6 +486,7 @@ void __init populate_rootfs(void)
 	if (initrd_start) {
 		int fd;
 		printk(KERN_INFO "checking if image is initramfs...");
+#ifndef CONFIG_INITRAMFS_SKIP
 		err = unpack_to_rootfs((char *)initrd_start,
 			initrd_end - initrd_start, 1);
 		if (!err) {
@@ -495,6 +496,7 @@ void __init populate_rootfs(void)
 			free_initrd();
 			return;
 		}
+#endif
 		printk("it isn't (%s); looks like an initrd\n", err);
 		fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 700);
 		if (fd >= 0) {

             reply	other threads:[~2005-11-17 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 14:14 Marcelo Tosatti [this message]
2005-11-17 22:56 ` [PATCH] skip initramfs check Andrew Morton
2005-11-21  7:30 ` Rob Landley
2005-11-21  6:23   ` Marcelo Tosatti
2005-11-21 15:04     ` Rob Landley
2005-11-21 15:50       ` Matt Mackall
2005-11-21 10:49         ` Marcelo Tosatti

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=20051117141432.GD9753@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.