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 | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 7 | swpath=0 |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 8 | backport_new=1 |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 9 | hostapd_new=1 |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 10 | args= |
| 11 | |
| 12 | for arg in $*; do |
| 13 | case "$arg" in |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 14 | "swpath") |
| 15 | swpath=1 |
| 16 | ;; |
| 17 | "kasan") |
| 18 | kasan=1 |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 19 | ;; |
| 20 | *) |
| 21 | args="$args $arg" |
| 22 | ;; |
| 23 | esac |
| 24 | done |
| 25 | set -- $args |
| 26 | |
| 27 | change_dot_config() { |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 28 | [ "$swpath" = "1" ] && { |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 29 | echo "==========SW PATH=========" |
| 30 | sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 31 | 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 |
| 32 | sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 33 | sed -i '/AUTOLOAD:=$(call AutoProbe,mt7996e)/a\ MODPARAMS.mt7996e:=wed_enable=0' ${BUILD_DIR}/package/kernel/mt76/Makefile |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 34 | } |
| 35 | [ "$backport_new" = "1" ] && { |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 36 | rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 37 | } |
| 38 | [ "$kasan" = "1" ] && { |
| 39 | sed -i 's/# CONFIG_KERNEL_KASAN is not set/CONFIG_KERNEL_KASAN=y/g' ${BUILD_DIR}/.config |
| 40 | sed -i 's/# CONFIG_KERNEL_KALLSYMS is not set/CONFIG_KERNEL_KALLSYMS=y/g' ${BUILD_DIR}/.config |
| 41 | echo "CONFIG_KERNEL_KASAN_OUTLINE=y" >> ${BUILD_DIR}/.config |
| 42 | echo "CONFIG_DEBUG_KMEMLEAK=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 43 | echo "CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 44 | echo "# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 45 | echo "CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 46 | echo "CONFIG_DEBUG_KMEMLEAK_TEST=m" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 47 | echo "CONFIG_KALLSYMS=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 48 | echo "CONFIG_KASAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 49 | echo "CONFIG_KASAN_GENERIC=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 50 | echo "# CONFIG_KASAN_INLINE is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 51 | echo "CONFIG_KASAN_OUTLINE=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 52 | echo "CONFIG_KASAN_SHADOW_OFFSET=0xdfffffd000000000" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 53 | echo "# CONFIG_TEST_KASAN is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 54 | echo "CONFIG_SLUB_DEBUG=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 55 | echo "CONFIG_FRAME_WARN=4096" >> ${BUILD_DIR}/target/linux/mediatek/mt7988/config-5.4 |
| 56 | } |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 57 | } |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 58 | |
| 59 | #step1 clean |
| 60 | #clean |
| 61 | #do prepare stuff |
| 62 | prepare |
| 63 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 64 | prepare_flowoffload |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 65 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 66 | #prepare mac80211 mt76 wifi stuff |
developer | 683be52 | 2023-05-11 14:24:50 +0800 | [diff] [blame] | 67 | prepare_mac80211 ${backport_new} ${hostapd_new} |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 68 | |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 69 | # find ${BUILD_DIR}/package/kernel/mt76/patches -name "*-mt76-*.patch" -delete |
| 70 | rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/* |
| 71 | |
| 72 | # ========== specific modification on mt7996 autobuild for EHT support ========== |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 73 | # patch hostapd to use latest version and add 11BE config |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame^] | 74 | patch -p1 < ${BUILD_DIR}/autobuild/${branch_name}/0002-add-EHT-config-for-hostapd.patch || exit 1 |
developer | 3e0400f | 2023-02-10 08:32:03 +0800 | [diff] [blame] | 75 | |
| 76 | # remove some iw patches to let EHT work normally |
| 77 | rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/001-nl80211_h_sync.patch |
| 78 | rm -rf ${BUILD_DIR}/package/network/utils/iw/patches/120-antenna_gain.patch |
| 79 | # =========================================================== |
developer | e5c01a4 | 2022-12-23 18:17:33 +0800 | [diff] [blame] | 80 | |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 81 | prepare_final ${branch_name} |
| 82 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 83 | change_dot_config |
| 84 | |
developer | 782053a | 2022-10-24 17:40:58 +0800 | [diff] [blame] | 85 | #step2 build |
| 86 | if [ -z ${1} ]; then |
| 87 | build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ] |
| 88 | fi |