Sad if Netgear has dropped nmrpflash feature.
Currently I load openwrt from tftp into ram from uboot like so:
tftpboot openwrt-qualcommax-ipq807x-netgear_wax218-initramfs-uImage.itb
and then boot that image with:
bootm
This gets me to openwrt. From here I would like to write openwrt to flash instead of it being in ram. If I try /usr/sbin/ubiformat /dev/mtd12 -f /tmp/openwrt.ubi
it says that there is not enough space:
root@OpenWrt:/tmp# /usr/sbin/ubiformat /dev/mtd12 -f /tmp/openwrt-qualcommax-ipq
ubiformat: mtd12 (nand), size 524288 bytes (512.0 KiB), 4 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
ubiformat: 3 eraseblocks are supposedly empty
ubiformat: warning!: 1 of 4 eraseblocks contain non-UBI data
ubiformat: continue? (y/N) y
ubiformat: warning!: only 0 of 4 eraseblocks have valid erase counter
ubiformat: erase counter 0 will be used for all eraseblocks
ubiformat: note, arbitrary erase counter value may be specified using -e option
ubiformat: continue? (y/N) y
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: error!: file "/tmp/openwrt-qualcommax-ipq807x-netgear_wax218-squashfs-factory.ubi" is too large (12582912 bytes)
I am not very familiar with mtd. It shows like this:
root@OpenWrt:/tmp# cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 "0:sbl1"
mtd1: 00100000 00020000 "0:mibib"
mtd2: 00300000 00020000 "0:qsee"
mtd3: 00080000 00020000 "0:devcfg"
mtd4: 00080000 00020000 "0:apdp"
mtd5: 00080000 00020000 "0:rpm"
mtd6: 00080000 00020000 "0:cdt"
mtd7: 00080000 00020000 "0:appsblenv"
mtd8: 00040000 00020000 "env-data"
mtd9: 006a0000 00020000 "0:appsbl"
mtd10: 00060000 00020000 "cert"
mtd11: 00100000 00020000 "userconfig"
mtd12: 00080000 00020000 "0:art"
mtd13: 06f00000 00020000 "rootfs"
mtd14: 00900000 00020000 "0:wififw"
mtd15: 06f00000 00020000 "rootfs_1"
mtd16: 00900000 00020000 "0:wififw_1"
It seems different to what is expected at https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=7801161c4bb2413817b3dfd01695050e2da27bf3
Update: I now have Openwrt on the flash and the "System running in recovery (initramfs) mode." message is not shown anymore. What I've done is first made sure that it is on active_fw 1
From openwrt it can be set as /usr/sbin/fw_setenv active_fw 1
and rebooted. It is possible to set it via serial too.
setenv active_fw 1
saveenv
reset
Next, I've just used /dev/mtd13 instead of /dev/mtd12 and set active_fw to 0 so it boots to it:
root@OpenWrt:/tmp# /usr/sbin/ubiformat /dev/mtd13 -f /tmp/openwrt-qualcommax-ipq
807x-netgear_wax218-squashfs-factory.ubi
ubiformat: mtd13 (nand), size 116391936 bytes (111.0 MiB), 888 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 887 -- 100 % complete
ubiformat: 888 eraseblocks have valid erase counter, mean value is 2
ubiformat: flashing eraseblock 95 -- 100 % complete
ubiformat: formatting eraseblock 887 -- 100 % complete
root@OpenWrt:/tmp# /usr/sbin/fw_setenv active_fw 0
Now, I am also seeing wireless interfaces:
Good job, and great that you fixed it and also shared a little how to
I was wondering now if sysupgrade will work the next time I'll be updating openwrt? Will it figure it out somehow that partition numbers are different on my device compared to initial git commit that brought support for this device?