1
0
Fork 0
forked from mirror/openwrt
openwrt/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh
Scott Mercer 3307fe8ee4 qualcommax: ipq50xx: add support for GL.iNET GL-B3000
Add support for GL.iNET (AX3000) B3000.

Speficiations:
* SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz)
* Memory: Winbond W634GU6NQB-11 (512 MiB DDR3-933)
* Serial Port: 3v3 TTL 115200n8
* Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax)
* Wi-Fi: QCN6102 (2x2:2 5 Ghz 802.11an/ac/ax)
* Ethernet: IPQ5018 integrated virtual switch connected to an external
            QCA8337 switch (3 Ports 10/100/1000 GBASE-T)
* Flash: Winbond W25N01GWZEIG (128 MiB)
* LEDs: 1x single-color blue LED (GPIO 24 Active High)
        1x single-color white LED (GPIO 23 Active High)
* Buttons: 1x Reset (GPIO 27 Active Low)

Flash Instructions:

*** The .img files are now universal ! ***

Openwrt		--> openwrt-qualcommax-ipq50xx-glinet_gl-b3000-squashfs-factory.img

GL.iNet OEM	--> openwrt-b3000-4.5.18-0731-1722397535.img

Either file can be flashed, in any of the available upgrade options, in both Firmwares.

Pick a file .. pick a method .. and SEND IT !!

Signed-off-by: Scott Mercer <TheRootEd24@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17903
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-20 16:11:29 +02:00

89 lines
1.8 KiB
Bash

PART_NAME=firmware
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='dumpimage fw_printenv fw_setenv head'
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
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
}
linksys_mx_pre_upgrade() {
local setenv_script="/tmp/fw_env_upgrade"
CI_UBIPART="rootfs"
boot_part="$(fw_printenv -n boot_part)"
if [ -n "$UPGRADE_OPT_USE_CURR_PART" ]; then
if [ "$boot_part" -eq "2" ]; then
CI_KERNPART="alt_kernel"
CI_UBIPART="alt_rootfs"
fi
else
if [ "$boot_part" -eq "1" ]; then
echo "boot_part 2" >> $setenv_script
CI_KERNPART="alt_kernel"
CI_UBIPART="alt_rootfs"
else
echo "boot_part 1" >> $setenv_script
fi
fi
boot_part_ready="$(fw_printenv -n boot_part_ready)"
if [ "$boot_part_ready" -ne "3" ]; then
echo "boot_part_ready 3" >> $setenv_script
fi
auto_recovery="$(fw_printenv -n auto_recovery)"
if [ "$auto_recovery" != "yes" ]; then
echo "auto_recovery yes" >> $setenv_script
fi
if [ -f "$setenv_script" ]; then
fw_setenv -s $setenv_script || {
echo "failed to update U-Boot environment"
return 1
}
fi
}
platform_check_image() {
return 0;
}
platform_do_upgrade() {
case "$(board_name)" in
glinet,gl-b3000)
glinet_do_upgrade "$1"
;;
linksys,mr5500|\
linksys,mx2000|\
linksys,mx5500|\
linksys,spnmx56)
linksys_mx_pre_upgrade "$1"
remove_oem_ubi_volume squashfs
nand_do_upgrade "$1"
;;
*)
default_do_upgrade "$1"
;;
esac
}