developer | 843fd2b | 2022-04-15 18:30:12 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | echo "clone.........." |
| 3 | git clone --branch master https://gerrit.mediatek.inc/openwrt/lede mac80211_package |
| 4 | git clone --branch openwrt-21.02 https://gerrit.mediatek.inc/openwrt/lede openwrt |
| 5 | git clone --branch master https://gerrit.mediatek.inc/openwrt/feeds/mtk_openwrt_feeds |
| 6 | git clone https://gerrit.mediatek.inc/gateway/rdk-b/meta-filogic |
| 7 | |
| 8 | echo "copy.........." |
| 9 | mkdir -p mac80211_package/package/kernel/mt76/patches |
| 10 | cp 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 |
| 11 | cp -rfa mtk_openwrt_feeds/autobuild_mac80211_release/package/ mac80211_package/ |
| 12 | |
| 13 | echo "gen mt76 patches.........." |
developer | 1969457 | 2022-04-18 19:58:01 +0800 | [diff] [blame] | 14 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mt76 |
developer | 843fd2b | 2022-04-15 18:30:12 +0800 | [diff] [blame] | 15 | cd mac80211_package/package/kernel/mt76 |
| 16 | ./rdkb_inc_helper patches |
| 17 | mv patches.inc patches |
| 18 | cd - |
| 19 | rm -rf meta-filogic/recipes-kernel/linux-mt76/files/patches |
| 20 | cp -rf mac80211_package/package/kernel/mt76/patches meta-filogic/recipes-kernel/linux-mt76/files/ |
| 21 | |
| 22 | echo "gen mac80211 patches.........." |
developer | 1969457 | 2022-04-18 19:58:01 +0800 | [diff] [blame] | 23 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/kernel/mac80211/patches |
developer | 843fd2b | 2022-04-15 18:30:12 +0800 | [diff] [blame] | 24 | cd mac80211_package/package/kernel/mac80211/patches |
| 25 | ./rdkb_inc_helper subsys/ |
| 26 | ./rdkb_inc_helper build/ |
| 27 | mv subsys.inc subsys |
| 28 | mv build.inc build |
| 29 | mkdir patches |
| 30 | cp -r subsys patches |
| 31 | cp -r build patches |
| 32 | cd - |
| 33 | rm -rf meta-filogic/recipes-kernel/linux-mac80211/files/patches |
| 34 | cp -rf mac80211_package/package/kernel/mac80211/patches/patches meta-filogic/recipes-kernel/linux-mac80211/files |
| 35 | |
| 36 | echo "copy mt76 firmware.........." |
| 37 | rm -rf meta-filogic/recipes-kernel/linux-mt76/files/src |
| 38 | cp -rf mac80211_package/package/kernel/mt76/src meta-filogic/recipes-kernel/linux-mt76/files/ |
| 39 | |
| 40 | echo "Update bb file version.........." |
| 41 | ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/kernel/mt76/Makefile | cut -c 21-` |
| 42 | sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-kernel/linux-mt76/linux-mt76.bb |
| 43 | ver2=`grep "PKG_VERSION:=" mac80211_package/package/kernel/mac80211/Makefile | cut -c 14-` |
| 44 | sed -i 's/PV =.*/PV = "'${ver2%-*}'"/g' meta-filogic/recipes-kernel/linux-mac80211/linux-mac80211.bb |
| 45 | ver3=`grep "PKG_HASH" mac80211_package/package/kernel/mac80211/Makefile | cut -c 11-` |
| 46 | sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${ver3}'"/g' meta-filogic/recipes-kernel/linux-mac80211/linux-mac80211.bb |
| 47 | |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 48 | echo "gen hostapd patches.........." |
| 49 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/services/hostapd |
| 50 | cd mac80211_package/package/network/services/hostapd |
| 51 | ./rdkb_inc_helper patches |
| 52 | mv patches.inc patches |
| 53 | echo "some patch do not apply to RDKB" |
| 54 | sed -i 's/450-scan_wait.patch/&;apply=no/' patches/patches.inc |
| 55 | |
| 56 | cd - |
| 57 | rm -rf meta-filogic/recipes-connectivity/hostapd/files/patches |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 58 | rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/patches |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 59 | cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/hostapd/files/ |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 60 | cp -rf mac80211_package/package/network/services/hostapd/patches meta-filogic/recipes-connectivity/wpa-supplicant/files/ |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 61 | rm -rf meta-filogic/recipes-connectivity/hostapd/files/src |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 62 | rm -rf meta-filogic/recipes-connectivity/wpa-supplicant/files/src |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 63 | cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/hostapd/files/ |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 64 | cp -rf mac80211_package/package/network/services/hostapd/src meta-filogic/recipes-connectivity/wpa-supplicant/files/ |
developer | 8bbedcf | 2022-05-03 12:58:56 +0800 | [diff] [blame] | 65 | echo "cp defconfig and remove ubus" |
| 66 | cp mac80211_package/package/network/services/hostapd/files/hostapd-full.config meta-filogic/recipes-connectivity/hostapd/files/ |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 67 | cp mac80211_package/package/network/services/hostapd/files/wpa_supplicant-full.config meta-filogic/recipes-connectivity/wpa-supplicant/files/ |
developer | 8bbedcf | 2022-05-03 12:58:56 +0800 | [diff] [blame] | 68 | sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/hostapd/files/hostapd-full.config |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 69 | sed -i 's/CONFIG_UBUS=y.*//g' meta-filogic/recipes-connectivity/wpa-supplicant/files/wpa_supplicant-full.config |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 70 | |
| 71 | echo "Update hostapd bb file version.........." |
| 72 | ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/network/services/hostapd/Makefile | cut -c 21-` |
developer | 0f40025 | 2022-05-09 13:14:07 +0800 | [diff] [blame] | 73 | sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/hostapd/hostapd_2.10.bb |
| 74 | sed -i 's/SRCREV ?=.*/SRCREV ?= "'$ver'"/g' meta-filogic/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.10.bb |
developer | 64ad4e6 | 2022-04-29 18:17:53 +0800 | [diff] [blame] | 75 | |
developer | 9eeda51 | 2022-06-16 13:36:36 +0800 | [diff] [blame^] | 76 | echo "GEN iw patches.........." |
| 77 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/network/utils/iw |
| 78 | cd mac80211_package/package/network/utils/iw |
| 79 | ./rdkb_inc_helper patches |
| 80 | mv patches.inc patches |
| 81 | |
| 82 | cd - |
| 83 | rm -rf meta-filogic/recipes-connectivity/iw/patches |
| 84 | cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-connectivity/iw |
| 85 | ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-` |
| 86 | newbb=iw_${ver}.bb |
| 87 | cd meta-filogic/recipes-connectivity/iw/ |
| 88 | oldbb=`ls *.bb` |
| 89 | echo "Update iw bb file name.........." |
| 90 | mv ${oldbb} ${newbb} |
| 91 | cd - |
| 92 | |
| 93 | echo "Update iw bb hash .........." |
| 94 | hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-` |
| 95 | sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/iw/${newbb} |
| 96 | |
| 97 | echo "Gen wireless-regdb patches.........." |
| 98 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/ |
| 99 | cd mac80211_package/package/firmware/wireless-regdb/ |
| 100 | ./rdkb_inc_helper patches |
| 101 | mv patches.inc patches |
| 102 | |
| 103 | cd - |
| 104 | rm -rf meta-filogic/recipes-kernel/wireless-regdb/files/patches |
| 105 | cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-kernel/wireless-regdb/files/ |
| 106 | ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-` |
| 107 | newbb=wireless-regdb_${ver}.bb |
| 108 | cd meta-filogic/recipes-kernel/wireless-regdb/ |
| 109 | oldbb=`ls *.bb` |
| 110 | echo "Update wireless-regdb bb file name.........." |
| 111 | mv ${oldbb} ${newbb} |
| 112 | cd - |
| 113 | |
| 114 | echo "Update wireless-regdb bb hash.........." |
| 115 | hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-` |
| 116 | sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-kernel/wireless-regdb/${newbb} |
| 117 | |
developer | 843fd2b | 2022-04-15 18:30:12 +0800 | [diff] [blame] | 118 | echo "Sync from OpenWRT done , ready to commit meta-filogic!!!" |