I've created a rough draft script that can be run on the stock OS to download and flash OpenWrt from u-boot without user interaction. This also adds a crude bootcounter - from what I have seen (and I may be wrong), the device's u-boot doesn't have bootcount capability enabled - so as to switch partitions after 3 boot failures, and then to tftp recovery if booting on both partitions fails 3 times.
Still in draft so please don't run it, however it would be good if someone with UART can test manually. Also not 100% sure if all the variables at the top of the list are necessary. bootargs can also be shortened.
Using the bootcounter also requires bootcount to be reset to 0 here.
@robimarko reporting that i applied the recent ath11k patch issued on the ax3600 forum and all fine so far (as in my ax3600 as well) no noticeable improvements as there will be more. This device is so much better
The idea is that the user runs this script from the stock OS that saves everything to the ubootenv. Next time the router boots it uses this env. In this case it's set up to perform a tftp recovery that will install OpenWrt, after which it will boot from the NAND based on the change of the active variable.
Haven't tested on this device but I have something very similar on another device.
This creates an environment variable called bootlinux, with the content as in the single quotes. fw_setenv performs the same actions as setenv followed by saveenv in u-boot. If you look at bootcmd, it contains run bootlinux that will run the content of bootlinux when called.
@rmandrad or anyone else has UART access, could you please test the u-boot env script? Running from an existing OpenWrt installation is fine. I have modified it to not run recovery on next boot so it won't wipe the existing installation. Just need to make sure there are no issues. I don't have a suitable connector here so can't confirm.
at the moment I can't as the device is in production and actually doing so well that I replaced the ax3600 for the 5ghz channel ...don't want mess anything if testing fails... your logic seems fine though ...
do you know if there is way to back up the uboot env variables ? i am unsure on which mtd they are stored.
@thorsten97 you were earlier moving from stock to openwrt. Are you able to test @clayface uboot script?
I was able to get UART access and fixed some issues with the install script.
There is one issue that I haven't worked out, but doesn't prevent installation:
IPQ807x# tftpboot 0x44000000 ${factoryimg}
ipq807x_eth_halt: done
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 Down Speed :10 Half duplex
eth0 PHY2 Down Speed :10 Half duplex
eth0 PHY3 up Speed :1000 Full duplex
eth0 PHY4 Down Speed :10 Half duplex
eth0 PHY5 Down Speed :10 Half duplex
ipq807x_eth_init: done
Using eth0 device
TFTP from server 192.168.1.10; our IP address is 192.168.1.250
Filename 'openwrt-ipq807x-generic-dynalink_dl-wrx36-squashfs-nand-factory.ubi'.
Load address: 0x44000000
Loading: *
Got TFTP_OACK: TFTP remote port: changes from 69 to 59542
#################################################################
...
#########################################
3.6 MiB/s
done
Bytes transferred = 22544384 (1580000 hex)
ipq807x_eth_halt: done
IPQ807x# imxtract 0x44000000 ubi
Invalid image type for imxtract
I am wondering if imxtract has been modified to look for a custom header? Either way, this correclty exposes $fileaddr and $filesize that are used by nand write and everything subsequent works as it should.
@robimarko do you have any views on using this install script or a variation of it for the install method?
I dont really have an opinion right now, haven't touched the Dynalink in a while.
imxtract and all other image commands only work on FIT images.
We can actually do what QCA does and that is make a FIT image with a installation script inside
any chance of syncing your repo with the openwrt master (just seen you have done it for ax3600)?
so far all working fine with this device for my use case apart from the reverse order of lan/wan devices that I reported earlier but not a showstopper. All else stable, memory etc ...
System works fantastic! The only thing that does not work on my side is sysupgrade. I always need to tftp the initramfs and ubiformat the factory image ...
I am also not able to switch to mtd20, my system is constantly booting from mtd18 no matter what I do ...