developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | source ./autobuild/lede-build-sanity.sh |
| 3 | |
| 4 | #get the brach_name |
| 5 | temp=${0%/*} |
| 6 | branch_name=${temp##*/} |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 7 | hwpath=0 |
| 8 | backport_new=1 |
| 9 | args= |
| 10 | |
| 11 | for arg in $*; do |
| 12 | case "$arg" in |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 13 | "hwpath") |
| 14 | hwpath=1 |
| 15 | ;; |
| 16 | *) |
| 17 | args="$args $arg" |
| 18 | ;; |
| 19 | esac |
| 20 | done |
| 21 | set -- $args |
| 22 | |
| 23 | change_dot_config() { |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 24 | [ "$hwpath" = "0" ] && { |
| 25 | echo "==========SW PATH=========" |
| 26 | sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 27 | sed -i 's/CONFIG_NETFILTER_FAMILY_BRIDGE=y/# CONFIG_NETFILTER_FAMILY_BRIDGE is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 28 | sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 29 | } |
| 30 | [ "$backport_new" = "1" ] && { |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 31 | rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 32 | } |
| 33 | } |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 34 | |
| 35 | #step1 clean |
| 36 | #clean |
| 37 | #do prepare stuff |
| 38 | prepare |
| 39 | |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 40 | #hack mt7988 config5.4 |
| 41 | echo "CONFIG_NETFILTER=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 42 | echo "CONFIG_NETFILTER_ADVANCED=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 43 | echo "CONFIG_RELAY=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 44 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 45 | prepare_flowoffload |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 46 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 47 | #prepare mac80211 mt76 wifi stuff |
| 48 | prepare_mac80211 ${backport_new} |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 49 | |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 50 | # find ${BUILD_DIR}/package/kernel/mt76/patches -name "*-mt76-*.patch" -delete |
| 51 | rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/* |
| 52 | |
| 53 | # ========== specific modification on mt7996 autobuild for EHT support ========== |
| 54 | # patch mac80211.sh script |
| 55 | patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0001-support-EHT-for-mac80211.sh.patch |
| 56 | # patch hostapd to use latest version and add 11BE config |
| 57 | patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0002-add-EHT-config-for-hostapd.patch |
| 58 | |
| 59 | # remove some iw patches to let EHT work normally |
| 60 | rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/001-nl80211_h_sync.patch |
| 61 | rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/120-antenna_gain.patch |
| 62 | # =========================================================== |
developer | e5c01a4 | 2022-12-23 18:17:33 +0800 | [diff] [blame] | 63 | |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 64 | prepare_final ${branch_name} |
| 65 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 66 | change_dot_config |
| 67 | |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 68 | #step2 build |
| 69 | if [ -z ${1} ]; then |
| 70 | build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ] |
| 71 | fi |