[PATCH] skip initramfs check

From: Marcelo Tosatti
Date: Thu Nov 17 2005 - 14:32:04 EST


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.

+ 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

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...");
err = unpack_to_rootfs((char *)initrd_start,
initrd_end - initrd_start, 1);
if (!err) {
@@ -495,6 +496,7 @@ void __init populate_rootfs(void)
printk("it isn't (%s); looks like an initrd\n", err);
fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 700);
if (fd >= 0) {
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/