diff --git a/build.sh b/build.sh index d96757780..affb10f55 100755 --- a/build.sh +++ b/build.sh @@ -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 -# +# # 4. Image output to out/arch/arm64/boot/Image -# +# AnyKernel3 zip output to out/AnyKernel3/_kernel_*.zip set -e @@ -39,6 +39,7 @@ LLVM=1 LLVM_IAS=1 LOCALVERSION=$LOCALVERSION " +# build kernel make -j$(nproc) -C $(pwd) O=$(pwd)/out ${ARGS} $TARGET_DEFCONFIG if [ "$LTO" = "thin" ]; then @@ -46,3 +47,14 @@ if [ "$LTO" = "thin" ]; then 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"