public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Using mtdblock as root device
@ 2001-03-06 11:38 Robert Kaiser
       [not found] ` <7121.983884306@redhat.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Kaiser @ 2001-03-06 11:38 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mtd

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

Hi,

I just tried to build a system that uses jffs on /dev/mtdblock0 as root fs.
This didn't work right away because the kernel did not honor the option
"root=/dev/mtdblock0" . This is because mtdblock devices are not listed
in the list of known root devices in the kernel (see "root_dev_names" in file
init/main.c). After applying the attached patch, using mtdblock as rootfs
worked nicely.

Now my question is: is there any particular reason (other than "nobody has
told Linus") why this is not already in the standard kernel ?

If there isn't, should I go ahead and submit my patch to Linus ?


Cheers

Rob


----------------------------------------------------------------
Robert Kaiser                         email: rkaiser@sysgo.de
SYSGO RTS GmbH
Am Pfaffenstein 14                    phone: (49) 6136 9948-762
D-55270 Klein-Winternheim / Germany   fax:   (49) 6136 9948-10

[-- Attachment #2: patch-mtdblock-root --]
[-- Type: text/plain, Size: 656 bytes --]

--- linux/init/main.c.orig	Thu Jan  4 05:45:26 2001
+++ linux/init/main.c	Tue Mar  6 12:57:00 2001
@@ -273,6 +273,24 @@
 #ifdef CONFIG_NFTL
 	{ "nftla", 0x5d00 },
 #endif
+#ifdef CONFIG_MTD
+	{ "mtdblock0", 0x1f00 },
+	{ "mtdblock1", 0x1f01 },
+	{ "mtdblock2", 0x1f02 },
+	{ "mtdblock3", 0x1f03 },
+	{ "mtdblock4", 0x1f04 },
+	{ "mtdblock5", 0x1f05 },
+	{ "mtdblock6", 0x1f06 },
+	{ "mtdblock7", 0x1f07 },
+	{ "mtdblock8", 0x1f08 },
+	{ "mtdblock9", 0x1f09 },
+	{ "mtdblock10", 0x1f0a },
+	{ "mtdblock11", 0x1f0b },
+	{ "mtdblock12", 0x1f0c },
+	{ "mtdblock13", 0x1f0d },
+	{ "mtdblock14", 0x1f0e },
+	{ "mtdblock15", 0x1f0f },
+#endif
 	{ NULL, 0 }
 };
 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: Using mtdblock as root device
@ 2001-03-06 13:49 Vipin Malik
  2001-03-06 14:14 ` Robert Kaiser
  0 siblings, 1 reply; 6+ messages in thread
From: Vipin Malik @ 2001-03-06 13:49 UTC (permalink / raw)
  To: 'Robert Kaiser ', 'David Woodhouse '
  Cc: 'mtd@infradead.org '

>Now my question is: is there any particular reason (other than "nobody
>has told Linus") why this is not already in the standard kernel ?


because it's easier to do a
$rdev <your kernel image here> /dev/mtdblock0 before installing
the kernel with lilo. You don't need to pass any root kernel
line parameters then.

You can even boot a compressed root file system this way by
passing the bit LOAD_RAMDISK=1, the RAMDISK_OFFSET=<your offset in
1k from the start of your root device>. See the bootdisk
howto.

Additionally, You have to go and hack the rd.c code in drivers/block/rc.c to
remove the check to see that the boot device for compressed f/s
is a floppy.

As one additional matter you have to add a call to rd_load() just
before mount_root() in init/main.c so that the ramdisk loading code
runs *after* the mtdblock device has been registered.

Go back in the archives a few weeks. There was quite a bit
discussion re. this matter. I've found all these problems before :)

There's quite a big update to the HOWTO pending that I'll commit
as soon as I get some time (that includes all this stuff and
some corrections). There is a bigger power fail issue
in jffs1 that's hogging all my time right now.

Vipin


To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-07  2:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-06 11:38 Using mtdblock as root device Robert Kaiser
     [not found] ` <7121.983884306@redhat.com>
2001-03-06 13:37   ` Robert Kaiser
2001-03-07  2:07     ` David Schleef
  -- strict thread matches above, loose matches on Subject: below --
2001-03-06 13:49 Vipin Malik
2001-03-06 14:14 ` Robert Kaiser
2001-03-06 14:28   ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox