blob: e8aee084f79ef18e07ac02f1ae0ed9f6254848a6 [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
6git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic
7
8echo "copy.........."
9mkdir -p mac80211_package/package/kernel/mt76/patches
10cp 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
11cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/
12
13echo "gen 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 -
19rm -rf meta-filogic/recipes-kernel/linux-mt76/files/patches
20cp -rf mac80211_package/package/kernel/mt76/patches meta-filogic/recipes-kernel/linux-mt76/files/
21
22echo "gen mac80211 patches.........."
developer19694572022-04-18 19:58:01 +080023cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mac80211/patches
developer843fd2b2022-04-15 18:30:12 +080024cd mac80211_package/package/kernel/mac80211/patches
25./rdkb_inc_helper subsys/
26./rdkb_inc_helper build/
27mv subsys.inc subsys
28mv build.inc build
29mkdir patches
30cp -r subsys patches
31cp -r build patches
32cd -
33rm -rf meta-filogic/recipes-kernel/linux-mac80211/files/patches
34cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-kernel/linux-mac80211/files
35
36echo "copy mt76 firmware.........."
37rm -rf meta-filogic/recipes-kernel/linux-mt76/files/src
38cp -rf mac80211_package/package/kernel/mt76/src meta-filogic/recipes-kernel/linux-mt76/files/
39
40echo "Update bb file version.........."
41ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/kernel/mt76/Makefile | cut -c 21-`
42sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-kernel/linux-mt76/linux-mt76.bb
43ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-`
44sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-kernel/linux-mac80211/linux-mac80211.bb
45ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
46sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-kernel/linux-mac80211/linux-mac80211.bb
47
developer64ad4e62022-04-29 18:17:53 +080048echo "gen hostapd patches.........."
49cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd
50cd mac80211_package/package/network/services/hostapd
51./rdkb_inc_helper patches
52mv patches.inc patches
53echo "some patch do not apply to RDKB"
54sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc
55
56cd -
57rm -rf meta-filogic/recipes-connectivity/hostapd/files/patches
developer0f400252022-05-09 13:14:07 +080058rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/patches
developer64ad4e62022-04-29 18:17:53 +080059cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080060cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/wpa-supplicant/files/
developer64ad4e62022-04-29 18:17:53 +080061rm -rf meta-filogic/recipes-connectivity/hostapd/files/src
developer0f400252022-05-09 13:14:07 +080062rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/src
developer64ad4e62022-04-29 18:17:53 +080063cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080064cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/wpa-supplicant/files/
developer8bbedcf2022-05-03 12:58:56 +080065echo "cp defconfig and remove ubus"
66cp mac80211_package/package/network/services/hostapd/files/hostapd-full.config meta-filogic/recipes-connectivity/hostapd/files/
developer0f400252022-05-09 13:14:07 +080067cp mac80211_package/package/network/services/hostapd/files/wpa_supplicant-full.config meta-filogic/recipes-connectivity/wpa-supplicant/files/
developerd1ddf8e2022-06-27 19:50:04 +080068#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/hostapd/files/hostapd-full.config
69#sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/wpa-supplicant/files/wpa_supplicant-full.config
developer64ad4e62022-04-29 18:17:53 +080070
71echo "Update hostapd bb file version.........."
72ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-`
developer0f400252022-05-09 13:14:07 +080073sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/hostapd/hostapd_2.10.bb
74sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.10.bb
developer64ad4e62022-04-29 18:17:53 +080075
developer9eeda512022-06-16 13:36:36 +080076echo "GEN iw patches.........."
77cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/utils/iw
78cd mac80211_package/package/network/utils/iw
developer16b198b2022-08-02 11:14:02 +080079#remove patches not work for wifi hal
80rm -rf patches/200-reduce_size.patch
81
developer9eeda512022-06-16 13:36:36 +080082./rdkb_inc_helper patches
83mv patches.inc patches
84
85cd -
86rm -rf meta-filogic/recipes-connectivity/iw/patches
87cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-connectivity/iw
88ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
89newbb=iw_${ver}.bb
90cd meta-filogic/recipes-connectivity/iw/
91oldbb=`ls *.bb`
92echo "Update iw bb file name.........."
93mv ${oldbb} ${newbb}
94cd -
95
96echo "Update iw bb hash .........."
97hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-`
98sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/iw/${newbb}
99
100echo "Gen wireless-regdb patches.........."
101cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/
102cd mac80211_package/package/firmware/wireless-regdb/
103./rdkb_inc_helper patches
104mv patches.inc patches
105
106cd -
107rm -rf meta-filogic/recipes-kernel/wireless-regdb/files/patches
108cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-kernel/wireless-regdb/files/
109ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-`
110newbb=wireless-regdb_${ver}.bb
111cd meta-filogic/recipes-kernel/wireless-regdb/
112oldbb=`ls *.bb`
113echo "Update wireless-regdb bb file name.........."
114mv ${oldbb} ${newbb}
115cd -
116
117echo "Update wireless-regdb bb hash.........."
118hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-`
119sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-kernel/wireless-regdb/${newbb}
120
developerb8a4a342022-07-04 10:11:28 +0800121echo "Update libubox version.........."
122ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libubox/Makefile | cut -c 21-`
123sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libubox/libubox_git.bbappend
124
125echo "Update ubus version.........."
126ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-`
127sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/ubus/ubus_git.bb
128
129echo "Update libnl-tiny version.........."
130ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-`
131sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libnl-tiny/libnl-tiny_git.bb
132
developer752a1222022-10-11 16:19:00 +0800133echo "Update atenl ...... "
134cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-devtools/atenl/files/
135cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-devtools/atenl/files/
136cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-devtools/atenl/files/
137
developere2f847d2022-10-12 16:37:58 +0800138echo "Update mt76-verdor ...... "
139cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-devtools/mt76-vendor/files/
140
developer843fd2b2022-04-15 18:30:12 +0800141echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"