|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# curl -o build_kernel.sh -L https://raw.githubusercontent.com/Joe7500/valeryn_xiaomi_sm6115/refs/heads/build-actions/build_kernel.sh |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +sleep 7200 |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +set -x |
| 19 | + |
| 20 | +if [ $# -eq 0 ]; then |
| 21 | + echo "No arguments provided" |
| 22 | + echo vanilla ksun1 ksun3 |
| 23 | + exit 1 |
| 24 | +fi |
| 25 | + |
| 26 | +# Begin |
| 27 | +curl -o toolchain.tar.xz -L https://github.com/Joe7500/Builds/releases/download/Stuff/toolchain.tar.xz |
| 28 | +#cp ../toolchain.tar.xz . |
| 29 | + |
| 30 | +cd build |
| 31 | +rm -rf kernel |
| 32 | +git clone https://github.com/Joe7500/valeryn_xiaomi_sm6115 kernel |
| 33 | +#cp -rf ~/hdd1/device-tree/kernels/valeryn/valeryn-new.1/ kernel |
| 34 | +cd kernel || exit 1 |
| 35 | +git config user.email "user@localhost" |
| 36 | +git config user.name "user" |
| 37 | +rm -rf * |
| 38 | +git reset --hard |
| 39 | +git switch android16 |
| 40 | + |
| 41 | +bash ../../do_build_kernel.sh vanilla ksun1 ksun3 |
| 42 | + |
| 43 | + |
| 44 | +if echo $@ | grep vanilla ; then |
| 45 | + |
| 46 | +rm -rf * |
| 47 | +git reset --hard |
| 48 | +git switch android16 |
| 49 | +git switch -c build-vanilla || exit 1 |
| 50 | +cp ../../hani-ci.sh . |
| 51 | +bash ../../do_toolchain.sh |
| 52 | +echo "-perf" > localversion |
| 53 | + |
| 54 | +bash hani-ci.sh --build |
| 55 | + |
| 56 | +if [ $? -eq 0 ] ; then |
| 57 | + cp 4.19*.zip ../../4.19-A16-valeryn-`date +"%d.%m.%y"`.zip |
| 58 | + rm -rf * |
| 59 | + git reset --hard |
| 60 | + git switch android16 |
| 61 | + git branch -D build-vanilla |
| 62 | +else |
| 63 | + echo FAILED |
| 64 | + exit 1 |
| 65 | +fi |
| 66 | + |
| 67 | +fi |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +if echo $@ | grep ksun1 ; then |
| 72 | + |
| 73 | +rm -rf * |
| 74 | +git reset --hard |
| 75 | +git switch android16 |
| 76 | +git fetch |
| 77 | +git switch susfs-1.5.12 |
| 78 | +git pull --rebase |
| 79 | +git switch android16 |
| 80 | +git switch -c build-ksun1 || exit 1 |
| 81 | + |
| 82 | +git cherry-pick 9ddea125151ce61abbd05a84e8de72f8fc45da57 || exit 1 |
| 83 | +git cherry-pick f0b967626c361d95969dd962cd22dffe1ebe510d || exit 1 |
| 84 | +git cherry-pick dbc26ce49d11c5d1293dedb5f647dcdacf4432dd |
| 85 | +grep -v '<<<' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 86 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 87 | +grep -v '====' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 88 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 89 | +grep -v '>>>' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 90 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 91 | +git add arch/arm64/configs/vendor/bengal-perf_defconfig |
| 92 | +git cherry-pick --continue --no-edit |
| 93 | + |
| 94 | +tar xf ../KernelSU-Next-pershoot-october.tgz |
| 95 | +cd KernelSU-Next/ |
| 96 | +#git reset --hard HEAD~1 |
| 97 | +#git pull --rebase |
| 98 | +git reset --hard |
| 99 | +git switch next-susfs |
| 100 | +git pull --unshallow |
| 101 | +git tag next-susfs-1.5.12 |
| 102 | +cd .. |
| 103 | +bash KernelSU-Next/kernel/setup.sh next-susfs |
| 104 | +cd KernelSU-Next/ |
| 105 | +cd kernel |
| 106 | +sed -i 's#origin/HEAD#HEAD#g' Makefile |
| 107 | +cd .. |
| 108 | +patch -p1 < ../../../susfs-1.1.1/pkg_observer.patch || exit 1 |
| 109 | +cd .. |
| 110 | + |
| 111 | +cd arch/arm64/configs/vendor/ |
| 112 | +ln -s bengal-perf_defconfig chime_defconfig |
| 113 | +cd - |
| 114 | + |
| 115 | +bash ../../do_toolchain.sh |
| 116 | +cp ../../hani-ci.sh . |
| 117 | +echo "-perf" > localversion |
| 118 | + |
| 119 | +bash hani-ci.sh --build |
| 120 | + |
| 121 | +if [ $? -eq 0 ] ; then |
| 122 | + cp 4.19*.zip ../../4.19-A16-valeryn-ksun-1.1.1-`date +"%d.%m.%y"`.zip |
| 123 | + rm -rf * |
| 124 | + git reset --hard |
| 125 | + git switch android16 |
| 126 | + git branch -D build-ksun1 |
| 127 | +else |
| 128 | + echo FAILED |
| 129 | + exit 1 |
| 130 | +fi |
| 131 | + |
| 132 | +fi |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | +if echo $@ | grep ksun3 ; then |
| 137 | + |
| 138 | +rm -rf * |
| 139 | +git reset --hard |
| 140 | +git switch android16 |
| 141 | +git fetch |
| 142 | +git switch susfs-2.1.0 |
| 143 | +git pull --rebase |
| 144 | +git switch android16 |
| 145 | +git switch -c build-ksun3 || exit 1 |
| 146 | + |
| 147 | +#patch -p 1 < ../susfs-2.1.0/susfs_patch_to_4.19.patch |
| 148 | +#patch -p 1 < ../susfs-2.1.0/susfs_fixed.patch |
| 149 | + |
| 150 | +#bash ../susfs-2.1.0/backport_patches.sh |
| 151 | +#bash ../susfs-2.1.0/susfs_inline_hook_patches.sh |
| 152 | + |
| 153 | +git cherry-pick 84b385eb683c32beed15194b8c69611b3f35447f || exit 1 |
| 154 | +git cherry-pick 70865a757dfceb92fd0dc7d9074b432086c7b73f || exit 1 |
| 155 | +git cherry-pick 3f72527874b7007742e2dd24d5dc22891c031c3b || exit 1 |
| 156 | +git cherry-pick 5c6b9ed54ab6f3ffb820dfa27c037137e3eeae52 || exit 1 |
| 157 | +git cherry-pick 9beaa41861278b138f028253cdb0b4c5f80ee646 |
| 158 | +grep -v '<<<' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 159 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 160 | +grep -v '====' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 161 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 162 | +grep -v '>>>' arch/arm64/configs/vendor/bengal-perf_defconfig > arch/arm64/configs/vendor/bengal-perf_defconfig.1 |
| 163 | +mv arch/arm64/configs/vendor/bengal-perf_defconfig.1 arch/arm64/configs/vendor/bengal-perf_defconfig |
| 164 | +git add arch/arm64/configs/vendor/bengal-perf_defconfig |
| 165 | +git cherry-pick --continue --no-edit |
| 166 | + |
| 167 | +tar xf ../KernelSU-Next.tgz |
| 168 | +cd KernelSU-Next |
| 169 | +git reset --hard |
| 170 | +git switch legacy-susfs |
| 171 | +git tag 3.2.0-legacy-susfs |
| 172 | +cd .. |
| 173 | +bash KernelSU-Next/kernel/setup.sh 3.2.0-legacy-susfs |
| 174 | + |
| 175 | +echo "CONFIG_KSU=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 176 | +echo "# CONFIG_KPROBES is not set" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 177 | +echo "CONFIG_HAVE_SYSCALL_TRACEPOINTS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 178 | +echo "CONFIG_KSU_MANUAL_HOOK=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 179 | +echo "CONFIG_KSU_SUSFS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 180 | +echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 181 | +echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 182 | +echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 183 | +echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 184 | +echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 185 | +echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 186 | +echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 187 | +echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 188 | +echo "CONFIG_KSU_SUSFS_SUS_MAP=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 189 | +if grep -q "THREAD_INFO_IN_TASK" "drivers/kernelsu/Kconfig"; then |
| 190 | + echo "CONFIG_THREAD_INFO_IN_TASK=y" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 191 | +fi |
| 192 | +echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=n" >> arch/arm64/configs/vendor/bengal-perf_defconfig |
| 193 | + |
| 194 | +bash ../../do_toolchain.sh |
| 195 | +cp ../../hani-ci.sh . |
| 196 | +echo "-perf" > localversion |
| 197 | + |
| 198 | +bash hani-ci.sh --build |
| 199 | + |
| 200 | +if [ $? -eq 0 ] ; then |
| 201 | + cp 4.19*.zip ../../4.19-A16-valeryn-ksun-3.2.0-`date +"%d.%m.%y"`.zip |
| 202 | + rm -rf * |
| 203 | + git reset --hard |
| 204 | + git switch android16 |
| 205 | + git branch -D build-ksun3 |
| 206 | +else |
| 207 | + echo FAILED |
| 208 | + exit 1 |
| 209 | +fi |
| 210 | + |
| 211 | +fi |
0 commit comments