how to change size of MTD partitions at runtime
Kuefmann Andreas ICM CP RD SD 1
andreas.kuefmann at siemens.com
Wed Sep 1 07:41:58 EDT 2004
Hi all,
I'm searching for a solution to dynamically change the size of
MTD partitions at runtime.
This functionality is required for a flash update of kernel and/or
rootfs in the special case that the new kernel/rootfs is larger
than the old one. (in an embedded environment)
1.)
there is no problem in erasing the flash, e.g eraseall /dev/mtd?,
(acting from a chrooted environment)
2.)
However, reprogramming the flash with a larger image (now
exceeding the limits of the previous partition) isn't as
easy as a cp newimage.img /dev/mtd?.
The MTD layer will still rely on the (old) partition sizes
that were valid during system startup. (taken over from a
U-BOOT environment)
My plans are as follows:
- erase the flash partitions
- adapt the u-boot environment to reflect the new mtd partition sizes
- force the MTD subsystem to "re-read" the partition table in u-boot's
environment.
- cp the new images to /dev/mtd? (which now reflect the changed
partition sizes)
My question now is:
- How can I manage to force a re-read of the partition table?
Or can you think of another solution to change MTD partitions at
runtime?
Thank you,
regards,
- Andy
More information about the linux-mtd
mailing list