├── README.md ├── banner.png ├── compile_gki.sh ├── compile_with_gcc.sh └── compile_with_tc.sh /README.md: -------------------------------------------------------------------------------- 1 | ![other](https://github.com/romiyusnandar/script-compile/raw/main/banner.png) 2 | 3 | # dependency 4 | 5 | ```bash 6 | sudo su 7 | ``` 8 | 9 | then 10 | ```bash 11 | # this script work for build kernel and custom rom 12 | apt update -y; apt upgrade -y; apt install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev device-tree-compiler python-is-python3 13 | ``` 14 | -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romiyusnandar/script-compile/d971ed7b957c55c3c1b3dd83949bc60a768ad6a7/banner.png -------------------------------------------------------------------------------- /compile_gki.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2023 sirNewbies 4 | # 5 | 6 | # init 7 | WORK_DIR=$(pwd) 8 | ANYKERNEL="${WORK_DIR}/anykernel" 9 | ANYKERNEL_REPO="https://github.com/sirnewbies/Anykernel3.git" 10 | ANYKERNEL_BRANCH="topaz" 11 | KERNEL_DIR="topaz" 12 | 13 | # VERSIONING 14 | KSU="ksu" 15 | NKSU="non-ksu" 16 | REL="v1.6" 17 | KERNEL="QuantumCharge-topaz-tapas-xun-$REL-$KSU" 18 | ZIPNAME=$KERNEL.zip 19 | KERN_IMG=$WORK_DIR/out/android13-5.15/dist/Image 20 | 21 | # setup telegram 22 | CHATIDQ="-1001597724605" 23 | CHATID="-1001597724605" # Group/channel chatid (use rose/userbot to get it) 24 | TELEGRAM_TOKEN="5136791856:AAGY5TeaVoeJbd6a2BAlxAjOc-MFWOJzZds" # Get from botfather 25 | 26 | # setup color 27 | red='\033[0;31m' 28 | green='\e[0;32m' 29 | white='\033[0m' 30 | yellow='\033[0;33m' 31 | 32 | function clean() { 33 | echo -e "\n" 34 | echo -e "$red << cleaning up >> \n$white" 35 | echo -e "\n" 36 | rm -rf ${ANYKERNEL} 37 | rm -rf out 38 | } 39 | 40 | function update_ksu() { 41 | echo -e "\n" 42 | echo -e "$yellow << updateing kernelsu >> \n$white" 43 | echo -e "\n" 44 | cd $KERNEL_DIR || exit 45 | ./update_ksu.sh 46 | } 47 | 48 | function pack_kernel() { 49 | echo -e "\n" 50 | echo -e "$yellow << packing kernel >> \n$white" 51 | echo -e "\n" 52 | 53 | TELEGRAM_FOLDER="${HOME}"/workspaces/telegram 54 | if ! [ -d "${TELEGRAM_FOLDER}" ]; then 55 | git clone https://github.com/sirnewbies/telegram.sh/ "${TELEGRAM_FOLDER}" 56 | fi 57 | 58 | TELEGRAM="${TELEGRAM_FOLDER}"/telegram 59 | 60 | git clone "$ANYKERNEL_REPO" -b "$ANYKERNEL_BRANCH" "$ANYKERNEL" 61 | 62 | cp $KERN_IMG $ANYKERNEL/Image 63 | cd $ANYKERNEL || exit 64 | zip -r9 $ZIPNAME ./* 65 | 66 | $TELEGRAM -f $ZIPNAME -t $TELEGRAM_TOKEN -c $CHATIDQ 67 | echo -e "\n" 68 | echo -e "$green << kernel uploaded to telegram >>" 69 | echo -e "\n" 70 | } 71 | 72 | function build_kernel() { 73 | echo -e "\n" 74 | echo -e "$yrllow << building kernel >> \n$white" 75 | echo -e "\n" 76 | 77 | cd $WORK_DIR 78 | LTO=thin BUILD_CONFIG=$KERNEL_DIR/build.config.gki.aarch64 build/build.sh 79 | 80 | if [ -e "$KERN_IMG" ]; then 81 | echo -e "\n" 82 | echo -e "$green << compile kernel success! >> \n$white" 83 | echo -e "\n" 84 | pack_kernel 85 | else 86 | echo -e "\n" 87 | echo -e "$red << compile kernel failed! >> \n$white" 88 | echo -e "\n" 89 | fi 90 | } 91 | 92 | # exe 93 | clean 94 | update_ksu 95 | build_kernel 96 | -------------------------------------------------------------------------------- /compile_with_gcc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright cc 2023 sirnewbies 3 | 4 | # setup color 5 | red='\033[0;31m' 6 | green='\e[0;32m' 7 | white='\033[0m' 8 | yellow='\033[0;33m' 9 | 10 | WORK_DIR=$(pwd) 11 | KERN_IMG="${WORK_DIR}/out/arch/arm64/boot/Image-gz.dtb" 12 | KERN_IMG2="${WORK_DIR}/out/arch/arm64/boot/Image.gz" 13 | 14 | function clean() { 15 | echo -e "\n" 16 | echo -e "$red << cleaning up >> \n$white" 17 | echo -e "\n" 18 | rm -rf out 19 | } 20 | 21 | function build_kernel() { 22 | echo -e "\n" 23 | echo -e "$yellow << building kernel >> \n$white" 24 | echo -e "\n" 25 | 26 | make -j$(nproc --all) O=out ARCH=arm64 _defconfig 27 | make -j$(nproc --all) ARCH=arm64 O=out \ 28 | CROSS_COMPILE=aarch64-linux-gnu- \ 29 | CROSS_COMPILE_ARM32=arm-linux-gnueabi- \ 30 | CROSS_COMPILE_COMPAT=arm-linux-gnueabi- 31 | 32 | if [ -e "$KERN_IMG" ] || [ -e "$KERN_IMG2" ]; then 33 | echo -e "\n" 34 | echo -e "$green << compile kernel success! >> \n$white" 35 | echo -e "\n" 36 | else 37 | echo -e "\n" 38 | echo -e "$red << compile kernel failed! >> \n$white" 39 | echo -e "\n" 40 | fi 41 | } 42 | 43 | # execute 44 | clean 45 | build_kernel 46 | -------------------------------------------------------------------------------- /compile_with_tc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright cc 2023 sirnewbies 3 | 4 | # setup color 5 | red='\033[0;31m' 6 | green='\e[0;32m' 7 | white='\033[0m' 8 | yellow='\033[0;33m' 9 | 10 | # setup dir 11 | WORK_DIR=$(pwd) 12 | KERN_IMG="${WORK_DIR}/out/arch/arm64/boot/Image-gz.dtb" 13 | KERN_IMG2="${WORK_DIR}/out/arch/arm64/boot/Image.gz" 14 | 15 | function clean() { 16 | echo -e "\n" 17 | echo -e "$red << cleaning up >> \n$white" 18 | echo -e "\n" 19 | rm -rf out 20 | } 21 | 22 | function build_kernel() { 23 | export PATH="/home/romiyusnandar/toolchains/proton-clang/bin:$PATH" 24 | make -j$(nproc --all) O=out ARCH=arm64 _defconfig 25 | make -j$(nproc --all) ARCH=arm64 O=out \ 26 | CC=clang \ 27 | CROSS_COMPILE=aarch64-linux-gnu- \ 28 | CROSS_COMPILE_ARM32=arm-linux-gnueabi- 29 | if [ -e "$KERN_IMG" ] || [ -e "$KERN_IMG2" ]; then 30 | echo -e "\n" 31 | echo -e "$green << compile kernel success! >> \n$white" 32 | echo -e "\n" 33 | else 34 | echo -e "\n" 35 | echo -e "$red << compile kernel failed! >> \n$white" 36 | echo -e "\n" 37 | fi 38 | } 39 | 40 | # execute 41 | clean 42 | build_kernel 43 | --------------------------------------------------------------------------------