Hello
I'm working on embedded platform (Broadcom's bcm5358u processor with MIPS core), where I need extra partitions for the purpose of further upgrade procedure. The filesystem used is SquashFS, so I modified 'struct mtd_partition' accordingly, which is passed to MTD related code, and I ended up with this (dmesg snippet):
Creating 7 MTD partitions on "sflash":
0x00000000-0x00020000 : "boot" 0x00020000-0x00600000 : "bank1os" 0x00188820-0x00600000 : "bank1fs" 0x00600000-0x00be0000 : "bank2os" 0x00788820-0x00be0000 : "bank2fs" 0x00be0000-0x00ff0000 : "app" 0x00ff0000-0x01000000 : "nvram"#cat /proc/partitions major minor #blocks name
31 0 128 mtdblock0 31 1 6016 mtdblock1 31 2 4573 mtdblock2 31 3 6016 mtdblock3 31 4 4445 mtdblock4 31 5 4160 mtdblock5 31 6 64 mtdblock6#cat /proc/mtd dev: size erasesize name mtd0: 00020000 00010000 "boot" mtd1: 005e0000 00010000 "bank1os" mtd2: 004777e0 00010000 "bank1fs" mtd3: 005e0000 00010000 "bank2os" mtd4: 004577e0 00010000 "bank2fs" mtd5: 00410000 00010000 "app" mtd6: 00010000 00010000 "nvram"
Now I want to be able to mount /dev/mtdblock4 as a temporary storage during system upgrade, but I can't do this, because it appears that this partition mtdblock4 doesn't have any FS installed. The kernel image and FS are integrated in one image, which is flashed down the /dev/mtdblock2 (which is supplied as root_fs to kernel).
I see only one solution: create a empty squashFS image, write it on /dev/mtdblock4 and may be it will work as I want (?). Is there a way to, like, format the partition on the fly, whenever the kernel boots, or it violates the MTD concepts?
Thanks.