blob: 011bdbe6ea46ac27a6fb0bfd98eafa7d4b525d98 [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
developer843fd2b2022-04-15 18:30:12 +08004git clone --branch master https://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds
developerd728d7c2022-10-25 13:45:17 +08005git clone --branch master https://gerrit.mediatek.inc/gateway/autobuild_v5
developer843fd2b2022-04-15 18:30:12 +08006git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic
7
8echo "copy.........."
9mkdir -p mac80211_package/package/kernel/mt76/patches
developer64409412022-12-13 17:06:55 +080010rm -rf mac80211_package/package/kernel/mac80211
developer843fd2b2022-04-15 18:30:12 +080011cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/
12
developer64409412022-12-13 17:06:55 +080013echo "gen wifi mt76 patches.........."
developer19694572022-04-18 19:58:01 +080014cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mt76
developer843fd2b2022-04-15 18:30:12 +080015cd mac80211_package/package/kernel/mt76
16./rdkb_inc_helper patches
17mv patches.inc patches
18cd -
developerc480fbb2022-11-07 18:39:36 +080019rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches
20cp -rf mac80211_package/package/kernel/mt76/patches meta-filogic/recipes-wifi/linux-mt76/files/
developer843fd2b2022-04-15 18:30:12 +080021
developer64409412022-12-13 17:06:55 +080022echo "gen wifi6 mac80211 patches.........."
23tar xvf mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/mac80211/mac80211_v5.15.81_077622a1.tar.gz -C mac80211_package/package/kernel/
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 -
developerc480fbb2022-11-07 18:39:36 +080034rm -rf meta-filogic/recipes-wifi/linux-mac80211/files/patches
35cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-wifi/linux-mac80211/files
developer843fd2b2022-04-15 18:30:12 +080036
37echo "copy mt76 firmware.........."
developerc480fbb2022-11-07 18:39:36 +080038rm -rf meta-filogic/recipes-wifi/linux-mt76/files/src
39cp -rf mac80211_package/package/kernel/mt76/src meta-filogic/recipes-wifi/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-`
developerc480fbb2022-11-07 18:39:36 +080043sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/linux-mt76/mt76.inc
developer843fd2b2022-04-15 18:30:12 +080044ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
developera52defa2022-12-09 13:01:55 +080045sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_5.15.%.bb
developer843fd2b2022-04-15 18:30:12 +080046ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
developera52defa2022-12-09 13:01:55 +080047sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_5.15.%.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 -
developerc480fbb2022-11-07 18:39:36 +080058rm -rf meta-filogic/recipes-wifi/hostapd/files/patches
59rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/patches
60cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/hostapd/files/
61cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/wpa-supplicant/files/
62rm -rf meta-filogic/recipes-wifi/hostapd/files/src
63rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/src
64cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-wifi/hostapd/files/
65cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-wifi/wpa-supplicant/files/
developer8bbedcf2022-05-03 12:58:56 +080066echo "cp defconfig and remove ubus"
developerc480fbb2022-11-07 18:39:36 +080067cp mac80211_package/package/network/services/hostapd/files/hostapd-full.config meta-filogic/recipes-wifi/hostapd/files/
68cp mac80211_package/package/network/services/hostapd/files/wpa_supplicant-full.config meta-filogic/recipes-wifi/wpa-supplicant/files/
69#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-wifi/hostapd/files/hostapd-full.config
70#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-wifi/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-`
developerc480fbb2022-11-07 18:39:36 +080074sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/hostapd/hostapd_2.10.bb
75sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.bb
developer61b9b982022-11-10 12:05:10 +080076#cp openwrt hostapd script
77cp -rf mac80211_package/package/network/services/hostapd/files/hostapd.sh meta-filogic/recipes-wifi/hostapd/files/openwrt_script/
78cp -rf mac80211_package/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh meta-filogic/recipes-wifi/hostapd/files/openwrt_script/
developer9eeda512022-06-16 13:36:36 +080079echo "GEN iw patches.........."
80cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/utils/iw
81cd mac80211_package/package/network/utils/iw
developer16b198b2022-08-02 11:14:02 +080082#remove patches not work for wifi hal
83rm -rf patches/200-reduce_size.patch
84
developer9eeda512022-06-16 13:36:36 +080085./rdkb_inc_helper patches
86mv patches.inc patches
87
88cd -
developerc480fbb2022-11-07 18:39:36 +080089rm -rf meta-filogic/recipes-wifi/iw/patches
90cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-wifi/iw
developer9eeda512022-06-16 13:36:36 +080091ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
92newbb=iw_${ver}.bb
developerc480fbb2022-11-07 18:39:36 +080093cd meta-filogic/recipes-wifi/iw/
developer9eeda512022-06-16 13:36:36 +080094oldbb=`ls *.bb`
95echo "Update iw bb file name.........."
96mv ${oldbb} ${newbb}
97cd -
98
99echo "Update iw bb hash .........."
100hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-`
developerc480fbb2022-11-07 18:39:36 +0800101sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/iw/${newbb}
developer9eeda512022-06-16 13:36:36 +0800102
103echo "Gen wireless-regdb patches.........."
104cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/
105cd mac80211_package/package/firmware/wireless-regdb/
106./rdkb_inc_helper patches
107mv patches.inc patches
108
109cd -
developerc480fbb2022-11-07 18:39:36 +0800110rm -rf meta-filogic/recipes-wifi/wireless-regdb/files/patches
111cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-wifi/wireless-regdb/files/
developer9eeda512022-06-16 13:36:36 +0800112ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-`
113newbb=wireless-regdb_${ver}.bb
developerc480fbb2022-11-07 18:39:36 +0800114cd meta-filogic/recipes-wifi/wireless-regdb/
developer9eeda512022-06-16 13:36:36 +0800115oldbb=`ls *.bb`
116echo "Update wireless-regdb bb file name.........."
117mv ${oldbb} ${newbb}
118cd -
119
120echo "Update wireless-regdb bb hash.........."
121hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-`
developerc480fbb2022-11-07 18:39:36 +0800122sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/wireless-regdb/${newbb}
developer9eeda512022-06-16 13:36:36 +0800123
developerb8a4a342022-07-04 10:11:28 +0800124echo "Update libubox version.........."
125ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libubox/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800126sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libubox/libubox_git.bbappend
developerb8a4a342022-07-04 10:11:28 +0800127
128echo "Update ubus version.........."
129ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800130sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/ubus/ubus_git.bb
developerb8a4a342022-07-04 10:11:28 +0800131
132echo "Update libnl-tiny version.........."
133ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800134sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libnl-tiny/libnl-tiny_git.bb
developerb8a4a342022-07-04 10:11:28 +0800135
developer77d26402022-11-18 13:53:18 +0800136echo "Update iwinfo version.........."
137ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/utils/iwinfo/Makefile | cut -c 21-`
138sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/iwinfo/iwinfo_git.bb
139
developer752a1222022-10-11 16:19:00 +0800140echo "Update atenl ...... "
developerc480fbb2022-11-07 18:39:36 +0800141cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-wifi/atenl/files/
142cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-wifi/atenl/files/
143cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-wifi/atenl/files/
developer752a1222022-10-11 16:19:00 +0800144
developere2f847d2022-10-12 16:37:58 +0800145echo "Update mt76-verdor ...... "
developerc480fbb2022-11-07 18:39:36 +0800146cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-wifi/mt76-vendor/files/
developere2f847d2022-10-12 16:37:58 +0800147
developerd728d7c2022-10-25 13:45:17 +0800148echo "Update Wmm Script ......."
developerc480fbb2022-11-07 18:39:36 +0800149cp -rf autobuild_v5/mt7986-mac80211/target/linux/mediatek/base-files/sbin/wmm-*.sh meta-filogic/recipes-wifi/wifi-test-tool/files/wmm_script
developerd728d7c2022-10-25 13:45:17 +0800150
developer64409412022-12-13 17:06:55 +0800151echo "update wifi7 mac80211"
152rm -rf mac80211_package
153git clone --branch master https://gerrit.mediatek.inc/openwrt/lede mac80211_package
154
155rm -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/mac80211
156cd mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/
157mv mac80211_dev mac80211
158cd -
159
160echo "copy.........."
161cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/
developerac314cd2023-02-13 16:04:42 +0800162cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211 mac80211_package/package/kernel/
developer64409412022-12-13 17:06:55 +0800163
164echo "gen wifi7 mac80211 patches.........."
165cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mac80211/patches
166cd mac80211_package/package/kernel/mac80211/patches
167./rdkb_inc_helper subsys/
168./rdkb_inc_helper build/
169mv subsys.inc subsys
170mv build.inc build
171mkdir patches
172cp -r subsys patches
173cp -r build patches
174cd -
175rm -rf meta-filogic/recipes-wifi/linux-mac80211/files/patches-6.x
176cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-wifi/linux-mac80211/files/patches-6.x
177
178ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
179sed -i 's/PV =.*/PV = "'${ver2}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_6.%.bb
180ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
181sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_6.%.bb
182
developer0e8c91d2022-12-26 16:23:55 +0800183echo "mt76_3.x patches for backport-6.x support "
184cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76
185cd mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76
186./rdkb_inc_helper patches
187mv patches.inc patches
188cd -
developer64409412022-12-13 17:06:55 +0800189rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x
developer0e8c91d2022-12-26 16:23:55 +0800190cp -rf mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76/patches meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x
191#cp -rf meta-filogic/recipes-wifi/linux-mt76/files/patches meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x
developer392c5962022-12-19 14:01:52 +0800192#rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x/*revert-for-backports*.patch
developer0e8c91d2022-12-26 16:23:55 +0800193#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
developer64409412022-12-13 17:06:55 +0800194
developer0f27dcd2022-12-26 20:07:32 +0800195echo "gen new hostapd patches for mt76_3.x"
196cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
developerfa2eb2b2023-02-15 16:42:38 +0800197cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/network/services/hostapd mac80211_package/package/network/services/
developer0f27dcd2022-12-26 20:07:32 +0800198cd mac80211_package/package/network/services/hostapd
developerd34bdfc2023-01-18 18:14:22 +0800199
developer0f27dcd2022-12-26 20:07:32 +0800200./rdkb_inc_helper patches
201mv patches.inc patches
202echo "some patch do not apply to RDKB"
203sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
204#define new hostapd version
205new_hostapd_ver=2.10.3
206cd -
207rm -rf meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}
208rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/patches-${new_hostapd_ver}
209cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}
210cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/wpa-supplicant/files/patches-${new_hostapd_ver}
211
developer843fd2b2022-04-15 18:30:12 +0800212echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"