blob: 22472ed78ed5a362911a3b860468e53addafe9c6 [file] [log] [blame]
developeree9d3082023-11-14 06:07:42 +08001#!/bin/bash
2source ./autobuild/lede-build-sanity.sh
3
4#get the brach_name
5temp=${0%/*}
6branch_name=${temp##*/}
7swpath=0
8kasan=0
9backport_new=0
10args=
11
12for arg in $*; do
13 case "$arg" in
14 "swpath")
15 swpath=1
16 ;;
17 "kasan")
18 kasan=1
19 ;;
20 "dev")
21 backport_new=1
22 ;;
23 *)
24 args="$args $arg"
25 ;;
26 esac
27done
28set -- $args
29
30change_dot_config() {
31 [ "$swpath" = "1" ] && {
32 sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
33 sed -i 's/CONFIG_NETFILTER_FAMILY_BRIDGE=y/# CONFIG_NETFILTER_FAMILY_BRIDGE is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
34 sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
35 sed -i '/AUTOLOAD:=$(call AutoProbe,mt7915e)/a\ MODPARAMS.mt7915e:=wed_enable=0' ${BUILD_DIR}/package/kernel/mt76/Makefile
36 }
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/mt7981/config-5.4
43 echo "CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
44 echo "# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
45 echo "CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
46 echo "CONFIG_DEBUG_KMEMLEAK_TEST=m" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
47 echo "CONFIG_KALLSYMS=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
48 echo "CONFIG_KASAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
49 echo "CONFIG_KASAN_GENERIC=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
50 echo "# CONFIG_KASAN_INLINE is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
51 echo "CONFIG_KASAN_OUTLINE=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
52 echo "CONFIG_KASAN_SHADOW_OFFSET=0xdfffffd000000000" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
53 echo "# CONFIG_TEST_KASAN is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
54 echo "CONFIG_SLUB_DEBUG=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
55 echo "CONFIG_FRAME_WARN=4096" >> ${BUILD_DIR}/target/linux/mediatek/mt7981/config-5.4
56 }
57
58 [ "$backport_new" = "1" ] && {
59 rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch
60 }
61}
62
63#step1 clean
64#clean
65
66#do prepare stuff
67prepare
68
69prepare_flowoffload
70
71prepare_mac80211 ${backport_new}
72
73prepare_final ${branch_name}
74
75change_dot_config
76
77#step2 build
78if [ -z ${1} ]; then
79 build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ].
80fi