* any problem with changing mtdparts to a sysfs parameter?
@ 2009-05-04 19:55 Ken Cecka
0 siblings, 0 replies; only message in thread
From: Ken Cecka @ 2009-05-04 19:55 UTC (permalink / raw)
To: linux-mtd
I'm trying to modify the firmware update scripts on a board I'm working on
to allow updates to change the partition layout. One thing that would be
extremely useful is a way to change the partition layout at runtime, so that
I can read the existing partition data into RAM, change the layout, then
write the data back to the rearranged partitions.
I've been experimenting with this by converting mtdparts to a sysfs
parameter:
static char mtdparts[COMMAND_LINE_SIZE];
module_param_string(mtdparts, mtdparts, sizeof(mtdparts), S_IRUGO |
S_IWUSR);
MODULE_PARM_DESC(mtdparts, "MTD partitions");
After some other modifications to allow mtdpart_setup_real to be called more
than once, things seem to be working well. I can unbind the physmap_of
driver, define a new layout in the mtdparts sysfs file, then rebind the
physmap_of driver and see the new partition layout.
One point of concern I had - mtdpart_setup_real was protected so that it
only runs once, but I don't really understand why. It allocates an array of
mtd_partition structures, but it looks like the caller is responsible for
freeing this array. Is there any problem with letting
parse_cmdline_partitions call mtdpart_setup_real every time?
Thanks,
Ken
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-04 20:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 19:55 any problem with changing mtdparts to a sysfs parameter? Ken Cecka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).