mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-20 02:43:38 +00:00
84 lines
1.6 KiB
Bash
Executable File
84 lines
1.6 KiB
Bash
Executable File
. /lib/functions/system.sh
|
|
|
|
qca_do_upgrade() {
|
|
local tar_file="$1"
|
|
|
|
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
|
|
board_dir=${board_dir%/}
|
|
local dev=$(find_mtd_chardev "0:HLOS")
|
|
|
|
tar Oxf $tar_file ${board_dir}/kernel | mtd write - ${dev}
|
|
|
|
if [ -n "$UPGRADE_BACKUP" ]; then
|
|
tar Oxf $tar_file ${board_dir}/root | mtd -j "$UPGRADE_BACKUP" write - rootfs
|
|
else
|
|
tar Oxf $tar_file ${board_dir}/root | mtd write - rootfs
|
|
fi
|
|
}
|
|
|
|
platform_check_image() {
|
|
local magic_long="$(get_magic_long "$1")"
|
|
board=$(board_name)
|
|
case $board in
|
|
cig,wf188|\
|
|
cig,wf188n|\
|
|
cig,wf194c|\
|
|
cig,wf194c4|\
|
|
cig,wf196|\
|
|
cybertan,eww622-a1|\
|
|
wallys,dr6018|\
|
|
wallys,dr6018-v4|\
|
|
edgecore,eap101|\
|
|
edgecore,eap102|\
|
|
edgecore,eap106|\
|
|
hfcl,ion4xi|\
|
|
hfcl,ion4xe|\
|
|
tplink,ex227|\
|
|
tplink,ex447|\
|
|
qcom,ipq6018-cp01|\
|
|
qcom,ipq807x-hk01|\
|
|
qcom,ipq807x-hk14|\
|
|
qcom,ipq5018-mp03.3)
|
|
[ "$magic_long" = "73797375" ] && return 0
|
|
;;
|
|
esac
|
|
return 1
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
CI_UBIPART="rootfs"
|
|
CI_ROOTPART="ubi_rootfs"
|
|
CI_IPQ807X=1
|
|
|
|
board=$(board_name)
|
|
case $board in
|
|
cig,wf188)
|
|
qca_do_upgrade $1
|
|
;;
|
|
cig,wf188n|\
|
|
cig,wf194c|\
|
|
cig,wf194c4|\
|
|
cig,wf196|\
|
|
cybertan,eww622-a1|\
|
|
hfcl,ion4xi|\
|
|
hfcl,ion4xe|\
|
|
qcom,ipq6018-cp01|\
|
|
qcom,ipq807x-hk01|\
|
|
qcom,ipq807x-hk14|\
|
|
qcom,ipq5018-mp03.3|\
|
|
wallys,dr6018|\
|
|
wallys,dr6018-v4|\
|
|
tplink,ex447|\
|
|
tplink,ex227)
|
|
nand_upgrade_tar "$1"
|
|
;;
|
|
edgecore,eap106|\
|
|
edgecore,eap102|\
|
|
edgecore,eap101)
|
|
CI_UBIPART="rootfs1"
|
|
[ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs"
|
|
nand_upgrade_tar "$1"
|
|
;;
|
|
esac
|
|
}
|