Created
July 4, 2025 20:57
-
-
Save 57op/74c7c96cd9e948fb4970aa3ec2e825dc to your computer and use it in GitHub Desktop.
Helper bash script for building LineageOS miatoll kernel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
export CWD=$(dirname "$(readlink -f ${0})") | |
export GCC=${CWD}/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 | |
export CLANG=${CWD}/clang-r536225 | |
export KERNEL=${CWD}/android_kernel_xiaomi_sm6250 | |
export OUT=${CWD}/out | |
mkdir -p ${OUT} | |
case "${1}" in | |
clean) | |
make -C ${KERNEL} O=${OUT} distclean | |
;; | |
config) | |
make -C ${KERNEL} O=${OUT} ARCH=arm64 vendor/xiaomi/miatoll_ksn_defconfig #miatoll_defconfig #miatoll_ksn_defconfig | |
;; | |
Image) | |
make \ | |
-C ${KERNEL} \ | |
O=${OUT} \ | |
PATH=${CLANG}/bin:${GCC}/bin:${PATH} \ | |
LLVM=1 \ | |
ARCH=arm64 \ | |
LLVM_IAS=1 \ | |
CROSS_COMPILE=${GCC}/bin/aarch64-linux-android- \ | |
CLANG_TRIPLE=aarch64-linux-gnu- \ | |
CC=clang \ | |
NM=llvm-nm \ | |
OBJCOPY=llvm-objcopy \ | |
LD=ld.lld \ | |
-j$(nproc) Image | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment