forked from cretin45/htc-kernel-ruby
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build-linaro-no-config.sh
executable file
·40 lines (29 loc) · 1.16 KB
/
build-linaro-no-config.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
#!/bin/sh
#### FOR DEVELOPING ONLY DOES NOT CONTAIN 99kernel INIT SCRIPT TO CONFIG THE KERNEL. ASSUMES YOU ARE DOING A DIRTY FLASH ####
## date format ##
NOW=$(date +"%F")
NOWT=$(date +"%T")
# Number of jobs (usually the number of cores your CPU has (if Hyperthreading count each core as 2))
MAKE="2"
## Set compiler location
echo Setting compiler location...
export ARCH=arm
export CROSS_COMPILE=$HOME/android/system/prebuilt/linux-x86/toolchain/linaro/bin/arm-eabi-
## Build Sultan kernel
make -j$MAKE ARCH=arm
sleep 1
# Post compile tasks
echo Copying compiled kernel and modules to $HOME/KERNEL/out/ and building flashable zip.
sleep 1
rm -rf $HOME/KERNEL/out/
mkdir -p $HOME/KERNEL/out/
mkdir -p $HOME/KERNEL/out/system/lib/modules/
mkdir -p $HOME/KERNEL/out/kernel/
mkdir -p $HOME/KERNEL/out/META-INF/
cp -a $(find . -name *.ko -print |grep -v initramfs) $HOME/KERNEL/out/system/lib/modules/
cp -rf prebuilt-scripts/META-INF/ $HOME/KERNEL/out/
cp -rf prebuilt-scripts/kernel_dir/* $HOME/KERNEL/out/kernel/
cp arch/arm/boot/zImage $HOME/KERNEL/out/kernel/
# build flashable zip
cd $HOME/KERNEL/out/
zip -9 -r $HOME/ChronicKernel-dev-$NOW-$NOWT.zip .