blob: d0f10fab2dd8365e00e7ed763ca6a3b2a2095ea7 [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
developer683be522023-05-11 14:24:50 +08009hostapd_new=1
developer4be8f972022-12-13 16:02:25 +080010args=
11
12for arg in $*; do
13 case "$arg" in
developer4be8f972022-12-13 16:02:25 +080014 "hwpath")
15 hwpath=1
16 ;;
17 *)
18 args="$args $arg"
19 ;;
20 esac
21done
22set -- $args
23
24change_dot_config() {
developer4be8f972022-12-13 16:02:25 +080025 [ "$hwpath" = "0" ] && {
26 echo "==========SW PATH========="
27 sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
28 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
29 sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
30 }
31 [ "$backport_new" = "1" ] && {
developer3e0400f2023-02-10 08:32:03 +080032 rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch
developer4be8f972022-12-13 16:02:25 +080033 }
34}
developer782053a2022-10-24 17:40:58 +080035
36#step1 clean
37#clean
38#do prepare stuff
39prepare
40
developer782053a2022-10-24 17:40:58 +080041#hack mt7988 config5.4
42echo "CONFIG_NETFILTER=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
43echo "CONFIG_NETFILTER_ADVANCED=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
44echo "CONFIG_RELAY=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4
45
developer4be8f972022-12-13 16:02:25 +080046prepare_flowoffload
developer782053a2022-10-24 17:40:58 +080047
developer4be8f972022-12-13 16:02:25 +080048#prepare mac80211 mt76 wifi stuff
developer683be522023-05-11 14:24:50 +080049prepare_mac80211 ${backport_new} ${hostapd_new}
developer782053a2022-10-24 17:40:58 +080050
developer3e0400f2023-02-10 08:32:03 +080051# find ${BUILD_DIR}/package/kernel/mt76/patches -name "*-mt76-*.patch" -delete
52rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*
53
54# ========== specific modification on mt7996 autobuild for EHT support ==========
developer3e0400f2023-02-10 08:32:03 +080055# patch hostapd to use latest version and add 11BE config
56patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0002-add-EHT-config-for-hostapd.patch
developereafd9682023-03-10 07:38:27 +080057# copy DSP & testmode firmware
58patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0003-mt76-mt7996-copy-dsp-and-testmode-firmware.patch
developer3e0400f2023-02-10 08:32:03 +080059
60# remove some iw patches to let EHT work normally
61rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/001-nl80211_h_sync.patch
62rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/120-antenna_gain.patch
63# ===========================================================
developere5c01a42022-12-23 18:17:33 +080064
developer782053a2022-10-24 17:40:58 +080065prepare_final ${branch_name}
66
developer4be8f972022-12-13 16:02:25 +080067change_dot_config
68
developer782053a2022-10-24 17:40:58 +080069#step2 build
70if [ -z ${1} ]; then
71 build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ]
72fi