-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild_kernel.sh
More file actions
executable file
·39 lines (35 loc) · 1.37 KB
/
build_kernel.sh
File metadata and controls
executable file
·39 lines (35 loc) · 1.37 KB
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
if [ "$1" = "clang" ]; then
echo "Building kernel with clang toolchain"
else
echo "Building kernel with GCC toolchain"
fi
DEFCONFIG=whyred-perf_defconfig
OBJ_DIR=`pwd`/.obj
ANYKERNEL_DIR=${HOME}/ak
TOOLCHAIN=${HOME}/tc/aarch64-linux-android-4.9/bin/aarch64-linux-androidkernel-
CLANG_PATH=${HOME}/tc/clang-stable/bin/clang
CLANG_TRIPLE=aarch64-linux-gnu-
WEB_SERVER_ROOT=/var/www/html
DATE=$(date +"%m-%d-%y")
if [ "$1" = "clang" ]; then
MAKE_OPTS="ARCH=arm64 O=$OBJ_DIR CC=${CLANG_PATH} CLANG_TRIPLE=${CLANG_TRIPLE} CROSS_COMPILE=${TOOLCHAIN}"
else
MAKE_OPTS="ARCH=arm64 O=$OBJ_DIR CROSS_COMPILE=${TOOLCHAIN}"
fi
if [ ! -d ${OBJ_DIR} ]; then
mkdir ${OBJ_DIR}
fi
make ARCH=arm64 O=$OBJ_DIR CROSS_COMPILE=${TOOLCHAIN} $DEFCONFIG
make -j$(grep -c ^processor /proc/cpuinfo) ${MAKE_OPTS}
rm -f ${ANYKERNEL_DIR}/Image.gz*
rm -f ${ANYKERNEL_DIR}/zImage*
rm -f ${ANYKERNEL_DIR}/dtb*
cp $OBJ_DIR/arch/arm64/boot/Image.gz-dtb ${ANYKERNEL_DIR}/zImage-dtb
rm -rf ${ANYKERNEL_DIR}/modules/system/vendor/lib/modules
mkdir -p ${ANYKERNEL_DIR}/modules/system/vendor/lib/modules
cp $OBJ_DIR/drivers/staging/qcacld-3.0/wlan.ko ${ANYKERNEL_DIR}/modules/system/vendor/lib/modules/qca_cld3_wlan.ko
cp $OBJ_DIR/fs/exfat/exfat.ko ${ANYKERNEL_DIR}/modules/system/vendor/lib/modules/exfat.ko
cd ${ANYKERNEL_DIR}
rm *.zip
zip -r9 ZeurionX-$DATE.zip * -x README ZeurionX-$DATE.zip
cp Z* ${WEB_SERVER_ROOT}