Hi have installed OpenWRT 24.10.2 on a NETGEAR Switch GS310TP v1. Working perfectly. This device is also dual-boot capable, and it would be great to be able to use this little helper as well.
@aaul the wiki states the command to switch to partition 2 is different: fw_setsys bootpartition 1.
@RaylynnKnight were you considering submitting a PR for luci-app-advanced-reboot to support this device? If so, Iād wait for you to do that since you have the device on hand. If not, let me know if between you and @aaul you can test the APK i can produce.
PS. @RaylynnKnight educate me please, with only a single kernel partition, where from can I read the labels for different firmware boots on this device? I think normally there is a kernel partitions per firmware and thatās how I get the labels for different firmwares. Is an alternative kernel partition mtd9?Also what would be the labelOffset ā how many bytes to skip on the flag/kernel partitions so I can read their labels?
PPS. @aaul if you can grab first 1024 bytes (I know, itās an oddly specific number) from mtd5, mtd6 and mtd9 and post them somewhere that would help. Also, what does fw_printsys produce?
PPPS. Thanks @slh for the hint below, added mtd5 to list of partitions to investigate.
Disclaimer: I donāt own any of the switches in this model range, the below is just an educated guess.
I think /proc/mtd is misleading here, as it reflects the dynamic split between kernel+rootfs+overlay badly. The DTS is more helpful:
Iām pretty sure firmware: partition@300000(firmware) and partition@1180000(runtime2) are the relevant partitions here (14.5 MB each), dynamically split into kernel+rootfs+overlay.
OpenWrt can only boot off the first partition (this is hardcoded in the DTS). The second partition is for booting into the stock firmware.
@stangri I donāt have any experience with using luci-app-advanced-reboot and would not have time to devote to a PR until early October. As per the wiki documentation for this device āOpenWrt can only boot off the first partition (this is hardcoded in the DTS).ā
The vendor firmware would allow me to choose bootpartition 1 and then flash software into it - haven't tried though. (bootpartition 0 is OpenWRT, bootpartition 1 is last stable vendor)
Booting on CLI into bootpartition1 is literally as simple as:
for i in mtd5 mtd6 mtd9; do dd if=/dev/${i} bs=1 count=1024 > /tmp/${i}; done
this would produce three files in /tmp/ which you can inspect with Hexdump and see if you can locate kernel info. Youāre looking for the offset value (you can pass to skip=$offset added to command above) to start the output with something like: ARM64 OpenWrt Linux-6.6.93. Also, note which mtds have this label.
In the mean time, Iāve pushed the 1.1.1-r1 to both my repositories and github releases tab which has preliminary support for Netgear GS308T v1 as it now uses customizable commands to obtain and set environment variables.
Iāve only tested it on Linksys devices with both UBI and non-UBI volumes and it seems to work.
Iād appreciate testing on the ānon-standardā devices like:
"d-link,dgs-1210-28"
"mercusys,mr90x-v1"
"xiaomi,ax3600"
"xiaomi,ax9000"
"zyxel,nbg6817"
Iāve converted the RPCD script to ucode and brought some sensible structure to the device json now instead of them being flat for the benefit/ease of parsing in the shell script.
I hope transition to ucode brings additional contributors as, looking back at it, the original json schema and RPCD shell script were garbage code.
Both of these are no longer dual-firmware capable (havenāt ever been in a stable release, only shortly in master snapshots). The flash partitioning was rather unfortunate, leaving around ~19 MB free flash, despite their physical 256 MB NAND. Accordingly OpenWrt changed the partitioning to use rootfs0 for the kernel and rootfs1+until_the_end_of_the_flash for the rootfs+overlay.
So yes, these devices are made with a/ b booting in mind by the vendor - but no, once you install OpenWrt (any version, unless you dive deep into main history) there is only a single boot slot left (and toggling to the b-slot would brick the device). Reverting to the OEM firmware with a/ b slots is possible via tftp recovery, but no released version of OpenWrt will leave the b-slot bootable.
Once OpenWrt (any version) is installed, thereās only compressed garbage (ubi+squashfs of the OpenWrt rootfs) left in the b-slot for ax3600/ ax9000, so luci-app-advanced-reboot canāt work on this hardware.
Thanks for your prompt reply, I really wanted to tag you due to the volume and effect of your contributions to this package, so Iām glad you saw this even without tagging.
Well, something is working ... using the commands in CLI I shared earlier works fine in terms of switching the boot device for next reboot and with that be able to go to manufacturer firmware on second boot partition and from there back again to OpenWRT.
Appreciate your help and still looking forward to at least switch boot partition from luci