Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
toh:xiaomi:ax3200 [2024/10/01 09:02] – [Installation] lessloadtoh:xiaomi:ax3200 [2024/12/07 15:00] (current) – fix missing partition name from the mtd command 981213
Line 157: Line 157:
 ->  [[docs:guide-user:installation:generic.sysupgrade]] ->  [[docs:guide-user:installation:generic.sysupgrade]]
  
 +=== Upgrading from 23.05 and earlier to upcoming 24.10 or snapshot ===
 +
 +From the [[https://github.com/openwrt/openwrt/pull/14770/commits/870870486864143db8689bbd848989f69662b641|commit message]]:
 +
 +<code>The vendor u-boot knows nothing about UBI, and we used to have a
 +fixed-size kernel partition for vendor u-boot and UBI for rootfs.
 +However, that fixed partition becomes too small eventually, and
 +expanding it requires complicated procedure.
 +
 +This commit changed the flash layout and added a second u-boot
 +where the kernel supposed to be.
 +Now the vendor u-boot chainloads our mainline u-boot, and our
 +u-boot reads kernel+rootfs from UBI, verifies it, and boot
 +into OpenWrt.</code>
 +
 +There are **two** possible ways to convert from the old fw:
 +
 +1. Flash the factory image using mtd (recommended)
 +
 +Download factory image on the router and rename it to factory.bin. Below, you can find an example command that uses a snapshot image:
 +<code>
 +cd /tmp
 +wget -O factory.bin https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-factory.bin
 +</code>
 +
 +Then flash new layout:
 +<code>
 +mount -o remount,ro /
 +mount -o remount,ro /overlay
 +cd /tmp
 +dd if=factory.bin bs=1M count=4 | mtd write - kernel
 +dd if=factory.bin bs=1M skip=4 | mtd -r write - ubi
 +</code>
 +
 +2. Or, flash the 2nd u-boot via mtd and upload the firmware to the 2nd u-boot using tftp
 +
 +    * prepare a tftp server at 192.168.1.254 to serve the sysupgrade image:
 +
 +<code>
 +openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-squashfs-sysupgrade.itb
 +</code>
 +
 +    * upload the ubi-loader.itb to OpenWrt /tmp, and flash it to the old kernel partition:
 +
 +<code>
 +mtd -r write openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-ubi-loader.itb kernel
 +</code>
 +
 +    * The router should reboot and flash the sysupgrade image via TFTP.
 +
 +Procedure for flashing from vendor firmware shouldn't change.
  
 <WRAP BOX> <WRAP BOX>
  • Last modified: 2024/10/01 09:02
  • by lessload