Skip to content

Commit

Permalink
Add AnyKernel3
Browse files Browse the repository at this point in the history
  • Loading branch information
fei-ke committed Mar 7, 2024
1 parent 69db9b1 commit 548878f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#
# apt install -y clang llvm lld
#
# Or get Clang/LLVM from https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/heads/main/clang-r450784e.tar.gz
# Or get Clang/LLVM from https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/refs/heads/main/clang-r450784e.tar.gz
# and add bin dir to PATH
#
# 2. Install required packages
# apt install -y git zip make xz-utils bison flex libz-dev libssl-dev libelf-dev bc cpio python3 pahole
# apt install -y git zip build-essential xz-utils bison flex libz-dev libssl-dev libelf-dev bc cpio python3 pahole
#
# 3. Run build.sh to build kernel, do a clean before build is recommended
# make clean && rm -rf ./out
# ./build.sh <your defconfig>
#
#
# 4. Image output to out/arch/arm64/boot/Image
#
# AnyKernel3 zip output to out/AnyKernel3/<your defconfig>_kernel_*.zip

set -e

Expand All @@ -39,10 +39,22 @@ LLVM=1 LLVM_IAS=1
LOCALVERSION=$LOCALVERSION
"

# build kernel
make -j$(nproc) -C $(pwd) O=$(pwd)/out ${ARGS} $TARGET_DEFCONFIG

if [ "$LTO" = "thin" ]; then
./scripts/config --file out/.config -e LTO_CLANG_THIN -d LTO_CLANG_FULL
fi

make -j$(nproc) -C $(pwd) O=$(pwd)/out ${ARGS}

# pack AnyKernel3
cd out
if [ ! -d AnyKernel3 ]; then
git clone --depth=1 https://github.com/fei-ke/AnyKernel3.git -b kalama
fi
cp arch/arm64/boot/Image AnyKernel3/zImage
name=${TARGET_DEFCONFIG%%_defconfig}_kernel_`cat include/config/kernel.release`_`date '+%Y_%m_%d'`
cd AnyKernel3
zip -r ${name}.zip * -x *.zip
echo "AnyKernel3 package output to $(realpath $name).zip"

0 comments on commit 548878f

Please sign in to comment.