blob: ba5d6c0b490d12969bf65d15d9af45a6908921d8 [file] [log] [blame]
developer20d67712022-03-02 14:09:32 +08001#!/bin/bash
2source ./autobuild/lede-build-sanity.sh
3
4#get the brach_name
5temp=${0%/*}
6branch_name=${temp##*/}
developerc3ea88b2022-09-29 20:21:40 +08007swpath=0
8kasan=0
9args=
10
11for arg in $*; do
12 case "$arg" in
13 "swpath")
14 swpath=1
15 ;;
16 "kasan")
17 kasan=1
18 ;;
19 *)
20 args="$args $arg"
21 ;;
22 esac
23done
24set -- $args
25
26change_dot_config() {
27 [ "$swpath" = "1" ] && {
28 sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
29 sed -i 's/CONFIG_NETFILTER_FAMILY_BRIDGE=y/# CONFIG_NETFILTER_FAMILY_BRIDGE is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
30 sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
31 sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7622/config-5.4
32 sed -i 's/CONFIG_NETFILTER_FAMILY_BRIDGE=y/# CONFIG_NETFILTER_FAMILY_BRIDGE is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7622/config-5.4
33 sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7622/config-5.4
34 sed -i '/AUTOLOAD:=$(call AutoProbe,mt7915e)/a\ MODPARAMS.mt7915e:=wed_enable=0' ${BUILD_DIR}/package/kernel/mt76/Makefile
35 }
36
37 [ "$kasan" = "1" ] && {
38 sed -i 's/# CONFIG_KERNEL_KASAN is not set/CONFIG_KERNEL_KASAN=y/g' ${BUILD_DIR}/.config
39 sed -i 's/# CONFIG_KERNEL_KALLSYMS is not set/CONFIG_KERNEL_KALLSYMS=y/g' ${BUILD_DIR}/.config
40 echo "CONFIG_KERNEL_KASAN_OUTLINE=y" >> ${BUILD_DIR}/.config
41 echo "CONFIG_DEBUG_KMEMLEAK=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
42 echo "CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
43 echo "# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
44 echo "CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
45 echo "CONFIG_DEBUG_KMEMLEAK_TEST=m" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
46 echo "CONFIG_KALLSYMS=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
47 echo "CONFIG_KASAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
48 echo "CONFIG_KASAN_GENERIC=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
49 echo "# CONFIG_KASAN_INLINE is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
50 echo "CONFIG_KASAN_OUTLINE=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
51 echo "CONFIG_KASAN_SHADOW_OFFSET=0xdfffffd000000000" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
52 echo "# CONFIG_TEST_KASAN is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
53 echo "CONFIG_SLUB_DEBUG=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
54 echo "CONFIG_FRAME_WARN=4096" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4
55 }
56}
developer20d67712022-03-02 14:09:32 +080057
developer20d67712022-03-02 14:09:32 +080058#step1 clean
59#clean
60
61#do prepare stuff
62prepare
63
64#hack mt7986 config5.4
65echo "CONFIG_NETFILTER=y" >> ./target/linux/mediatek/mt7986/config-5.4
66echo "CONFIG_NETFILTER_ADVANCED=y" >> ./target/linux/mediatek/mt7986/config-5.4
67echo "CONFIG_RELAY=y" >> ./target/linux/mediatek/mt7986/config-5.4
68
developer9b3248d2022-07-06 00:44:05 +080069prepare_flowoffload
developer20d67712022-03-02 14:09:32 +080070
developere2cc0fa2022-03-29 17:31:03 +080071prepare_mac80211
developer2cf5f9a2022-03-25 02:46:17 +080072
developere2cc0fa2022-03-29 17:31:03 +080073prepare_final ${branch_name}
developer2cf5f9a2022-03-25 02:46:17 +080074
developerc3ea88b2022-09-29 20:21:40 +080075change_dot_config
76
developer20d67712022-03-02 14:09:32 +080077#step2 build
78if [ -z ${1} ]; then
developer9b3248d2022-07-06 00:44:05 +080079 build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ]
developer20d67712022-03-02 14:09:32 +080080fi