blob: 0424f470f41e653ccb15dcd1f36513146867878b [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/
developer8bbedcf2022-05-03 12:58:56 +080068sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/hostapd/files/hostapd-full.config
developer0f400252022-05-09 13:14:07 +080069sed -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
79./rdkb_inc_helper patches
80mv patches.inc patches
81
82cd -
83rm -rf meta-filogic/recipes-connectivity/iw/patches
84cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-connectivity/iw
85ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-`
86newbb=iw_${ver}.bb
87cd meta-filogic/recipes-connectivity/iw/
88oldbb=`ls *.bb`
89echo "Update iw bb file name.........."
90mv ${oldbb} ${newbb}
91cd -
92
93echo "Update iw bb hash .........."
94hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-`
95sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/iw/${newbb}
96
97echo "Gen wireless-regdb patches.........."
98cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/
99cd mac80211_package/package/firmware/wireless-regdb/
100./rdkb_inc_helper patches
101mv patches.inc patches
102
103cd -
104rm -rf meta-filogic/recipes-kernel/wireless-regdb/files/patches
105cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-kernel/wireless-regdb/files/
106ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-`
107newbb=wireless-regdb_${ver}.bb
108cd meta-filogic/recipes-kernel/wireless-regdb/
109oldbb=`ls *.bb`
110echo "Update wireless-regdb bb file name.........."
111mv ${oldbb} ${newbb}
112cd -
113
114echo "Update wireless-regdb bb hash.........."
115hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-`
116sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-kernel/wireless-regdb/${newbb}
117
developer843fd2b2022-04-15 18:30:12 +0800118echo "Sync from OpenWRT done , ready to commit meta-filogic!!!"