With my old patch (after replacing scpart-id by sercomm,scpart-id to make it compatible with the upstream driver), the partition table is correct (factory partition is where it should be).
With your patch applied to mt7621_netgear_sercomm_chj.dtsi, the partition table is broken. In this case ML1 is used as factory partition (with the expected results). The two reserved partitions are also wrong (but of course that doesn't directly break anything as they aren't used).
@Borromini: If it actually works for you with a partition ID of 5 for the factory partition, could you check if the kernel log contains any scpart messages on your device?
OK. I checked your original patch again and it adds a bunch of other partitions whereas OpenWrt master now just expands that reserved0 partition to a total of 0x1800000 bytes. And those extra partitions in your DTSI patch make factory indeed have ID 16. I overlooked that the first time . After the factory partition, the master DTSI does the same again: it it allocates the remainder of the flash to reserved1, whereas your patch divides it into multiple partitions (to reflect OEM partitioning I suppose). I will adapt my patch.
Any idea why those reserved ranges are treated as one big partition in OpenWrt? I suppose because they're irrelevant to OpenWrt operation and only needed by the OEM firmware.
Edit: revised patch for both the BZV and CHJ platforms here.
@janh I will test again on my R6800 and report back, if you could test on your WAC124 and if it's looking good provide your Acked-by/Suggested-by/Tested-by/... - whatever feels appropriate to you.
@tsuda@jea101@Jawadbz Since I'm at it anyway I will be whipping up images based on 22.03 HEAD. If you could test and report back for your specific device, that would be great and we can include your Tested-by in the final patch that gets sent in.
Update: flashed and working well so far
Note to others who want to try: Luci is gone after upgrade, you need to reinstall it if you still have ssh root access and internet access.
@Borromini - no worries I did use the sysupgrade img and lost luci, do you think it should not have lost it? Not big deal since I had root access and router was working fine. I just needed to install luci. thanks.
The reason my patch adds all the partitions is that the partition map parser also adjusts the size of the partitions. This means that combining multiple partitions isn't really possible anymore, as the result would just be a small partition with the offset and size of the one matching the specified scpart-id (you can see this in the kernel log I posted).
I don't think there is any other reason apart from them not being useful for OpenWrt. Although it may be possible to actually use them to enlarge the ubi partition using ubi-concat. Apparently, this has been done before and doesn't break sysupgrade. The factory image could be an issue though, and it would of course require lots of testing to make sure it really doesn't break anything.
My WAC124 also doesn't have any bad blocks either, and there kernel log still shows messages from the scpart driver. Looking at the driver code, there should always be some message, even if it doesn't find a partition table at all.
Are you sure that the driver is included in the image you tested? For 22.03, you also need to adjust the kernel config in addition to adding the driver patch (I tested using 22.03 myself).
When I started the 6350 was running factory 1.1.0.88 (loaded using nmrpflash).
I first installed the 6350 factory build without luci with time 19:02.
I installed luci and luci-ssl.
When that didn’t help I tried a reset and reinstalled luci and luci-ssl.
Still no help.
I installed the sysuprade without luci and reinstalled luci and luci-ssl.
Still no help.
I installed the sysupgade with luci (time 22:28)
I saw the message
“the uploaded backup archive is not readable”
I then did a resset which should clean up the config.
Still no help.
New builds are up, parser is enabled now. Thanks @janh. Only thing that isn't clear to me is whether we can keep the current OpenWrt partitioning that merges all those OEM only partitions into reserved0 & reserved1?
Dmesg on my R6800:
[ 1.061191] Scanning device for bad blocks
[ 2.404052] scpart: Valid 'SC PART MAP' (29 partitions) found at 0x100000
[ 2.417648] 7 scpart partitions found on MTD device mt7621-nand
[ 2.429434] Creating 7 MTD partitions on "mt7621-nand":
[ 2.439845] 0x000000000000-0x000000100000 : "u-boot"
[ 2.450962] 0x000000100000-0x000000200000 : "SC PART_MAP"
[ 2.462818] 0x000000200000-0x000000600000 : "kernel"
[ 2.473635] 0x000000600000-0x000002e00000 : "ubi"
[ 2.484255] 0x000002e00000-0x000003000000 : "reserved0"
[ 2.495921] 0x000004600000-0x000004800000 : "factory"
[ 2.507091] 0x000004800000-0x000004a00000 : "reserved1"