From 3a26ae269507c3f7b94793f39487a01a8d0f3bb1 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 20 May 2022 15:36:42 +0200 Subject: [PATCH] ipq807x: re-add patches that got lost during the v5.4 update Signed-off-by: John Crispin --- .../ipq807x/base-files/etc/board.d/02_network | 9 +++++ .../ipq807x/base-files/etc/init.d/bootcount | 10 +++--- .../base-files/lib/upgrade/platform.sh | 35 ++++++++++++++++--- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network index 255421321..67cab9b7a 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network +++ b/feeds/ipq807x/ipq807x/base-files/etc/board.d/02_network @@ -85,6 +85,15 @@ qcom_setup_macs() ucidef_set_network_device_mac eth1 $wan_mac ucidef_set_label_macaddr $wan_mac ;; + cybertan,eww622-a1) + mac=$(grep -i -m 1 mac_addr_base= /dev/`cat /proc/mtd | grep devinfo | cut -d: -f1` | cut -d= -f2) + [ -z "$mac"] && mac="00:11:22:33:44:55" + wan_mac=$(macaddr_canonicalize $mac) + lan_mac=$(macaddr_add "$wan_mac" 1) + ucidef_set_network_device_mac eth0 $wan_mac + ucidef_set_network_device_mac eth1 $lan_mac + ucidef_set_label_macaddr $wan_mac + ;; *) wan_mac=$(cat /sys/class/net/eth0/address) lan_mac=$(macaddr_add "$wan_mac" 1) diff --git a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount b/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount index 76b96457f..d0fc40e3c 100755 --- a/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount +++ b/feeds/ipq807x/ipq807x/base-files/etc/init.d/bootcount @@ -4,13 +4,15 @@ START=99 boot() { case "$(board_name)" in + hfcl,ion4xe|\ + hfcl,ion4xi) + fw_setenv boot_count 0 + ;; edgecore,eap101|\ edgecore,eap102) avail=$(fw_printenv -n upgrade_available) - [ ${avail} -eq 0 ] || { - fw_setenv bootcount 0 - fw_setenv upgrade_available 0 - } + [ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 + fw_setenv bootcount 0 ;; esac } diff --git a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh index 82773681c..13672a979 100755 --- a/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh +++ b/feeds/ipq807x/ipq807x/base-files/lib/upgrade/platform.sh @@ -1,5 +1,8 @@ . /lib/functions/system.sh +RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' + qca_do_upgrade() { local tar_file="$1" @@ -67,8 +70,6 @@ platform_do_upgrade() { edgecore,eap104|\ glinet,ax1800|\ glinet,axt1800|\ - hfcl,ion4xi|\ - hfcl,ion4xe|\ qcom,ipq6018-cp01|\ qcom,ipq807x-hk01|\ qcom,ipq807x-hk14|\ @@ -80,12 +81,36 @@ platform_do_upgrade() { tplink,ex227) nand_upgrade_tar "$1" ;; - edgecore,eap106|\ - edgecore,eap102|\ - edgecore,eap101) + hfcl,ion4xi|\ + hfcl,ion4xe) + if grep -q rootfs_1 /proc/cmdline; then + CI_UBIPART="rootfs" + fw_setenv primary 0 || exit 1 + else + CI_UBIPART="rootfs_1" + fw_setenv primary 1 || exit 1 + fi + nand_upgrade_tar "$1" + ;; + edgecore,eap106) CI_UBIPART="rootfs1" [ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs" nand_upgrade_tar "$1" ;; + edgecore,eap101|\ + edgecore,eap102) + if [ "$(find_mtd_chardev rootfs)" ]; then + CI_UBIPART="rootfs" + else + if grep -q rootfs1 /proc/cmdline; then + CI_UBIPART="rootfs2" + fw_setenv active 2 || exit 1 + else + CI_UBIPART="rootfs1" + fw_setenv active 1 || exit 1 + fi + fi + nand_upgrade_tar "$1" + ;; esac }