This repository has been archived by the owner on May 12, 2024. It is now read-only.
redbull_defconfig: Regen #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Nekko Kernel | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.repository.owner.id == github.event.sender.id | |
env: | |
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" | |
CCACHE_NOHASHDIR: "true" | |
CCACHE_HARDLINK: "true" | |
KERNEL_CONFIG: "redbull_defconfig" | |
CUSTOM_CMDS: "CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- LLVM=1 LLVM_IAS=1 O=out LD=ld.lld" | |
ARCH: "arm64" | |
UPLOADNAME: "-KernelSU" | |
KERNEL_IMAGE_NAME: "Image.gz" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 100 | |
- name: Set swap to 10G | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 10 | |
- name: Setup build kernel environment | |
run: | | |
echo "BUILD_TIME=$(TZ=Asia/Shanghai date "+%Y%m%d%H%M")" >> $GITHUB_ENV | |
echo "DEVICE=$(echo ${{ env.KERNEL_CONFIG }} | sed 's!vendor/!!;s/_defconfig//;s/_user//;s/-perf//')" >> $GITHUB_ENV | |
sudo apt-get update | |
sudo apt-get install git ccache automake flex lzop bison gperf build-essential zip curl zlib1g-dev g++-multilib libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng maven libssl-dev pwgen libswitch-perl policycoreutils minicom libxml-sax-base-perl libxml-simple-perl bc libc6-dev-i386 lib32ncurses5-dev libx11-dev lib32z-dev libgl1-mesa-dev xsltproc unzip device-tree-compiler python2 python3 | |
mkdir -p $GITHUB_WORKSPACE/kernel_workspace | |
- name: Download Proton Clang | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace | |
git clone https://github.com/kdrag0n/proton-clang --depth=1 clang-aosp | |
- name: Download Gcc-aosp | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace | |
mkdir gcc-64 | |
wget -O gcc-aarch64.tar.gz https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/refs/tags/android-12.1.0_r27.tar.gz | |
tar -C gcc-64/ -zxvf gcc-aarch64.tar.gz | |
echo "GCC_64=CROSS_COMPILE=$GITHUB_WORKSPACE/kernel_workspace/gcc-64/bin/aarch64-linux-android-" >> $GITHUB_ENV | |
mkdir gcc-32 | |
wget -O gcc-arm.tar.gz https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/+archive/refs/tags/android-12.1.0_r27.tar.gz | |
tar -C gcc-32/ -zxvf gcc-arm.tar.gz | |
echo "GCC_32=CROSS_COMPILE_ARM32=$GITHUB_WORKSPACE/kernel_workspace/gcc-32/bin/arm-linux-androideabi-" >> $GITHUB_ENV | |
- name: Download kernel source | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace | |
git clone https://github.com/QKIvan/android_kernel_google_redbull -b 14 android-kernel --depth=1 | |
- name: Setup ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: build-kernel-${{ env.DEVICE }}${{ env.UPLOADNAME }} | |
max-size: 2G | |
- name: Build kernel | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace/android-kernel | |
export PATH=$GITHUB_WORKSPACE/kernel_workspace/clang-aosp/bin:$PATH | |
export KBUILD_BUILD_HOST=QKIvan-Host | |
export KBUILD_BUILD_USER=$(echo ${{ github.actor }} | tr A-Z a-z) | |
make -j$(nproc --all) CC=clang O=out ARCH=${{ env.ARCH }} ${{ env.CUSTOM_CMDS }} ${{ env.GCC_64 }} ${{ env.GCC_32 }} ${{ env.KERNEL_CONFIG }} | |
make -j$(nproc --all) CC="ccache clang" O=out ARCH=${{ env.ARCH }} ${{ env.CUSTOM_CMDS }} ${{ env.GCC_64 }} ${{ env.GCC_32 }} | |
- name: Check a kernel output files | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace | |
if [ -f android-kernel/out/arch/${{ env.ARCH }}/boot/${{ env.KERNEL_IMAGE_NAME }} ]; then | |
echo "CHECK_FILE_IS_OK=true" >> $GITHUB_ENV | |
else | |
echo "Kernel output file is empty" | |
exit 1 | |
fi | |
- name: Make Anykernel3 | |
if: env.CHECK_FILE_IS_OK == 'true' | |
run: | | |
cd $GITHUB_WORKSPACE/kernel_workspace | |
git clone https://github.com/osm0sis/AnyKernel3 | |
sed -i 's/do.devicecheck=1/do.devicecheck=0/g' AnyKernel3/anykernel.sh | |
sed -i 's!block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;!block=auto;!g' AnyKernel3/anykernel.sh | |
sed -i 's/is_slot_device=0;/is_slot_device=auto;/g' AnyKernel3/anykernel.sh | |
cp android-kernel/out/arch/${{ env.ARCH }}/boot/${{ env.KERNEL_IMAGE_NAME }} AnyKernel3/ | |
rm -rf AnyKernel3/.git* AnyKernel3/README.md | |
- name: Upload ${{ env.KERNEL_IMAGE_NAME }} | |
if: env.CHECK_FILE_IS_OK == 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.KERNEL_IMAGE_NAME }}${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }} | |
path: kernel_workspace/android-kernel/out/arch/${{ env.ARCH }}/boot/${{ env.KERNEL_IMAGE_NAME }} | |
- name: Upload AnyKernel3 | |
if: env.CHECK_FILE_IS_OK == 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: AnyKernel3${{ env.UPLOADNAME }}-${{ env.DEVICE }}-${{ env.BUILD_TIME }} | |
path: kernel_workspace/AnyKernel3/* |