forked from frap129/ether
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-jenkins
executable file
·72 lines (63 loc) · 1.67 KB
/
build-jenkins
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
64
65
66
67
68
69
70
71
#!/bin/bash
# Build script for Electron kernel for ether
# Based on RenderBroken's shamu script
# Variables
export ARCH=arm64
export SUBARCH=arm64
export CROSS_COMPILE="/opt/aarch64-linux-gnu/bin/aarch64-linux-gnu-"
THREAD=-j$(bc <<< $(grep -c ^processor /proc/cpuinfo)+2)
DEFCONFIG="electron_defconfig"
KROOT="$(pwd)"
AK_DIR="$KROOT/anykernel"
PATCH_DIR="$AK_DIR/patch"
ZIP_MOVE="$KROOT/out"
IMAGE_DIR="$KROOT/arch/arm64/boot"
export REL="Weekly"
export TESTVER="-`date +%Y-%m-%d`"
# Functions
function make_kernel {
clear
make $DEFCONFIG
if ! make $THREAD; then exit 1; fi;
cp -vr $IMAGE_DIR/Image.gz-dtb $AK_DIR/zImage
}
function make_modules {
find $KROOT -name '*.ko' -exec cp -v {} $MODULES_DIR \;
}
function make_zip {
cd $AK_DIR
sed -i "s/kernel.rel=.*/kernel.rel=$REL$TESTVER/g" anykernel.sh
zip -r9 Electron-Release-"$REL""$TESTVER".zip *
if ! [ -d "$ZIP_MOVE" ]; then
mkdir $ZIP_MOVE
fi;
mv Electron-Release-"$REL""$TESTVER".zip $ZIP_MOVE
cd $KERNEL_DIR
}
# Compile Kernel
echo "Compiling Kernel.."
DATE_START=$(date +"%s")
make_kernel
DATE_KERNEL_END=$(date +"%s")
make_modules
make_zip
DATE_END=$(date +"%s")
echo -e "${red}"
echo "----------------------"
echo " Kernel Completed in:"
echo "----------------------"
echo -e "${restore}"
KDIFF=$(($DATE_KERNEL_END - $DATE_START))
echo "$(($KDIFF / 60)) minute(s) and $(($KDIFF % 60)) seconds."
echo
echo -e "${red}"
echo "-------------------"
echo " Zip Completed in:"
echo "-------------------"
echo -e "${restore}"
DIFF=$(($DATE_END - $DATE_START))
echo "$(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
echo
echo "Image size: $(du -h $IMAGE_DIR/Image.gz-dtb)"
echo
echo "Zip size: $(du -h $ZIP_MOVE/*.zip)"