blob: 69433ff5f8fb7e06f2e3b4993185f3183ff4bb4b [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/
developerc63644b2023-04-21 12:48:09 +080040cp -rf mtk_openwrt_feeds/target/linux/mediatek/mt7988/base-files/lib/firmware/mediatek/* meta-filogic/recipes-wifi/linux-mt76/files/src/firmware
developer843fd2b2022-04-15 18:30:12 +080041
42echo "Update bb file version.........."
43ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/kernel/mt76/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +080044sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/linux-mt76/mt76.inc
developer843fd2b2022-04-15 18:30:12 +080045ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
developera52defa2022-12-09 13:01:55 +080046sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_5.15.%.bb
developer843fd2b2022-04-15 18:30:12 +080047ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
developera52defa2022-12-09 13:01:55 +080048sed -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 +080049
developer64ad4e62022-04-29 18:17:53 +080050echo "gen hostapd patches.........."
developer46436b02023-06-08 13:31:19 +080051rm -rf mac80211_package/package/network/services/hostapd
52tar xvf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd/hostapd_v2.10_07730ff3.tar.gz -C mac80211_package/package/network/services/
53cp -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd/patches/* mac80211_package/package/network/services/hostapd/patches
developer64ad4e62022-04-29 18:17:53 +080054cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
55cd mac80211_package/package/network/services/hostapd
56./rdkb_inc_helper patches
57mv patches.inc patches
58echo "some patch do not apply to RDKB"
59sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
60
61cd -
developerc480fbb2022-11-07 18:39:36 +080062rm -rf meta-filogic/recipes-wifi/hostapd/files/patches
63rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/patches
64cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/hostapd/files/
65cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/wpa-supplicant/files/
66rm -rf meta-filogic/recipes-wifi/hostapd/files/src
67rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/src
68cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-wifi/hostapd/files/
69cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-wifi/wpa-supplicant/files/
developer8bbedcf2022-05-03 12:58:56 +080070echo "cp defconfig and remove ubus"
developerc480fbb2022-11-07 18:39:36 +080071cp mac80211_package/package/network/services/hostapd/files/hostapd-full.config meta-filogic/recipes-wifi/hostapd/files/
72cp mac80211_package/package/network/services/hostapd/files/wpa_supplicant-full.config meta-filogic/recipes-wifi/wpa-supplicant/files/
73#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-wifi/hostapd/files/hostapd-full.config
74#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-wifi/wpa-supplicant/files/wpa_supplicant-full.config
developer64ad4e62022-04-29 18:17:53 +080075
76echo "Update hostapd bb file version.........."
77ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +080078sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/hostapd/hostapd_2.10.bb
79sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/wpa-supplicant/wpa-supplicant_2.10.bb
developer61b9b982022-11-10 12:05:10 +080080#cp openwrt hostapd script
81cp -rf mac80211_package/package/network/services/hostapd/files/hostapd.sh meta-filogic/recipes-wifi/hostapd/files/openwrt_script/
82cp -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 +080083echo "GEN iw patches.........."
84cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/utils/iw
85cd mac80211_package/package/network/utils/iw
developer16b198b2022-08-02 11:14:02 +080086#remove patches not work for wifi hal
87rm -rf patches/200-reduce_size.patch
88
developer9eeda512022-06-16 13:36:36 +080089./rdkb_inc_helper patches
90mv patches.inc patches
91
92cd -
developerc480fbb2022-11-07 18:39:36 +080093rm -rf meta-filogic/recipes-wifi/iw/patches
94cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-wifi/iw
developer9eeda512022-06-16 13:36:36 +080095ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
96newbb=iw_${ver}.bb
developerc480fbb2022-11-07 18:39:36 +080097cd meta-filogic/recipes-wifi/iw/
developer9eeda512022-06-16 13:36:36 +080098oldbb=`ls *.bb`
99echo "Update iw bb file name.........."
100mv ${oldbb} ${newbb}
101cd -
102
103echo "Update iw bb hash .........."
104hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-`
developerc480fbb2022-11-07 18:39:36 +0800105sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/iw/${newbb}
developer9eeda512022-06-16 13:36:36 +0800106
107echo "Gen wireless-regdb patches.........."
108cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/
109cd mac80211_package/package/firmware/wireless-regdb/
110./rdkb_inc_helper patches
111mv patches.inc patches
112
113cd -
developerc480fbb2022-11-07 18:39:36 +0800114rm -rf meta-filogic/recipes-wifi/wireless-regdb/files/patches
115cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-wifi/wireless-regdb/files/
developer9eeda512022-06-16 13:36:36 +0800116ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-`
117newbb=wireless-regdb_${ver}.bb
developerc480fbb2022-11-07 18:39:36 +0800118cd meta-filogic/recipes-wifi/wireless-regdb/
developer9eeda512022-06-16 13:36:36 +0800119oldbb=`ls *.bb`
120echo "Update wireless-regdb bb file name.........."
121mv ${oldbb} ${newbb}
122cd -
123
124echo "Update wireless-regdb bb hash.........."
125hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-`
developerc480fbb2022-11-07 18:39:36 +0800126sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/wireless-regdb/${newbb}
developer9eeda512022-06-16 13:36:36 +0800127
developerb8a4a342022-07-04 10:11:28 +0800128echo "Update libubox version.........."
129ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libubox/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800130sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libubox/libubox_git.bbappend
developerb8a4a342022-07-04 10:11:28 +0800131
132echo "Update ubus version.........."
133ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800134sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/ubus/ubus_git.bb
developerb8a4a342022-07-04 10:11:28 +0800135
136echo "Update libnl-tiny version.........."
137ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800138sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libnl-tiny/libnl-tiny_git.bb
developerb8a4a342022-07-04 10:11:28 +0800139
developer77d26402022-11-18 13:53:18 +0800140echo "Update iwinfo version.........."
141ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/utils/iwinfo/Makefile | cut -c 21-`
142sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/iwinfo/iwinfo_git.bb
143
developer752a1222022-10-11 16:19:00 +0800144echo "Update atenl ...... "
developerc480fbb2022-11-07 18:39:36 +0800145cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-wifi/atenl/files/
146cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-wifi/atenl/files/
147cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-wifi/atenl/files/
developer752a1222022-10-11 16:19:00 +0800148
developere2f847d2022-10-12 16:37:58 +0800149echo "Update mt76-verdor ...... "
developerc480fbb2022-11-07 18:39:36 +0800150cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-wifi/mt76-vendor/files/
developere2f847d2022-10-12 16:37:58 +0800151
developerd728d7c2022-10-25 13:45:17 +0800152echo "Update Wmm Script ......."
developerc480fbb2022-11-07 18:39:36 +0800153cp -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 +0800154
developer64409412022-12-13 17:06:55 +0800155echo "update wifi7 mac80211"
156rm -rf mac80211_package
157git clone --branch master https://gerrit.mediatek.inc/openwrt/lede mac80211_package
158
159rm -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/mac80211
developer46436b02023-06-08 13:31:19 +0800160rm -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd
developer64409412022-12-13 17:06:55 +0800161cd mtk_openwrt_feeds/autobuild_mac80211_release/package/kernel/
162mv mac80211_dev mac80211
163cd -
164
165echo "copy.........."
166cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/
developerac314cd2023-02-13 16:04:42 +0800167cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211 mac80211_package/package/kernel/
developer64409412022-12-13 17:06:55 +0800168
169echo "gen wifi7 mac80211 patches.........."
170cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mac80211/patches
171cd mac80211_package/package/kernel/mac80211/patches
172./rdkb_inc_helper subsys/
173./rdkb_inc_helper build/
174mv subsys.inc subsys
175mv build.inc build
176mkdir patches
177cp -r subsys patches
178cp -r build patches
179cd -
180rm -rf meta-filogic/recipes-wifi/linux-mac80211/files/patches-6.x
181cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-wifi/linux-mac80211/files/patches-6.x
182
183ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
184sed -i 's/PV =.*/PV = "'${ver2}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_6.%.bb
185ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
186sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211_6.%.bb
187
developer0e8c91d2022-12-26 16:23:55 +0800188echo "mt76_3.x patches for backport-6.x support "
189cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76
190cd mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76
191./rdkb_inc_helper patches
192mv patches.inc patches
193cd -
developer64409412022-12-13 17:06:55 +0800194rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x
developer0e8c91d2022-12-26 16:23:55 +0800195cp -rf mtk_openwrt_feeds/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mt76/patches meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x
196#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 +0800197#rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches-3.x/*revert-for-backports*.patch
developer0e8c91d2022-12-26 16:23:55 +0800198#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 +0800199
developer0f27dcd2022-12-26 20:07:32 +0800200echo "gen new hostapd patches for mt76_3.x"
developer46436b02023-06-08 13:31:19 +0800201
202cp -rf mtk_openwrt_feeds/autobuild_mac80211_release/package/network/services/hostapd_new/patches/* mac80211_package/package/network/services/hostapd/patches
developer0f27dcd2022-12-26 20:07:32 +0800203cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
developerfa2eb2b2023-02-15 16:42:38 +0800204cp -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 +0800205cd mac80211_package/package/network/services/hostapd
developerd34bdfc2023-01-18 18:14:22 +0800206
developer0f27dcd2022-12-26 20:07:32 +0800207./rdkb_inc_helper patches
208mv patches.inc patches
209echo "some patch do not apply to RDKB"
210sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
developer46436b02023-06-08 13:31:19 +0800211
212echo "Update hostapd bb file version.........."
developer0f27dcd2022-12-26 20:07:32 +0800213#define new hostapd version
214new_hostapd_ver=2.10.3
developer46436b02023-06-08 13:31:19 +0800215
developer0f27dcd2022-12-26 20:07:32 +0800216cd -
developer46436b02023-06-08 13:31:19 +0800217ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-`
218sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/hostapd/hostapd_${new_hostapd_ver}.bb
219sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-wifi/wpa-supplicant/wpa-supplicant_${new_hostapd_ver}.bb
220
developer0f27dcd2022-12-26 20:07:32 +0800221rm -rf meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}
222rm -rf meta-filogic/recipes-wifi/wpa-supplicant/files/patches-${new_hostapd_ver}
223cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/hostapd/files/patches-${new_hostapd_ver}
224cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-wifi/wpa-supplicant/files/patches-${new_hostapd_ver}
225
developer843fd2b2022-04-15 18:30:12 +0800226echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"