blob: 26e87221d6a3d4b0a3aab10f95c30d602d348c9a [file] [log] [blame]
developer843fd2b2022-04-15 18:30:12 +08001#!/bin/sh
2echo "clone.........."
3git clone --branch master https://gerrit.mediatek.inc/openwrt/lede mac80211_package
4git clone --branch openwrt-21.02 https://gerrit.mediatek.inc/openwrt/lede openwrt
5git clone --branch master https://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds
developerd728d7c2022-10-25 13:45:17 +08006git clone --branch master https://gerrit.mediatek.inc/gateway/autobuild_v5
developer843fd2b2022-04-15 18:30:12 +08007git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic
8
9echo "copy.........."
10mkdir -p mac80211_package/package/kernel/mt76/patches
11cp openwrt/package/kernel/mt76/patches/100-Revert-of-net-pass-the-dst-buffer-to-of_get_mac_addr.patch mac80211_package/package/kernel/mt76/patches
12cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/
13
14echo "gen mt76 patches.........."
developer19694572022-04-18 19:58:01 +080015cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mt76
developer843fd2b2022-04-15 18:30:12 +080016cd mac80211_package/package/kernel/mt76
17./rdkb_inc_helper patches
18mv patches.inc patches
19cd -
developer2122dd02022-10-31 13:17:48 +080020rm -rf meta-filogic/recipes-connectivity/linux-mt76/files/patches
21cp -rf mac80211_package/package/kernel/mt76/patches meta-filogic/recipes-connectivity/linux-mt76/files/
developer843fd2b2022-04-15 18:30:12 +080022
23echo "gen mac80211 patches.........."
developer19694572022-04-18 19:58:01 +080024cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mac80211/patches
developer843fd2b2022-04-15 18:30:12 +080025cd mac80211_package/package/kernel/mac80211/patches
26./rdkb_inc_helper subsys/
27./rdkb_inc_helper build/
28mv subsys.inc subsys
29mv build.inc build
30mkdir patches
31cp -r subsys patches
32cp -r build patches
33cd -
developer2122dd02022-10-31 13:17:48 +080034rm -rf meta-filogic/recipes-connectivity/linux-mac80211/files/patches
35cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-connectivity/linux-mac80211/files
developer843fd2b2022-04-15 18:30:12 +080036
37echo "copy mt76 firmware.........."
developer2122dd02022-10-31 13:17:48 +080038rm -rf meta-filogic/recipes-connectivity/linux-mt76/files/src
39cp -rf mac80211_package/package/kernel/mt76/src meta-filogic/recipes-connectivity/linux-mt76/files/
developer843fd2b2022-04-15 18:30:12 +080040
41echo "Update bb file version.........."
42ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/kernel/mt76/Makefile | cut -c 21-`
developer303006d2022-10-31 14:38:22 +080043sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/linux-mt76/mt76.inc
developer843fd2b2022-04-15 18:30:12 +080044ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
developer2122dd02022-10-31 13:17:48 +080045sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-connectivity/linux-mac80211/linux-mac80211.bb
developer843fd2b2022-04-15 18:30:12 +080046ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
developer2122dd02022-10-31 13:17:48 +080047sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-connectivity/linux-mac80211/linux-mac80211.bb
developer843fd2b2022-04-15 18:30:12 +080048
developer64ad4e62022-04-29 18:17:53 +080049echo "gen hostapd patches.........."
50cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
51cd mac80211_package/package/network/services/hostapd
52./rdkb_inc_helper patches
53mv patches.inc patches
54echo "some patch do not apply to RDKB"
55sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
56
57cd -
58rm -rf meta-filogic/recipes-connectivity/hostapd/files/patches
developer0f400252022-05-09 13:14:07 +080059rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/patches
developer64ad4e62022-04-29 18:17:53 +080060cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080061cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/wpa-supplicant/files/
developer64ad4e62022-04-29 18:17:53 +080062rm -rf meta-filogic/recipes-connectivity/hostapd/files/src
developer0f400252022-05-09 13:14:07 +080063rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/src
developer64ad4e62022-04-29 18:17:53 +080064cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080065cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/wpa-supplicant/files/
developer8bbedcf2022-05-03 12:58:56 +080066echo "cp defconfig and remove ubus"
67cp mac80211_package/package/network/services/hostapd/files/hostapd-full.config meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080068cp mac80211_package/package/network/services/hostapd/files/wpa_supplicant-full.config meta-filogic/recipes-connectivity/wpa-supplicant/files/
developerd1ddf8e2022-06-27 19:50:04 +080069#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/hostapd/files/hostapd-full.config
70#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/wpa-supplicant/files/wpa_supplicant-full.config
developer64ad4e62022-04-29 18:17:53 +080071
72echo "Update hostapd bb file version.........."
73ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-`
developer0f400252022-05-09 13:14:07 +080074sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/hostapd/hostapd_2.10.bb
75sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.10.bb
developer64ad4e62022-04-29 18:17:53 +080076
developer9eeda512022-06-16 13:36:36 +080077echo "GEN iw patches.........."
78cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/utils/iw
79cd mac80211_package/package/network/utils/iw
developer16b198b2022-08-02 11:14:02 +080080#remove patches not work for wifi hal
81rm -rf patches/200-reduce_size.patch
82
developer9eeda512022-06-16 13:36:36 +080083./rdkb_inc_helper patches
84mv patches.inc patches
85
86cd -
87rm -rf meta-filogic/recipes-connectivity/iw/patches
88cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-connectivity/iw
89ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
90newbb=iw_${ver}.bb
91cd meta-filogic/recipes-connectivity/iw/
92oldbb=`ls *.bb`
93echo "Update iw bb file name.........."
94mv ${oldbb} ${newbb}
95cd -
96
97echo "Update iw bb hash .........."
98hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-`
99sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/iw/${newbb}
100
101echo "Gen wireless-regdb patches.........."
102cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/
103cd mac80211_package/package/firmware/wireless-regdb/
104./rdkb_inc_helper patches
105mv patches.inc patches
106
107cd -
developer2122dd02022-10-31 13:17:48 +0800108rm -rf meta-filogic/recipes-connectivity/wireless-regdb/files/patches
109cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-connectivity/wireless-regdb/files/
developer9eeda512022-06-16 13:36:36 +0800110ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-`
111newbb=wireless-regdb_${ver}.bb
developer2122dd02022-10-31 13:17:48 +0800112cd meta-filogic/recipes-connectivity/wireless-regdb/
developer9eeda512022-06-16 13:36:36 +0800113oldbb=`ls *.bb`
114echo "Update wireless-regdb bb file name.........."
115mv ${oldbb} ${newbb}
116cd -
117
118echo "Update wireless-regdb bb hash.........."
119hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-`
developer2122dd02022-10-31 13:17:48 +0800120sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/wireless-regdb/${newbb}
developer9eeda512022-06-16 13:36:36 +0800121
developerb8a4a342022-07-04 10:11:28 +0800122echo "Update libubox version.........."
123ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libubox/Makefile | cut -c 21-`
124sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libubox/libubox_git.bbappend
125
126echo "Update ubus version.........."
127ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-`
128sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/ubus/ubus_git.bb
129
130echo "Update libnl-tiny version.........."
131ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-`
132sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libnl-tiny/libnl-tiny_git.bb
133
developer752a1222022-10-11 16:19:00 +0800134echo "Update atenl ...... "
developer2122dd02022-10-31 13:17:48 +0800135cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-connectivity/atenl/files/
136cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-connectivity/atenl/files/
137cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-connectivity/atenl/files/
developer752a1222022-10-11 16:19:00 +0800138
developere2f847d2022-10-12 16:37:58 +0800139echo "Update mt76-verdor ...... "
developer2122dd02022-10-31 13:17:48 +0800140cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-connectivity/mt76-vendor/files/
developere2f847d2022-10-12 16:37:58 +0800141
developerd728d7c2022-10-25 13:45:17 +0800142echo "Update Wmm Script ......."
developer2122dd02022-10-31 13:17:48 +0800143cp -rf autobuild_v5/mt7986-mac80211/target/linux/mediatek/base-files/sbin/wmm-*.sh meta-filogic/recipes-connectivity/wifi-test-tool/files/wmm_script
developerd728d7c2022-10-25 13:45:17 +0800144
developer843fd2b2022-04-15 18:30:12 +0800145echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"