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 | d1ddf8e | 2022-06-27 19:50:04 +0800 | [diff] [blame] | 68 | #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 |
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 |
developer | 16b198b | 2022-08-02 11:14:02 +0800 | [diff] [blame^] | 79 | #remove patches not work for wifi hal |
| 80 | rm -rf patches/200-reduce_size.patch |
| 81 | |
developer | 9eeda51 | 2022-06-16 13:36:36 +0800 | [diff] [blame] | 82 | ./rdkb_inc_helper patches |
| 83 | mv patches.inc patches |
| 84 | |
| 85 | cd - |
| 86 | rm -rf meta-filogic/recipes-connectivity/iw/patches |
| 87 | cp -rf mac80211_package/package/network/utils/iw/patches meta-filogic/recipes-connectivity/iw |
| 88 | ver=`grep "PKG_VERSION:=" mac80211_package/package/network/utils/iw/Makefile | cut -c 14-` |
| 89 | newbb=iw_${ver}.bb |
| 90 | cd meta-filogic/recipes-connectivity/iw/ |
| 91 | oldbb=`ls *.bb` |
| 92 | echo "Update iw bb file name.........." |
| 93 | mv ${oldbb} ${newbb} |
| 94 | cd - |
| 95 | |
| 96 | echo "Update iw bb hash .........." |
| 97 | hash1=`grep "PKG_HASH" mac80211_package/package/network/utils/iw/Makefile | cut -c 11-` |
| 98 | sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-connectivity/iw/${newbb} |
| 99 | |
| 100 | echo "Gen wireless-regdb patches.........." |
| 101 | cp meta-cmf-filogic/mtk_scripts/rdkb_inc_helper mac80211_package/package/firmware/wireless-regdb/ |
| 102 | cd mac80211_package/package/firmware/wireless-regdb/ |
| 103 | ./rdkb_inc_helper patches |
| 104 | mv patches.inc patches |
| 105 | |
| 106 | cd - |
| 107 | rm -rf meta-filogic/recipes-kernel/wireless-regdb/files/patches |
| 108 | cp -rf mac80211_package/package/firmware/wireless-regdb/patches meta-filogic/recipes-kernel/wireless-regdb/files/ |
| 109 | ver=`grep "PKG_VERSION:=" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 14-` |
| 110 | newbb=wireless-regdb_${ver}.bb |
| 111 | cd meta-filogic/recipes-kernel/wireless-regdb/ |
| 112 | oldbb=`ls *.bb` |
| 113 | echo "Update wireless-regdb bb file name.........." |
| 114 | mv ${oldbb} ${newbb} |
| 115 | cd - |
| 116 | |
| 117 | echo "Update wireless-regdb bb hash.........." |
| 118 | hash1=`grep "PKG_HASH" mac80211_package/package/firmware/wireless-regdb/Makefile | cut -c 11-` |
| 119 | sed -i 's/SRC_URI\[sha256sum\].*/SRC_URI[sha256sum] = "'${hash1}'"/g' meta-filogic/recipes-kernel/wireless-regdb/${newbb} |
| 120 | |
developer | b8a4a34 | 2022-07-04 10:11:28 +0800 | [diff] [blame] | 121 | echo "Update libubox version.........." |
| 122 | ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libubox/Makefile | cut -c 21-` |
| 123 | sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libubox/libubox_git.bbappend |
| 124 | |
| 125 | echo "Update ubus version.........." |
| 126 | ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/system/ubus/Makefile | cut -c 21-` |
| 127 | sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/ubus/ubus_git.bb |
| 128 | |
| 129 | echo "Update libnl-tiny version.........." |
| 130 | ver=`grep "PKG_SOURCE_VERSION" mac80211_package/package/libs/libnl-tiny/Makefile | cut -c 21-` |
| 131 | sed -i 's/SRCREV =.*/SRCREV = "'$ver'"/g' meta-filogic/recipes-connectivity/libnl-tiny/libnl-tiny_git.bb |
| 132 | |
developer | 843fd2b | 2022-04-15 18:30:12 +0800 | [diff] [blame] | 133 | echo "Sync from OpenWRT done , ready to commit meta-filogic!!!" |