newbie: dynamic partition creation possible

Marius Groeger mag at sysgo.de
Tue Aug 20 03:40:27 EDT 2002


On Tue, 20 Aug 2002, Michael Palme wrote:

> the flash devices (no filesystem etc.). i need different "partitions" on
> the flash and i dont want to hardcode that --
> i have seen in cmdline.c that this is possible via kernel parameters.
> i'm not absolutely sure what kernel options are needed and what are
> unnecessary.

What is unclear with it? cmdline.c contains examples how to use it. Actually
it can be very simple. For instance, the following term will give you two
partitions, one with 1 MiB and another with all the rest. Both will be
read-write and will receive standard labels:

   mtdparts=my-mtd-id:1m,-

However, you may have to adapt the mapping driver to use the cmdline
partitioning. Here's how:

   int num_mtd_parts, result;
   struct mtd_partition *mtd_parts;
   struct mtd_info mtd;

   num_mtd_parts = parse_cmdline_partitions(&mtd, &mtd_parts, "my-mtd-id");
   result = add_mtd_partitions (&mtd, mtd_parts, num_mtd_parts);

As an aside: it is good (but rare) practice to use the various CONFIG_
options for partitioning features.

Regards,
Marius

-----------------------------------------------------------------------------
Marius Groeger           SYSGO Real-Time Solutions GmbH     mgroeger at sysgo.de
Software Engineering     Embedded and Real-Time Software    www.sysgo.de
Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com





More information about the linux-mtd mailing list