blob: 2ca7b8a4cab4c6200fd60bf51c82d8b1f5e7e2ad [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 -
developerc480fbb2022-11-07 18:39:36 +080020rm -rf meta-filogic/recipes-wifi/linux-mt76/files/patches
21cp -rf mac80211_package/package/kernel/mt76/patches meta-filogic/recipes-wifi/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 -
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-`
developerc480fbb2022-11-07 18:39:36 +080045sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-wifi/linux-mac80211/linux-mac80211.bb
developer843fd2b2022-04-15 18:30:12 +080046ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-`
developerc480fbb2022-11-07 18:39:36 +080047sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-wifi/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 -
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
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 -
developerc480fbb2022-11-07 18:39:36 +080087rm -rf meta-filogic/recipes-wifi/iw/patches
88cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-wifi/iw
developer9eeda512022-06-16 13:36:36 +080089ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
90newbb=iw_${ver}.bb
developerc480fbb2022-11-07 18:39:36 +080091cd meta-filogic/recipes-wifi/iw/
developer9eeda512022-06-16 13:36:36 +080092oldbb=`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-`
developerc480fbb2022-11-07 18:39:36 +080099sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/iw/${newbb}
developer9eeda512022-06-16 13:36:36 +0800100
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 -
developerc480fbb2022-11-07 18:39:36 +0800108rm -rf meta-filogic/recipes-wifi/wireless-regdb/files/patches
109cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-wifi/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
developerc480fbb2022-11-07 18:39:36 +0800112cd meta-filogic/recipes-wifi/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-`
developerc480fbb2022-11-07 18:39:36 +0800120sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-wifi/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-`
developerc480fbb2022-11-07 18:39:36 +0800124sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libubox/libubox_git.bbappend
developerb8a4a342022-07-04 10:11:28 +0800125
126echo "Update ubus version.........."
127ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800128sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/ubus/ubus_git.bb
developerb8a4a342022-07-04 10:11:28 +0800129
130echo "Update libnl-tiny version.........."
131ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-`
developerc480fbb2022-11-07 18:39:36 +0800132sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-wifi/libnl-tiny/libnl-tiny_git.bb
developerb8a4a342022-07-04 10:11:28 +0800133
developer752a1222022-10-11 16:19:00 +0800134echo "Update atenl ...... "
developerc480fbb2022-11-07 18:39:36 +0800135cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-wifi/atenl/files/
136cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-wifi/atenl/files/
137cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-wifi/atenl/files/
developer752a1222022-10-11 16:19:00 +0800138
developere2f847d2022-10-12 16:37:58 +0800139echo "Update mt76-verdor ...... "
developerc480fbb2022-11-07 18:39:36 +0800140cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-wifi/mt76-vendor/files/
developere2f847d2022-10-12 16:37:58 +0800141
developerd728d7c2022-10-25 13:45:17 +0800142echo "Update Wmm Script ......."
developerc480fbb2022-11-07 18:39:36 +0800143cp -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 +0800144
developer843fd2b2022-04-15 18:30:12 +0800145echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"