developer | 20d6771 | 2022-03-02 14:09:32 +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 | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 7 | swpath=0 |
| 8 | kasan=0 |
developer | 7273f5f | 2022-12-12 17:18:16 +0800 | [diff] [blame] | 9 | backport_new=0 |
developer | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 10 | args= |
| 11 | |
| 12 | for arg in $*; do |
| 13 | case "$arg" in |
| 14 | "swpath") |
| 15 | swpath=1 |
| 16 | ;; |
| 17 | "kasan") |
| 18 | kasan=1 |
| 19 | ;; |
developer | 7273f5f | 2022-12-12 17:18:16 +0800 | [diff] [blame] | 20 | "dev") |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame] | 21 | backport_new=1 |
| 22 | ;; |
developer | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 23 | *) |
| 24 | args="$args $arg" |
| 25 | ;; |
| 26 | esac |
| 27 | done |
| 28 | set -- $args |
| 29 | |
| 30 | change_dot_config() { |
| 31 | [ "$swpath" = "1" ] && { |
developer | dbcd2cb | 2023-06-06 13:28:00 +0800 | [diff] [blame] | 32 | sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
developer | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 33 | 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 |
| 34 | sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 35 | sed -i 's/CONFIG_BRIDGE_NETFILTER=y/# CONFIG_BRIDGE_NETFILTER is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7622/config-5.4 |
| 36 | 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 |
| 37 | sed -i 's/CONFIG_SKB_EXTENSIONS=y/# CONFIG_SKB_EXTENSIONS is not set/g' ${BUILD_DIR}/target/linux/mediatek/mt7622/config-5.4 |
| 38 | sed -i '/AUTOLOAD:=$(call AutoProbe,mt7915e)/a\ MODPARAMS.mt7915e:=wed_enable=0' ${BUILD_DIR}/package/kernel/mt76/Makefile |
| 39 | } |
| 40 | |
| 41 | [ "$kasan" = "1" ] && { |
| 42 | sed -i 's/# CONFIG_KERNEL_KASAN is not set/CONFIG_KERNEL_KASAN=y/g' ${BUILD_DIR}/.config |
| 43 | sed -i 's/# CONFIG_KERNEL_KALLSYMS is not set/CONFIG_KERNEL_KALLSYMS=y/g' ${BUILD_DIR}/.config |
| 44 | echo "CONFIG_KERNEL_KASAN_OUTLINE=y" >> ${BUILD_DIR}/.config |
| 45 | echo "CONFIG_DEBUG_KMEMLEAK=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 46 | echo "CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 47 | echo "# CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 48 | echo "CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE=16000" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 49 | echo "CONFIG_DEBUG_KMEMLEAK_TEST=m" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 50 | echo "CONFIG_KALLSYMS=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 51 | echo "CONFIG_KASAN=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 52 | echo "CONFIG_KASAN_GENERIC=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 53 | echo "# CONFIG_KASAN_INLINE is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 54 | echo "CONFIG_KASAN_OUTLINE=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 55 | echo "CONFIG_KASAN_SHADOW_OFFSET=0xdfffffd000000000" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 56 | echo "# CONFIG_TEST_KASAN is not set" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 57 | echo "CONFIG_SLUB_DEBUG=y" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 58 | echo "CONFIG_FRAME_WARN=4096" >> ${BUILD_DIR}/target/linux/mediatek/mt7986/config-5.4 |
| 59 | } |
developer | 7273f5f | 2022-12-12 17:18:16 +0800 | [diff] [blame] | 60 | |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 61 | [ "$backport_new" = "1" ] && { |
| 62 | rm -rf ${BUILD_DIR}/package/kernel/mt76/patches/*revert-for-backports*.patch |
| 63 | } |
| 64 | |
developer | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 65 | } |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 66 | |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 67 | #step1 clean |
| 68 | #clean |
| 69 | |
| 70 | #do prepare stuff |
| 71 | prepare |
| 72 | |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 73 | prepare_flowoffload |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 74 | |
developer | 7273f5f | 2022-12-12 17:18:16 +0800 | [diff] [blame] | 75 | prepare_mac80211 ${backport_new} |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 76 | |
developer | e2cc0fa | 2022-03-29 17:31:03 +0800 | [diff] [blame] | 77 | prepare_final ${branch_name} |
developer | 2cf5f9a | 2022-03-25 02:46:17 +0800 | [diff] [blame] | 78 | |
developer | c3ea88b | 2022-09-29 20:21:40 +0800 | [diff] [blame] | 79 | change_dot_config |
| 80 | |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 81 | #step2 build |
| 82 | if [ -z ${1} ]; then |
developer | 9b3248d | 2022-07-06 00:44:05 +0800 | [diff] [blame] | 83 | build_log ${branch_name} -j1 || [ "$LOCAL" != "1" ] |
developer | 20d6771 | 2022-03-02 14:09:32 +0800 | [diff] [blame] | 84 | fi |