forked from LineageOS/android_kernel_xiaomi_sm8250
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-umi.sh
executable file
·63 lines (54 loc) · 1.94 KB
/
build-umi.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# _ _ _ _ _ _
# / \ _ __ __| |_ __ ___ (_) __| | | | _____ _ __ _ __ ___| |
# / _ \ | '_ \ / _` | '__/ _ \| |/ _` | | |/ / _ \ '__| '_ \ / _ \ |
# / ___ \| | | | (_| | | | (_) | | (_| | | < __/ | | | | | __/ |
# /_/ \_\_| |_|\__,_|_| \___/|_|\__,_| |_|\_\___|_| |_| |_|\___|_|
# +---------------------------------+
# | Build script for Android kernel |
# | Author: Yttehs-HDX@Github |
# +---------------------------------+
# kernel
DEFCONFIG="umi-miku_defconfig"
O="out"
ARCH="arm64"
# clang
#
# ├── kernel_root
# └── toolchains
CLANG_VERSION="20"
CLANG_PATH="$(pwd)/../toolchains/zyc-${CLANG_VERSION}"
PATH="$PATH:${CLANG_PATH}/bin"
GREEN="\033[0;32m"
BLUE="\033[0;34m"
YELLOW="\033[0;33m"
RED="\033[0;31m"
RESET="\033[0m"
# clean environment
echo -e "${YELLOW}-> make mrproper ...${RESET}"
rm -rf $O
make mrproper
# build kernel
echo -e "${YELLOW}-> make ${DEFCONFIG} ...${RESET}"
make O=$O ARCH=$ARCH $DEFCONFIG
echo -e "${BLUE}=> CLANG_PATH = ${CLANG_PATH}${RESET}"
echo -e "${YELLOW}-> make ...${RESET}"
make -j$(nproc --all) O=$O \
ARCH=$ARCH \
CC=clang \
CLANG_TRIPLE=aarch64-linux-gnu- \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi \
CFLAGS_KERNEL=-Wno-error \
KCFLAGS=-Wno-error
echo -e "${YELLOW}-> make modules ...${RESET}"
make modules_install INSTALL_MOD_PATH="." \
INSTALL_MOD_STRIP=1 \
O=$O \
ARCH=$ARCH \
CC=clang \
CLANG_TRIPLE=aarch64-linux-gnu- \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi \
CFLAGS_KERNEL=-Wno-error \
KCFLAGS=-Wno-error