-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
73 lines (71 loc) · 3.45 KB
/
build
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
72
73
MakeZip(){
AnykernelPath=../../Anykernel3
if [ ! -d $AnykernelPath ];then
mkdir $AnykernelPath
cd $AnykernelPath
git clone https://github.com/ZyCromerZ/AnyKernel3 -b master-begonia-q-oss .
git fetch origin master master-begonia-q-oss original
git checkout origin/master && git checkout -b master
git checkout origin/original && git checkout -b original
AnykernelPath=$(pwd)
else
cd $AnykernelPath
git reset --hard
git fetch origin master-begonia-q-oss
git checkout master-begonia-q-oss
git reset --hard origin/master-begonia-q-oss
AnykernelPath=$(pwd)
fi
SpectrumPath=../Spectrum
if [ ! -d $SpectrumPath ];then
mkdir $SpectrumPath
cd $SpectrumPath
git clone https://github.com/ZyCromerZ/Spectrum -b master .
SpectrumPath=$(pwd)
cd $AnykernelPath
else
cd $SpectrumPath
git fetch origin master
git reset --hard origin/master
SpectrumPath=$(pwd)
cd $AnykernelPath
fi
[ ! -z "$SpectrumFile" ] && [ -e "$SpectrumPath/$SpectrumFile" ] && cp -af $SpectrumPath/$SpectrumFile $AnykernelPath/init.spectrum.rc && sed -i "s/persist.spectrum.kernel.*/persist.spectrum.kernel $KERNEL_NAME/g" init.spectrum.rc
cp -af $MainPath/../../begonia/out/arch/arm64/boot/Image.gz-dtb $AnykernelPath && rm -f $MainPath/../../begonia/out/arch/arm64/boot/Image.gz-dtb
cp -af anykernel-real.sh anykernel.sh
sed -i "s/kernel.string=.*/kernel.string=$KERNEL_NAME-$HeadCommit TEST by ZyCromerZ/g" anykernel.sh
zip -r ../kernel/zip/begonia/"[$TANGGAL]$KERNEL_NAME-$ZIP_KERNEL_VERSION.zip" ./ -x .git/**\* ./.git ./anykernel-real.sh ./.gitignore ./LICENSE ./README.md ./*.zip
for ListFile in Image Image-dtb Image.gz Image.gz-dtb dtb dtb.img dt dt.img dtbo dtbo.img init.spectrum.rc
do
rm -rf $AnykernelPath/ListFile
done
cd $MainPath
}
HeadCommit="$(git log --pretty=format:'%h' -1)"
export ARCH="arm64"
export SUBARCH="arm64"
export KBUILD_BUILD_USER="ZyCromerZ"
export KBUILD_BUILD_HOST="Lnix-$HeadCommit"
export CCACHE_DIR="../../begonia/ccache"
MainPath=$(pwd)
Defconfig="begonia_user_defconfig"
SpectrumFile="bego-on.rc"
KERNEL_NAME=$(cat "$MainPath/arch/arm64/configs/$Defconfig" | grep "CONFIG_LOCALVERSION=" | sed 's/CONFIG_LOCALVERSION="-*//g' | sed 's/"*//g' )
ZIP_KERNEL_VERSION="4.14.$(cat "$MainPath/Makefile" | grep "SUBLEVEL =" | sed 's/SUBLEVEL = *//g')$(cat "$(pwd)/Makefile" | grep "EXTRAVERSION =" | sed 's/EXTRAVERSION = *//g')"
GetCore=$(nproc --all)
TANGGAL=$(date +"%m%d")
MAKE="./makeparallel"
# rm -rf ../../begonia/out
make -j$(($GetCore)) O=../../begonia/out ARCH="arm64" SUBARCH="arm64" "$Defconfig"
if [[ ! -z "$1" ]] && [ "$1" == "regen" ] ;then
cp -af ../../begonia/out/.config $MainPath/arch/arm64/configs/$Defconfig
else
make -j$(($GetCore)) O=../../begonia/out \
PATH="../../clang/google-clang/bin:../../gcc/aarch64-linux-android-4.9/bin:../../gcc/arm-linux-androideabi-4.9/bin:${PATH}" \
LD_LIBRARY_PATH="../../clang/google-clang/lib64:${LD_LIBRARY_PATH}" \
CC="ccache clang" \
CROSS_COMPILE=aarch64-linux-android- \
CROSS_COMPILE_ARM32=arm-linux-androideabi- \
CLANG_TRIPLE=aarch64-linux-gnu-
[ -e ../../begonia/out/arch/arm64/boot/Image.gz-dtb ] && MakeZip
fi