blob: c0fb58bed2c03b42164f9e5a10fcb164ba6361e4 [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
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
developer752a1222022-10-11 16:19:00 +0800136echo "Update atenl ...... "
developerc480fbb2022-11-07 18:39:36 +0800137cp -rf mtk_openwrt_feeds/feed/atenl/src meta-filogic/recipes-wifi/atenl/files/
138cp -f mtk_openwrt_feeds/feed/atenl/files/ated.sh meta-filogic/recipes-wifi/atenl/files/
139cp -f mtk_openwrt_feeds/feed/atenl/files/iwpriv.sh meta-filogic/recipes-wifi/atenl/files/
developer752a1222022-10-11 16:19:00 +0800140
developere2f847d2022-10-12 16:37:58 +0800141echo "Update mt76-verdor ...... "
developerc480fbb2022-11-07 18:39:36 +0800142cp -rf mtk_openwrt_feeds/feed/mt76-vendor/src meta-filogic/recipes-wifi/mt76-vendor/files/
developere2f847d2022-10-12 16:37:58 +0800143
developerd728d7c2022-10-25 13:45:17 +0800144echo "Update Wmm Script ......."
developerc480fbb2022-11-07 18:39:36 +0800145cp -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 +0800146
developer843fd2b2022-04-15 18:30:12 +0800147echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"