I'm trying to build openwrt for my Netgear R6220. The device has a weird flash layout, where it MUST have a factory partition in literally the middle of NAND wasting lots of memory. So I was thinking, is there some way to split the root partition between two mtds? This is my current flash layout:
Creating 6 MTD partitions on "MT7621-NAND": 0x000000000000-0x000000100000 : "u-boot" 0x000000100000-0x000000200000 : "SC PID" 0x000000200000-0x000000600000 : "kernel" 0x000000600000-0x000002da0000 : "ubi" 0x000002da0000-0x000002f00000 : "factory" 0x000002f00000-0x000007e00000 : "rootfs_data"
What I want to do now is to somehow merge ubi and rootfs_data info one filesystem. Or another idea is to flash my squashfs /rom to ubi (since it's only ~40MB I could simply build my image with more stuff in it) and make rootfs_data a normal ubifs partition, then mount both as an overlay root. Can any of these be done?
To be honest I just can't put my head around the way the kernel decides what gets mounted as overlay, how the kernel decides which device is mountable, how the image is build to contain both and ubifs partition and a squashfs, etc. Any pointers will be welcome.