Files
xiaomi-ax3600/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh

156 lines
4.2 KiB
Bash
Raw Normal View History

PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fw_printenv fw_setenv head'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
qualcommax: ipq60xx: add TP-Link EAP610-Outdoor support TP-Link EAP610-Outdoor is a 802.11ax AP claiming AX1800 support. It is wall or pole mountable, and rated for outdoor use. It can only be powered via PoE. Specifications: --------------- * CPU: Qualcomm IPQ6018 Quad core Cortex-A53 * RAM: 512 MB * Storage: ESMT PSR1GA30DT 128MB NAND * Ethernet: * Gigabit RJ45 port with PoE input * WLAN: * 2.4GHz/5GHz * LEDs: * Multi-color System LED (Green/Amber) * Buttons: * 1x Reset * UART: 4-pin unpopulated header * 1.8 V level, Pinout 1 - TX, 2 - RX, 3 - GND, 4 - 1.8V Installation: ============= Web UI method ------------- Set up the device using the vendor's web UI. After that go to Management->SSH and enable the "SSH Login" checkbox. Select "Save". The connect to the machine via SSH: ssh -o hostkeyalgorithms=ssh-rsa <ip_of_device> Disable signature verification: cliclientd stopcs Rename the "-web-ui-factory" image to something less than 63 characters, maintaining the ".bin" suffix. * Go to System -> Firmware Update. * Under "New Firmware File", click "Browse" and select the image * Select "Update" and confirm by clicking "OK". If the update fails, the web UI should show an error message. Otherwise, the device should reboot into OpenWRT. TFTP method ----------- To flash via tftp, first place the initramfs image on the TFTP server. setenv serverip <ip of tftp server> setenv ipaddr <ip in same subnet as tftp server> tftpboot tplink_eap610-outdoor-initramfs-uImage.itb bootm This should boot OpenWRT. Once booted, flash the sysupgrade.bin image using either luci or the commandline. The tplink2022 image format ============================ The vendor images of this device are packaged in a format that does not match any previous tplink formats. In order for flashing to work from the vendor's web UI, firmware updates need to be packaged in this format. The `tplink-mkimage-2022.py` is provided for this purpose. This script can also analyze vendor images, and extract the required "support" string. This string is checked by the vendor firmware, and images with a missing or incorrect string are rejected. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Link: https://github.com/openwrt/openwrt/pull/14922 Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-08-07 10:15:35 -05:00
remove_oem_ubi_volume() {
local oem_volume_name="$1"
local oem_ubivol
local mtdnum
local ubidev
mtdnum=$(find_mtd_index "$CI_UBIPART")
if [ ! "$mtdnum" ]; then
return
fi
ubidev=$(nand_find_ubi "$CI_UBIPART")
if [ ! "$ubidev" ]; then
ubiattach --mtdn="$mtdnum"
ubidev=$(nand_find_ubi "$CI_UBIPART")
fi
if [ "$ubidev" ]; then
oem_ubivol=$(nand_find_volume "$ubidev" "$oem_volume_name")
[ "$oem_ubivol" ] && ubirmvol "/dev/$ubidev" --name="$oem_volume_name"
fi
}
tplink_get_boot_part() {
local cur_boot_part
local args
# Try to find rootfs from kernel arguments
read -r args < /proc/cmdline
for arg in $args; do
local ubi_mtd_arg=${arg#ubi.mtd=}
case "$ubi_mtd_arg" in
rootfs|rootfs_1)
echo "$ubi_mtd_arg"
return
;;
esac
done
# Fallback to u-boot env (e.g. when running initramfs)
cur_boot_part="$(/usr/sbin/fw_printenv -n tp_boot_idx)"
case $cur_boot_part in
1)
echo rootfs_1
;;
0|*)
echo rootfs
;;
esac
}
tplink_do_upgrade() {
local new_boot_part
case $(tplink_get_boot_part) in
rootfs)
CI_UBIPART="rootfs_1"
new_boot_part=1
;;
rootfs_1)
CI_UBIPART="rootfs"
new_boot_part=0
;;
esac
fw_setenv -s - <<-EOF
tp_boot_idx $new_boot_part
EOF
remove_oem_ubi_volume ubi_rootfs
nand_do_upgrade "$1"
}
platform_check_image() {
return 0;
}
qualcommax: ipq60xx: add yuncore fap650 support This commit adds support for the Yuncore FAP650 device. Specifications: - Qualcomm IPQ6018+QCA8075+QCN5022+QCN5052 - 512 MB of RAM (DDR3) - 8 MB of serial flash (SPI NOR) - 128 MB of parallel flash (NAND) - 2x2 2.4 GHz WiFi (IPQ6010) - 2x2 5 GHz WiFi (IPQ6010) - 2x 2dBi 2.4G MIMO antenna - 2x 3dBi 5.8G MIMO antenna - 5x 1 Gbps Ethernet (QCA8075) - POE: 48V (IEEE 802.3af) - power: 12V (~1.5A) - 1x passthru port (rj45 - rj45) - 1x cisco rj45 console port - size: 160mm*86mm*29mm BACKUP YOUR STOCK FIRMWARE: ``` export device=fap650 mkdir -p /tmp/fw_dump_$device cd /tmp/fw_dump_$device dmesg > dmesg_$device.log dtc -I fs /sys/firmware/devicetree/base > $device.dts cat /proc/device-tree/model > model cat /proc/mtd > proc_mtd while read p; do mtd_dev=$(echo $p | cut -d: -f1) echo $mtd_dev dd if=/dev/$mtd_dev of=$mtd_dev done < proc_mtd md5sum * > md5sum.log tar -cvzf ../$device.tar.gz . export sum=$(md5sum /tmp/$device.tar.gz | cut -d' ' -f1) mv ../$device.tar.gz /tmp/${device}_${sum}.tar.gz echo fw backup saved to: /tmp/${device}_${sum}.tar.gz ``` Upload your backup via tftp to the safe place. INSTALLATION: 1. stock firmware web ui Rename factory.bin fw image file to factory.ubin. Flash this image like ordinary stock fw upgrade. 2. stock firmware telnet method Enter telnet cli (login: root, password: 476t*_f0%g09y) and upload factory.bin fw image and rename it to factory.ubin `cd /tmp && wget <your_web_server_ip>/factory.ubin` `sysupgrade factory.ubin 3. initramfs method Put imitramfs image to your TFTP server and rename it for example to fap650.initram Enable serial console and enter to the u-boot cli. Exec these commands: `tftpboot <your_tftp_server_ip>:fap650.initram` `dhcp` When downloading is finished: `bootm` After booting the device, you need to upload to the device factory.ubi fw image. ``` cd /tmp && wget <your_web_server_ip>/factory.ubi` export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1) export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1) ubiformat /dev/${rootfs} -y -f factory.ubi ubiformat /dev/${rootfs_1} -y -f factory.ubi reboot ``` 4. u-boot factory.ubi image method Put factory.ubi to your TFTP server Enter u-boot cli and exec these commands: `tftpboot <your_tftp_server_ip>:factory.ubi` `dhcp` After downloading is finished: `flash rootfs` `flash rootfs_1` `reset` STOCK FIRMWARE RECOVERY: Boot initramfs image. Upload your rootfs mtd partition to the device using scp or download it from the device using wget. Enter device ssh cli and exec: ``` cd /tmp && wget <your_web_server_ip>/rootfs_mtd` export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1) export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1) ubiformat /dev/${rootfs} -y -f /tmp/rootfs_mtd ubiformat /dev/${rootfs_1} -y -f /tmp/rootfs_mtd reboot ``` Signed-off-by: Isaev Ruslan <legale.legale@gmail.com>
2024-02-28 10:53:54 +03:00
yuncore_fap650_env_setup() {
local ubifile=$(board_name)
local active=$(fw_printenv -n owrt_slotactive)
[ -z "$active" ] && active=$(hexdump -s 0x94 -n 4 -e '4 "%d"' /dev/mtd$(find_mtd_index 0:bootconfig))
cat > /tmp/env_tmp << EOF
owrt_slotactive=${active}
owrt_bootcount=0
bootfile=${ubifile}.ubi
owrt_bootcountcheck=if test \$owrt_bootcount > 4; then run owrt_tftprecover; fi; if test \$owrt_bootcount = 3; then run owrt_slotswap; else echo bootcountcheck successfull; fi
owrt_bootinc=if test \$owrt_bootcount < 5; then echo save env part; setexpr owrt_bootcount \${owrt_bootcount} + 1 && saveenv; else echo save env skipped; fi; echo current bootcount: \$owrt_bootcount
bootcmd=run owrt_bootinc && run owrt_bootcountcheck && run owrt_slotselect && run owrt_bootlinux
owrt_bootlinux=echo booting linux... && ubi part fs && ubi read 0x44000000 kernel && bootm; reset
owrt_setslot0=setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs root=mtd:rootfs rootfstype=squashfs rootwait swiotlb=1 && setenv mtdparts mtdparts=nand0:0x3c00000@0(fs)
owrt_setslot1=setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs_1 root=mtd:rootfs rootfstype=squashfs rootwait swiotlb=1 && setenv mtdparts mtdparts=nand0:0x3c00000@0x3c00000(fs)
owrt_slotswap=setexpr owrt_slotactive 1 - \${owrt_slotactive} && saveenv && echo slot swapped. new active slot: \$owrt_slotactive
owrt_slotselect=setenv mtdids nand0=nand0,nand1=spi0.0; if test \$owrt_slotactive = 0; then run owrt_setslot0; else run owrt_setslot1; fi
owrt_tftprecover=echo trying to recover firmware with tftp... && sleep 10 && dhcp && flash rootfs && flash rootfs_1 && setenv owrt_bootcount 0 && setenv owrt_slotactive 0 && saveenv && reset
owrt_env_ver=7
EOF
fw_setenv --script /tmp/env_tmp
}
platform_do_upgrade() {
case "$(board_name)" in
cambiumnetworks,xe3-4)
fw_setenv bootcount 0
nand_do_upgrade "$1"
;;
glinet,gl-ax1800|\
glinet,gl-axt1800|\
netgear,wax214|\
qualcommax: ipq60xx: add support for Netgear WAX610 and WAX610Y Netgear WAX610 / WAX610Y is a 802.11ax AP claiming AX1800 support. Specifications: --------------- * CPU: Qualcomm IPQ6018 Quad core Cortex-A53 * RAM: 512MB * Storage: Winbond W29N01HZBINF 128MB NAND * Ethernet: * 2.5GbE RJ45 port with PoE input * WLAN: * 2.4GHz/5GHz * LEDs: * Power: Dual-color LED (Green / Orange), Single-color LED (Blue) * Ethernet: Dual-color LED (Green / Orange) * 2.4Ghz WiFi: 2x Single-color LED (Blue, Green) * 5Ghz WiFi: 2x Single-color LED (Blue, Green) * Buttons: * 1x Reset * UART: 4-pin populated header * Pinout 1 - VCC, 2 - GND, 3 - TX, 4 - RX Installation: ============= Web UI method ------------- Set up the device using the stock web UI in local management mode. Download the ui-factory.tar image. * Enter the Management tab * Select Maintenance->Upgrade->Firmware Upgrade * Ensure the "Upgrade Options" field has "Local" selected * Click "Browse File" and select the image * Click "Upgrade" (NOT "Upgrade Now") at the bottom of the page The device will install the image but reboot back into the vendor firmware. Return the to Firmware Upgrade page as above and select "Boot up Backup Firmware". The device should reboot into OpenWRT. TFTP method ----------- To flash via tftp, first place the initramfs image on the TFTP server. setenv serverip <ip of tftp server> setenv ipaddr <ip in same subnet as tftp server> tftpboot netgear_wax610-initramfs-uImage.itb bootm This should boot OpenWRT. Once booted, flash the sysupgrade.bin image using either luci or the command line. Signed-off-by: Erik Servili <serverror@serverror.com> Link: https://github.com/openwrt/openwrt/pull/18377 Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-02 23:01:16 +02:00
netgear,wax610|\
netgear,wax610y|\
qihoo,360v6)
nand_do_upgrade "$1"
;;
qualcommax: ipq60xx: add Linksys MR7500 support Codename: Divo Hardware specification: ======== SoC: Qualcomm IPQ6018 RAM: 512MB (2x ESMT 256MB DDR3L M15T2G16128A–DEBG2R) NAND Flash: 512MB (Macronix MX30UF4G18AC or SK Hynix H27S4G8F2EDA-BC) Ethernet: 1x 10/100/1000/2500/5000Mbps (Marvell AQR114C-B0) Ethernet: 4x 10/100/1000Mbps (Qualcomm QCA8075) WiFi1: 6GHz ax 4x4@20/40/160 MHz (Qualcomm QCN9024 + Skyworks SKY85784-11) - channels 33-229 WiFi2: 5GHz ax 2x2@20/40/80 MHz (Qualcomm QCN5052 + Skyworks SKY85755-11) - channels 36-177 WiFi3: 2.4GHz ax 2x2@20/40 MHz (Qualcomm QCN5022 + Skyworks SKY8340-11) IoT: Bluetooth 5 (CSR8811) - not implemented LED: 1x RGB status + USB Blue (PWM) USB: 1x USB 3.0 Button: WPS, Reset Flash instructions (Without Serial): ======== Open Linksys Web UI - http://192.168.1.1/ca or http://linksysxxxxx.lan/ca depending on your setup. xxxxx is the last 5 digits from the SN found on a sticker under the device. Click on the Linksys Logo to by-pass smart app registration. Login with your admin password. The default password can be found on the same sticker. To enter into the support mode, click on the “CA” link and the bottom of the page. Open the “Connectivity” menu and upload the squash-factory image with the “Choose file” button. Click start. Ignore all the prompts and warnings by click “yes” in all the popups. Flash instructions (With Serial): ======== 1. Installation using serial connection from OEM firmware (default login: root, password: admin): - fw_printenv -n boot_part In case of 2: - flash_erase /dev/mtd13 0 0 - nandwrite -p /dev/mtd13 openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin or in case of 1: - flash_erase /dev/mtd15 0 0 - nandwrite -p /dev/mtd15 openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin After first boot install firmware on second partition: - mtd -r -e kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin kernel or: - mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin alt_kernel 2. Installation from initramfs image using USB drive: Put the initramfs image on the USB drive: - dd bs=1M if=openwrt-qualcommax-ipq60xx-linksys_mr7500-initramfs-uImage.itb of=/dev/sda Stop u-boot and run: - usb start && usbboot $loadaddr 0 && bootm $loadaddr Write firmware to the flash from initramfs: - mtd -e kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin kernel and: - mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7500-squashfs-factory.bin alt_kernel 3. Back to the OEM firmware: - mtd -e kernel -n write FW_MR7500_1.1.12.211919_prod.img kernel and: - mtd -r -e alt_kernel -n write FW_MR7500_1.1.12.211919_prod.img alt_kernel 4. USB recovery: Put the initramfs image on the USB: - dd bs=1M if=openwrt-qualcommax-ipq60xx-linksys_mr7500-initramfs-uImage.itb of=/dev/sda Set u-boot env: - fw_setenv bootusb 'usb start && usbboot $loadaddr 0 && bootm $loadaddr' - fw_setenv bootcmd 'run bootusb; if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi' AQR firmware: ======== 0. Firmware extracting: To extract the firmware, use unblob (unblob.org) 1. Firmware loading: To properly load the firmware and initialize AQR PHY, we must use the u-boot aq_load_fw function. To do this, you need to modify u-boot env: With USB recovery: - fw_setenv bootcmd 'aq_load_fw; run bootusb; if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi' and without: - fw_setenv bootcmd 'aq_load_fw; if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi' 2. Firmware updating: Newer firmware (AQR114C.cld) is available in the latest OEM firmware (https://downloads.linksys.com/support/assets/firmware/FW_MR7500_1.1.12.211919_prod.img). Copy AQR114C.cld to /lib/firmware/marvell Link: openwrt#17428 Signed-off-by: Weikai Kong <priv@pppig236.com> Link: https://github.com/openwrt/openwrt/pull/18185 Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-21 18:49:15 -05:00
linksys,mr7350|\
linksys,mr7500)
qualcommax: ipq60xx: add Linksys MR7350 support Linksys MR7350 is a 802.11ax Dual-band router/AP. Specifications: * CPU: Qualcomm IPQ6000 Quad core Cortex-A53(A73) 1.5GHz * RAM: 512MB of DDR3 * Storage: 256Mb NAND * Ethernet: 5x1G RJ45 ports (QCA8075) * WLAN: * 2.4GHz: Qualcomm QCN5022 2x2 802.11b/g/n/ax 574 Mbps PHY rate * 5GHz: Qualcomm QCN5052 2x2@80MHz or 802.11a/b/g/n/ac/ax 1201 Mbps PHY rate * LED-s: * RGB system led * USB blue led * Buttons: 1x Soft reset 1x WPS * Power: 12V DC Jack Installation instructions: Open Linksys Web UI - http://192.168.1.1/ca or http://10.65.1.1/ca depending on your setup. Login with your admin password. The default password can be found on a sticker under the device. To enter into the support mode, click on the “CA” link and the bottom of the page. Open the “Connectivity” menu and upload the squash-factory image with the “Choose file” button. Click start. Ignore all the prompts and warnings by click “yes” in all the popups. The Wifi radios are turned off by default. To configure the router, you will need to connect your computer to the LAN port of the device. Then you would need to write openwrt to the other partition for it to work - First Check booted partition: fw_printenv -n boot_part - Change the partition: fw_setenv boot_part 1 or fw_setenv boot_part 2 depending on the current partition - Then install Openwrt to the other partition if booted in slot 1: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin alt_kernel - If in slot 2: mtd -r -e kernel -n write openwrt-qualcommax-ipq60xx-linksys_mr7350-squashfs-factory.bin kernel Co-Authored-by: Chukun Pan <amadeus@jmu.edu.cn> Co-Authored-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Vladyslav Andreichykov <vladdrako007@gmail.com> Link: https://github.com/openwrt/openwrt/pull/14807 Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-03-07 11:47:04 +02:00
boot_part="$(fw_printenv -n boot_part)"
if [ "$boot_part" -eq "1" ]; then
fw_setenv boot_part 2
CI_KERNPART="alt_kernel"
CI_UBIPART="alt_rootfs"
else
fw_setenv boot_part 1
CI_UBIPART="rootfs"
fi
fw_setenv boot_part_ready 3
fw_setenv auto_recovery yes
nand_do_upgrade "$1"
;;
qualcommax: ipq60xx: add TP-Link EAP610-Outdoor support TP-Link EAP610-Outdoor is a 802.11ax AP claiming AX1800 support. It is wall or pole mountable, and rated for outdoor use. It can only be powered via PoE. Specifications: --------------- * CPU: Qualcomm IPQ6018 Quad core Cortex-A53 * RAM: 512 MB * Storage: ESMT PSR1GA30DT 128MB NAND * Ethernet: * Gigabit RJ45 port with PoE input * WLAN: * 2.4GHz/5GHz * LEDs: * Multi-color System LED (Green/Amber) * Buttons: * 1x Reset * UART: 4-pin unpopulated header * 1.8 V level, Pinout 1 - TX, 2 - RX, 3 - GND, 4 - 1.8V Installation: ============= Web UI method ------------- Set up the device using the vendor's web UI. After that go to Management->SSH and enable the "SSH Login" checkbox. Select "Save". The connect to the machine via SSH: ssh -o hostkeyalgorithms=ssh-rsa <ip_of_device> Disable signature verification: cliclientd stopcs Rename the "-web-ui-factory" image to something less than 63 characters, maintaining the ".bin" suffix. * Go to System -> Firmware Update. * Under "New Firmware File", click "Browse" and select the image * Select "Update" and confirm by clicking "OK". If the update fails, the web UI should show an error message. Otherwise, the device should reboot into OpenWRT. TFTP method ----------- To flash via tftp, first place the initramfs image on the TFTP server. setenv serverip <ip of tftp server> setenv ipaddr <ip in same subnet as tftp server> tftpboot tplink_eap610-outdoor-initramfs-uImage.itb bootm This should boot OpenWRT. Once booted, flash the sysupgrade.bin image using either luci or the commandline. The tplink2022 image format ============================ The vendor images of this device are packaged in a format that does not match any previous tplink formats. In order for flashing to work from the vendor's web UI, firmware updates need to be packaged in this format. The `tplink-mkimage-2022.py` is provided for this purpose. This script can also analyze vendor images, and extract the required "support" string. This string is checked by the vendor firmware, and images with a missing or incorrect string are rejected. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Link: https://github.com/openwrt/openwrt/pull/14922 Signed-off-by: Robert Marko <robimarko@gmail.com>
2022-08-07 10:15:35 -05:00
tplink,eap610-outdoor)
tplink_do_upgrade "$1"
;;
qualcommax: ipq60xx: add yuncore fap650 support This commit adds support for the Yuncore FAP650 device. Specifications: - Qualcomm IPQ6018+QCA8075+QCN5022+QCN5052 - 512 MB of RAM (DDR3) - 8 MB of serial flash (SPI NOR) - 128 MB of parallel flash (NAND) - 2x2 2.4 GHz WiFi (IPQ6010) - 2x2 5 GHz WiFi (IPQ6010) - 2x 2dBi 2.4G MIMO antenna - 2x 3dBi 5.8G MIMO antenna - 5x 1 Gbps Ethernet (QCA8075) - POE: 48V (IEEE 802.3af) - power: 12V (~1.5A) - 1x passthru port (rj45 - rj45) - 1x cisco rj45 console port - size: 160mm*86mm*29mm BACKUP YOUR STOCK FIRMWARE: ``` export device=fap650 mkdir -p /tmp/fw_dump_$device cd /tmp/fw_dump_$device dmesg > dmesg_$device.log dtc -I fs /sys/firmware/devicetree/base > $device.dts cat /proc/device-tree/model > model cat /proc/mtd > proc_mtd while read p; do mtd_dev=$(echo $p | cut -d: -f1) echo $mtd_dev dd if=/dev/$mtd_dev of=$mtd_dev done < proc_mtd md5sum * > md5sum.log tar -cvzf ../$device.tar.gz . export sum=$(md5sum /tmp/$device.tar.gz | cut -d' ' -f1) mv ../$device.tar.gz /tmp/${device}_${sum}.tar.gz echo fw backup saved to: /tmp/${device}_${sum}.tar.gz ``` Upload your backup via tftp to the safe place. INSTALLATION: 1. stock firmware web ui Rename factory.bin fw image file to factory.ubin. Flash this image like ordinary stock fw upgrade. 2. stock firmware telnet method Enter telnet cli (login: root, password: 476t*_f0%g09y) and upload factory.bin fw image and rename it to factory.ubin `cd /tmp && wget <your_web_server_ip>/factory.ubin` `sysupgrade factory.ubin 3. initramfs method Put imitramfs image to your TFTP server and rename it for example to fap650.initram Enable serial console and enter to the u-boot cli. Exec these commands: `tftpboot <your_tftp_server_ip>:fap650.initram` `dhcp` When downloading is finished: `bootm` After booting the device, you need to upload to the device factory.ubi fw image. ``` cd /tmp && wget <your_web_server_ip>/factory.ubi` export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1) export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1) ubiformat /dev/${rootfs} -y -f factory.ubi ubiformat /dev/${rootfs_1} -y -f factory.ubi reboot ``` 4. u-boot factory.ubi image method Put factory.ubi to your TFTP server Enter u-boot cli and exec these commands: `tftpboot <your_tftp_server_ip>:factory.ubi` `dhcp` After downloading is finished: `flash rootfs` `flash rootfs_1` `reset` STOCK FIRMWARE RECOVERY: Boot initramfs image. Upload your rootfs mtd partition to the device using scp or download it from the device using wget. Enter device ssh cli and exec: ``` cd /tmp && wget <your_web_server_ip>/rootfs_mtd` export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1) export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1) ubiformat /dev/${rootfs} -y -f /tmp/rootfs_mtd ubiformat /dev/${rootfs_1} -y -f /tmp/rootfs_mtd reboot ``` Signed-off-by: Isaev Ruslan <legale.legale@gmail.com>
2024-02-28 10:53:54 +03:00
yuncore,fap650)
[ "$(fw_printenv -n owrt_env_ver 2>/dev/null)" != "7" ] && yuncore_fap650_env_setup
local active="$(fw_printenv -n owrt_slotactive 2>/dev/null)"
if [ "$active" = "1" ]; then
CI_UBIPART="rootfs"
else
CI_UBIPART="rootfs_1"
fi
fw_setenv owrt_bootcount 0
fw_setenv owrt_slotactive $((1 - active))
nand_do_upgrade "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}