Netgear WAX220 support (almost complete)

The initial factory image really didn't work as I've expected. The WAX220 updates a bit different than the WAX206 I've used as a template. It took me a bit of tinkering, but finally I've figured it out: The WAX220 update seems much simpler: It just requires a sysupgrade tarball packed in the Netgear specific image.

However, it turns out that the resulting image doesn't create a rootfs_data UBI volume, which renders the OpenWrt pretty useless (e.g. there is no default configuration generated, so no network access at all :see_no_evil:

One way would be to back a recovery image into the factory image. With that one would have to flash the factory image first, then flash another sysupgrade using OpenWrt. Alternatively something custom would need to be made to create a rootfs_data volume. Any thoughts?

Another thing which is bothering me right now: Restoring via nmrp seems not to work as it stands. It seems that OpenWrt uses too much space for the rootfs_data UBI volume. When the nmrp script tries to create a volume for the stock rootfs, it fails:

Image is encrypted
model: WAX220
region: US
version: V1.0.2.8
dateTime: Wed Mar 22 04:19:35 2023
size: 0x16f0b3f
block size: 0x80
checksum: 0x36b0643c
Decrypt image...
Decrypt finish
ubi0: attaching mtd6
ubi0: scanning is finished
ubi0: attached mtd6 (name "ubi", size 81 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 650, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 6, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 2, total reserved PEBs: 648, PEBs reserved for bad PEB handling: 19
Updating volume 'kernel' from 0x46000800, size 0x34e9b4 ... OK
Updating volume 'rootfs' from 0x4634f400, size 0x13a0400 ... ubi0 error: ubi_create_volume: not enough PEBs, only 40 available
ubi0 error: ubi_create_volume: cannot create volume 1, error -28
*** Failed to create volume 'rootfs', err = -28 ***
ubi0: detaching mtd6
ubi0: mtd6 is detached
*** Image not supported! ***
write flash fail.

When the serial console is attached, fixing this is relatively easy: Simply removing the volume using ubi part ubi then ubi remove rootfs_data. But without access to U-Boot, I am not sure if we can do much about it.