projects/linux·commit 340e48e6

[PATCH] BLK_DEV_INITRD: do not require BLK_DEV_RAM=y

340e48e6 · Zdenek Pavlas <[email protected]> · 2006-03-25 03:07:49 -08:00

Initramfs initrd images do not need a ramdisk device, so remove this
restriction in Kconfig.  BLK_DEV_RAM=n saves about 13k on i386.  Also
without ramdisk device there's no need for "dry run", so initramfs unpacks
much faster.

People using cramfs, squashfs, or gzipped ext2/minix initrd images are
probably smart enough not to turn off ramdisk support by accident.

Cc: Al Viro <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
340e48e662dc9bf79cdd9dc755cb2eb2bad580cd
Parents
05eeae20

Changes

2 files changed · +10 −1

FileStatusAddDelContent
drivers/block/Kconfigmodified+0−1View file
init/initramfs.cmodified+10−0View file

drivers/block/Kconfig

View file
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 8b13316..e57ac5a 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -401,7 +401,6 @@ config BLK_DEV_RAM_SIZE
config BLK_DEV_INITRD
bool "Initial RAM disk (initrd) support"
- depends on BLK_DEV_RAM=y
help
The initial RAM disk is a RAM disk that is loaded by the boot loader
(loadlin or lilo) and that is mounted as root before the normal boot

init/initramfs.c

View file
diff --git a/init/initramfs.c b/init/initramfs.c
index 637344b..77b934c 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -506,6 +506,7 @@ void __init populate_rootfs(void)
panic(err);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start) {
+#ifdef CONFIG_BLK_DEV_RAM
int fd;
printk(KERN_INFO "checking if image is initramfs...");
err = unpack_to_rootfs((char *)initrd_start,
@@ -525,6 +526,15 @@ void __init populate_rootfs(void)
sys_close(fd);
free_initrd();
}
+#else
+ printk(KERN_INFO "Unpacking initramfs...");
+ err = unpack_to_rootfs((char *)initrd_start,
+ initrd_end - initrd_start, 0);
+ if (err)
+ panic(err);
+ printk(" done\n");
+ free_initrd();
+#endif
}
#endif
}