[Avila] How to write on the "RedBoot config" partition

Andrea Tassi andrea.tassi at gmail.com
Tue Nov 27 08:22:22 EST 2007


Hi guys,

my task is to edit the "RedBoot config" partition from a booted system in
the Avila board (GW2348-4) flash memory. For the first thing I unlock the
"RedBoot config" partition from the RedBoot shell.

Performing a "cat /proc/mtd" from the booted system I can see the mtd
devices correctly initialized:
dev:   size          erasesize   name
...
mtd5: 00001000 00020000 "RedBoot config"
...

then I perfom:
mknod /dev/mtd5 c 90 10
mknod /dev/mtdblock5 b 31 5

At this point I can read both devices that point to the "RedBoot config"
partition. My problem is that I can't write on /dev/mtd5 or on
/dev/mtdblock5 (in this device I can write but the changes are not saved!)
nevertheless I'm using a kernel capable to write on RedBoot partitions. I
have also tried to apply the following patch to force a read and write
access to RedBoot config partition (because the RedBoot config partiton
doesen't start and stop on an erase block boundary) with no effects:

--- /usr/src/snapgear/linux-2.6.x/drivers/mtd/mtdpart_original.c
2006-02-10 08:22:48.000000000 +0100
+++ /usr/src/snapgear/linux-2.6.x/drivers/mtd/mtdpart.c 2007-11-27 12:17:
43.000000000 +0100
@@ -517,14 +517,17 @@
                    (slave->offset % slave->mtd.erasesize)) {
                        /* Doesn't start on a boundary of major erase size
*/
                        /* FIXME: Let it be writable if it is on a boundary
of _minor_ erase size though */
-                       slave->mtd.flags &= ~MTD_WRITEABLE;
-                       printk ("mtd: partition \"%s\" doesn't start on an
erase block boundary -- force read-only\n",
-                               parts[i].name);
+                       //slave->mtd.flags &= ~MTD_WRITEABLE;
+                       slave->mtd.flags &=MTD_WRITEABLE;
+                       //printk ("mtd: partition \"%s\" doesn't start on an
erase block boundary -- force read-only\n",
+                       printk ("mtd: partition \"%s\" doesn't start on an
erase block boundary -- force read and write\n", parts[i].name);
                }
                if ((slave->mtd.flags & MTD_WRITEABLE) &&
                    (slave->mtd.size % slave->mtd.erasesize)) {
-                       slave->mtd.flags &= ~MTD_WRITEABLE;
-                       printk ("mtd: partition \"%s\" doesn't end on an
erase block -- force read-only\n",
+                       //slave->mtd.flags &= ~MTD_WRITEABLE;
+                       slave->mtd.flags &=MTD_WRITEABLE;
+                       //printk ("mtd: partition \"%s\" doesn't end on an
erase block -- force read-only\n",
+                       printk ("mtd: partition \"%s\" doesn't end on an
erase block -- force read and write\n",
                                parts[i].name);
                }


Thanks for your help.

Ciao
Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gateworks.com/pipermail/avila/attachments/20071127/339ac3e3/attachment.htm 


More information about the Avila mailing list