cmdline partition parsing behavior has changed: regression?

javier Martin javier.martin at vista-silicon.com
Wed Jan 30 06:23:12 EST 2013


Hi,
I've been using the following cmdline string to boot my kernel for
several releases until 3.6:

"console=ttymxc0,115200 mem=54MB init=/sbin/preinit
root=/dev/mtdblock2
mtdparts=physmap-flash.0:384k(U-Boot),2560k(kernel0),27904k(rootfs0),2048k(config0),2560k(kernel1),27904k(rootfs1),2048k(config1),32k(env1),32k(env2);"

Partition parsing always has worked properly and the "physmap-flash.0"
NOR flash was properly detected and partitioned.

However, in 3.8-rc3 I've found that this string does not work any
longer. In fact I had to add the following dirty hack to make it work:

-------
    mtd: dirty hack to fix cmdline partition parsing.

    Behavior of cmdline partition parsing seems to have changed
    recently. Currently, it doesn't like that we end our partition
    description string with a ';' character.

    A more suitable solution is yet to be found.

    Signed-off-by: Javier Martin <javier.martin at vista-silicon.com>

diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index c533f27..4ef0e7a 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -271,6 +271,10 @@ static int mtdpart_setup_real(char *s)
                     this_mtd->mtd_id, this_mtd->num_parts));


+               /* FIXME: dirty hack */
+               if (*s == ';')
+                       return 0;
+
                /* EOS - we're done */
                if (*s == 0)
                        break;

Is this a regression? Should I just change my cmdline string?

Regards.

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com



More information about the linux-mtd mailing list