[rdkb][common][app][Refactor sync script to match new naming rule]

[Description]
Refactor sync script to match new naming rule

[Release-log]

Change-Id: Ib2f234f56c8fdba22458c49592001d095a51945d
diff --git a/mtk_scripts/filogic-sync-openwrt-linux.sh b/mtk_scripts/filogic-sync-openwrt-linux.sh
index 93e8cb6..1c9a0d7 100755
--- a/mtk_scripts/filogic-sync-openwrt-linux.sh
+++ b/mtk_scripts/filogic-sync-openwrt-linux.sh
@@ -27,16 +27,14 @@
 mv openwrt/target/linux/generic/pending-5.4/64*.patch openwrt/target/linux/mediatek/nf_hnat/
 mv openwrt/target/linux/generic/hack-5.4/647-netfilter-flow-acct.patch openwrt/target/linux/mediatek/nf_hnat/
 mv openwrt/target/linux/generic/hack-5.4/650-netfilter-add-xt_OFFLOAD-target.patch openwrt/target/linux/mediatek/nf_hnat/
-mv openwrt/target/linux/mediatek/patches-5.4/1002-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/
+mv openwrt/target/linux/mediatek/patches-5.4/999-2708-mtkhnat-add-support-for-virtual-interface-acceleration.patch openwrt/target/linux/mediatek/nf_hnat/
 
 #cp flowblock patch
 cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/target/ ./openwrt
 #find flow patch to create ext patch for rdkb kernel build
 cd openwrt/target/linux/mediatek/patches-5.4/
 mkdir ../flow_patch
-mv 1004-mtketh-*.patch ../flow_patch
-mv 1007-mtketh-*.patch ../flow_patch
-mv 99*.patch ../flow_patch
+mv 999-30*.patch ../flow_patch
 cd -
 #end flowblock
 
@@ -45,6 +43,7 @@
 cd openwrt/target/linux/generic/
 ./rdkb_inc_helper backport-5.4
 mv backport-5.4.inc backport-5.4
+sed -i 's/999-2702-v5.9-net-phy-add-support-for-a-common-probe-between-shared-PHYs.patch/&;apply=no/' backport-5.4/backport-5.4.inc
 ./rdkb_inc_helper pending-5.4
 mv pending-5.4.inc pending-5.4
 ./rdkb_inc_helper hack-5.4
@@ -67,11 +66,12 @@
 ./rdkb_inc_helper patches-5.4/
 mv patches-5.4.inc patches-5.4
 sed -i 's/0600-net-phylink-propagate-resolved-link-config-via-mac_l.patch/&;apply=no/' patches-5.4/patches-5.4.inc
-sed -i 's/738-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc
-sed -i 's/739-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc
-sed -i 's/753-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc
-sed -i 's/757-net-phy-add-phylink-pcs-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc
-sed -i 's/9010-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-2713-mt7531-gsw-internal_phy_calibration.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-2714-mt7531-gsw-port5_external_phy_init.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-2721-net-mt753x-phy-coverity-scan.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-1710-net-phy-add-phylink-pcs-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-1712-net-phy-add-phylink-rate-matching-support.patch/&;apply=no/' patches-5.4/patches-5.4.inc
+sed -i 's/999-2725-iwconfig-wireless-rate-fix.patch/&;apply=no/' patches-5.4/patches-5.4.inc
 echo "do rework medaitek kernel patch done..........."
 #cp 32bit dts
 mkdir -p files-5.4/arch/arm/boot/dts/
diff --git a/mtk_scripts/filogic-sync-openwrt-wifi.sh b/mtk_scripts/filogic-sync-openwrt-wifi.sh
index a8c6f54..69433ff 100755
--- a/mtk_scripts/filogic-sync-openwrt-wifi.sh
+++ b/mtk_scripts/filogic-sync-openwrt-wifi.sh
@@ -48,6 +48,9 @@
 sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_5.15.%.bb
 
 echo "gen hostapd patches.........."
+rm -rf mac80211_package/package/network/services/hostapd
+tar xvf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd/hostapd_v2.10_07730ff3.tar.gz -C mac80211_package/package/network/services/
+cp -rf  mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd/patches/* mac80211_package/package/network/services/hostapd/patches
 cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
 cd mac80211_package/package/network/services/hostapd
 ./rdkb_inc_helper patches
@@ -154,6 +157,7 @@
 git clone --branch master https://gerrit.mediatek.inc/openwrt/lede mac80211_package
 
 rm -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/mac80211
+rm -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd
 cd mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/
 mv mac80211_dev mac80211
 cd -
@@ -194,6 +198,8 @@
 #sed -i 's/4003-mt76-revert-for-backports-5.15-wireless-stack.patch/&;apply=no/' meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x/patches.inc
 
 echo "gen new hostapd patches for mt76_3.x"
+
+cp -rf  mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd_new/patches/* mac80211_package/package/network/services/hostapd/patches
 cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
 cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd mac80211_package/package/network/services/
 cd mac80211_package/package/network/services/hostapd
@@ -202,9 +208,16 @@
 mv patches.inc patches
 echo "some patch do not apply to RDKB"
 sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
+
+echo "Update hostapd bb file version.........."
 #define new hostapd version
 new_hostapd_ver=2.10.3
+
 cd -
+ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-`
+sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/hostapd/hostapd_${new_hostapd_ver}.bb
+sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/wpa-supplicant/wpa-supplicant_${new_hostapd_ver}.bb
+
 rm -rf meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}
 rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/patches-${new_hostapd_ver}
 cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}