kernel_optimize_test/drivers/mtd/devices
Ville Herva c4e7fb3137 block2mtd.c: Make kernel boot command line arguments work (try 4)
Trying to pass kernel command line arguments to block2mtd at boot-time does
not work currently. block2mtd_setup() is called so early that kmalloc()
fails nevermind being able to do open_bdev_excl() (which requires rootfs to
be mounted. This patch only saves the option string at the early boot stage,
and parses them later when block2mtd_init() is called. If open_bdev_excl()
fails, open_by_devnum(name_to_dev_t()) is tried instead, which makes it
possible to initialize the driver before rootfs has been mounted. Also gets
rid of the superfluous parse_name() that only checks if name is longer than
80 chars and copies it to a string that is not kfreed.

With this patch, I can boot statically compiled block2mtd, and mount jffs2
as rootfs (without modules or initrd), with lilo config like this:

   root=/dev/mtdblock0
   append="rootfstype=jffs2 block2mtd.block2mtd=/dev/hdc2,65536"

(Note that rootfstype=jffs2 is required, since the kernel only tries
filesystems without "nodev" attribute by default, and jffs is "nodev").

Compared to first version of this patch, this one does not copy the
parameters to the global buffer if init has already been called, and the
global array is marked as __initdata.

Compared to the second version of this patch, module build is fixed.

Compared to the third version of this patch, statically compiled block2mtd
driver with no boot-time parameter no longer gives spurious error 'cannot
open device ""'

Signed-off-by: Ville Herva <vherva@vianova.fi>
Acked-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-07-15 13:39:10 +01:00
..
block2mtd.c block2mtd.c: Make kernel boot command line arguments work (try 4) 2006-07-15 13:39:10 +01:00
doc2000.c [MTD] DOC: Fixup read functions and do a little cleanup 2006-06-28 10:11:33 +02:00
doc2001.c [MTD] DOC: Fixup read functions and do a little cleanup 2006-06-28 10:11:33 +02:00
doc2001plus.c [MTD] DOC: Fixup read functions and do a little cleanup 2006-06-28 10:11:33 +02:00
docecc.c
docprobe.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig Re-add module description for ms02-nv to Kconfig 2006-05-17 16:20:37 +01:00
lart.c [MTD] assume mtd->writesize is 1 for NOR flashes 2006-06-14 19:53:44 +04:00
m25p80.c [MTD] assume mtd->writesize is 1 for NOR flashes 2006-06-14 19:53:44 +04:00
Makefile
ms02-nv.c [MTD] Initialize 'writesize' 2006-06-22 18:15:48 +04:00
ms02-nv.h
mtd_dataflash.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mtdram.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
phram.c [MTD] Initialize 'writesize' 2006-06-22 18:15:48 +04:00
pmc551.c remove #error on !PCI from pmc551.c 2006-07-15 13:19:55 +01:00
slram.c [MTD] Initialize 'writesize' 2006-06-22 18:15:48 +04:00