#!/bin/bash if [ ! -d $PWD/android_kernel_xiaomi_marble ]; then git clone git@github.com:Pzqqt/android_kernel_xiaomi_marble.git fi if [ ! -d $PWD/clang ]; then aria2c -x 10 -s 10 -j 10 https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.0/LLVM-20.1.0-Linux-X64.tar.xz -o clang.tar.xz mkdir clang tar -xvf clang.tar.xz -C clang mv clang/*/* clang/ rm clang.tar.xz fi cd $PWD/android_kernel_xiaomi_marble git stash git stash drop stash@{0} # Find a normal solution git reset git fetch; git pull --rebase rm arch/arm64/configs/stock_gki_defconfig rm drivers/power/supply/qti_typec_class.c rm drivers/power/supply/qti_typec_class.h rm -rf patches mkdir patches curl https://github.com/Pzqqt/android_kernel_xiaomi_marble/compare/melt-rebase...melt-rebase-4LazyGoogle.diff -o patches/4LazyGoogle.diff || exit curl https://github.com/Pzqqt/android_kernel_xiaomi_marble/compare/melt-rebase-4LazyGoogle...melt-rebase-hyperos.diff -o patches/hyperos.diff || exit git apply --check --ignore-space-change --ignore-whitespace < ./patches/4LazyGoogle.diff || exit git apply --ignore-space-change --ignore-whitespace < ./patches/4LazyGoogle.diff || exit git apply --check --ignore-space-change --ignore-whitespace < ./patches/hyperos.diff || exit git apply --ignore-space-change --ignore-whitespace < ./patches/hyperos.diff || exit curl https://halhadus.rocks/sharedfiles/other/lxc_support.diff -o patches/lxc_support.diff git apply --check --ignore-space-change --ignore-whitespace < ./patches/lxc_support.diff || exit git apply --ignore-space-change --ignore-whitespace < ./patches/lxc_support.diff || exit rm -rf out export PATH=$PWD/../clang/bin:$PATH make ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out marble_defconfig make ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out -j$(nproc --all)