blob: 80dfa4112f9858e9a88b1d7306cfd55988d2669e [file] [log] [blame]
developer782053a2022-10-24 17:40:58 +08001#!/bin/bash
2source ./autobuild/lede-build-sanity.sh
3
4#get the brach_name
5temp=${0%/*}
6branch_name=${temp##*/}
developer4be8f972022-12-13 16:02:25 +08007hwpath=0
8backport_new=1
9args=
10
11for arg in $*; do
12 case "$arg" in
developer4be8f972022-12-13 16:02:25 +080013 "hwpath")
14 hwpath=1
15 ;;
16 *)
17 args="$args $arg"
18 ;;
19 esac
20done
21set -- $args
22
23change_dot_config() {
developer4be8f972022-12-13 16:02:25 +080024 [ "$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" ] && {
developer3e0400f2023-02-10 08:32:03 +080031 rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch
developer4be8f972022-12-13 16:02:25 +080032 }
33}
developer782053a2022-10-24 17:40:58 +080034
35#step1 clean
36#clean
37#do prepare stuff
38prepare
39
developer782053a2022-10-24 17:40:58 +080040#hack mt7988 config5.4
41echo "CONFIG_NETFILTER=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
42echo "CONFIG_NETFILTER_ADVANCED=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
43echo "CONFIG_RELAY=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
44
developer4be8f972022-12-13 16:02:25 +080045prepare_flowoffload
developer782053a2022-10-24 17:40:58 +080046
developer4be8f972022-12-13 16:02:25 +080047#prepare mac80211 mt76 wifi stuff
48prepare_mac80211 ${backport_new}
developer782053a2022-10-24 17:40:58 +080049
developer3e0400f2023-02-10 08:32:03 +080050# find ${BUILD_DIR}/package/kernel/mt76/patches -name "*-mt76-*.patch" -delete
51rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*
52
53# ========== specific modification on mt7996 autobuild for EHT support ==========
developer3e0400f2023-02-10 08:32:03 +080054# patch hostapd to use latest version and add 11BE config
55patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0002-add-EHT-config-for-hostapd.patch
developereafd9682023-03-10 07:38:27 +080056# copy DSP & testmode firmware
57patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0003-mt76-mt7996-copy-dsp-and-testmode-firmware.patch
developer3e0400f2023-02-10 08:32:03 +080058
59# remove some iw patches to let EHT work normally
60rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/001-nl80211_h_sync.patch
61rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/120-antenna_gain.patch
62# ===========================================================
developere5c01a42022-12-23 18:17:33 +080063
developer782053a2022-10-24 17:40:58 +080064prepare_final ${branch_name}
65
developer4be8f972022-12-13 16:02:25 +080066change_dot_config
67
developer782053a2022-10-24 17:40:58 +080068#step2 build
69if [ -z ${1} ]; then
70 build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ]
71fi