From c33df4eaaf41fd3e34837a6ae9a5f9970c393d9f Mon Sep 17 00:00:00 2001 From: Jean-Paul Saman Date: Sat, 10 Feb 2007 01:44:43 -0800 Subject: [PATCH] disable init/initramfs.c The file init/initramfs.c is always compiled and linked in the kernel vmlinux even when BLK_DEV_RAM and BLK_DEV_INITRD are disabled and the system isn't using any form of an initramfs or initrd. In this situation the code is only used to unpack a (static) default initial rootfilesystem. The current init/initramfs.c code. usr/initramfs_data.o compiles to a size of ~15 kbytes. Disabling BLK_DEV_RAM and BLK_DEV_INTRD shrinks the kernel code size with ~60 Kbytes. This patch avoids compiling in the code and data for initramfs support if CONFIG_BLK_DEV_INITRD is not defined. Instead of the initramfs code and data it uses a small routine in init/noinitramfs.c to setup an initial static default environment for mounting a rootfilesystem later on in the kernel initialisation process. The new code is: 164 bytes of size. The patch is separated in two parts: 1) doesn't compile initramfs code when CONFIG_BLK_DEV_INITRD is not set 2) changing all plaforms vmlinux.lds.S files to not reserve an area of PAGE_SIZE when CONFIG_BLK_DEV_INITRD is not set. [deweerdt@free.fr: warning fix] Signed-off-by: Jean-Paul Saman Cc: Al Viro Cc: Signed-off-by: Frederik Deweerdt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/block/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 58c1debf86f..cacb1c816e3 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -417,8 +417,10 @@ config BLK_DEV_INITRD etc. See for details. If RAM disk support (BLK_DEV_RAM) is also included, this - also enables initial RAM disk (initrd) support. + also enables initial RAM disk (initrd) support and adds + 15 Kbytes (more on some other architectures) to the kernel size. + If unsure say Y. config CDROM_PKTCDVD tristate "Packet writing on CD/DVD media" -- cgit v1.2.3