* 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
[not found] ` <7121.983884306@redhat.com>
@ 2001-03-06 13:37 ` Robert Kaiser
2001-03-07 2:07 ` David Schleef
0 siblings, 1 reply; 6+ messages in thread
From: Robert Kaiser @ 2001-03-06 13:37 UTC (permalink / raw)
To: David Woodhouse; +Cc: mtd
Hi,
On Die, 06 Mär 2001 you wrote:
> It's been submitted many many times. If you do submit it again, please add
> nftl[bcd] and ftl[abcd] too, and I don't think you actually need anything
> more than
> {"mtdblock", 0x1f00},
>
> for the mtdblock devices, because they're handled just like partitions.
Hmm, I for one have two mtd devices on my platform, both of which I'd like
to be able to use as root device. But I agree that 16 is probably a bit
overkill. How about:
{"mtdblock0", 0x1f00},
{"mtdblock1", 0x1f01},
or:
{"mtdblock", 0x1f00},
{"mtdblock0", 0x1f00},
{"mtdblock1", 0x1f01},
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
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ 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
* RE: Using mtdblock as root device
2001-03-06 13:49 Vipin Malik
@ 2001-03-06 14:14 ` Robert Kaiser
2001-03-06 14:28 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Robert Kaiser @ 2001-03-06 14:14 UTC (permalink / raw)
To: Vipin Malik; +Cc: David Woodhouse, mtd
On Die, 06 Mär 2001 you wrote:
> >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.
I'd say since the kernel does support a "root=..." option it might as well
support it for all possible devices rather than just a selection of them.
But that's probably a discussion to be held in linux-kernel.
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
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using mtdblock as root device
2001-03-06 14:14 ` Robert Kaiser
@ 2001-03-06 14:28 ` David Woodhouse
0 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2001-03-06 14:28 UTC (permalink / raw)
To: rob; +Cc: Vipin Malik, mtd
rob@sysgo.de said:
> I'd say since the kernel does support a "root=..." option it might as
> well support it for all possible devices rather than just a selection
> of them.
I agree. The patch has been submitted many times. I'll resubmit it next
time I bother - actually it may already be in -ac patches.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Using mtdblock as root device
2001-03-06 13:37 ` Robert Kaiser
@ 2001-03-07 2:07 ` David Schleef
0 siblings, 0 replies; 6+ messages in thread
From: David Schleef @ 2001-03-07 2:07 UTC (permalink / raw)
To: Robert Kaiser; +Cc: mtd
On Tue, Mar 06, 2001 at 02:37:48PM +0100, Robert Kaiser wrote:
> Hi,
>
> On Die, 06 Mär 2001 you wrote:
> > It's been submitted many many times. If you do submit it again, please add
> > nftl[bcd] and ftl[abcd] too, and I don't think you actually need anything
> > more than
> > {"mtdblock", 0x1f00},
> >
> > for the mtdblock devices, because they're handled just like partitions.
>
> Hmm, I for one have two mtd devices on my platform, both of which I'd like
> to be able to use as root device. But I agree that 16 is probably a bit
> overkill. How about:
>
> {"mtdblock0", 0x1f00},
> {"mtdblock1", 0x1f01},
> or:
> {"mtdblock", 0x1f00},
> {"mtdblock0", 0x1f00},
> {"mtdblock1", 0x1f01},
Just {"mtdblock", 0x1f00} will suffice, because any number
appended will be converted to an integer and be added to the
base number given.
Check the implementation of name_to_kdev_t in init/main.c for
details.
dave...
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