build_kernelsu_for_equuleus #35
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_kernelsu_for_equuleus | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set swap to 10G | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 10 | |
- name: Setup build kernel environment | |
run: | | |
sudo apt-get update | |
sudo apt install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libncurses5 libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev make unzip python-is-python3 | |
- name: Download kernel source | |
run: | | |
cd /home/runner | |
git clone https://github.com/CZB666-wdnmd/android_kernel_xiaomi_sdm845.git -b udc-kernelsu --depth=1 kernel_sdm845 | |
- name: Download gcc and clang | |
run: | | |
cd /home/runner | |
git clone https://github.com/PixelExperience/prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9.git --depth=1 gcc_aarch64 | |
git clone https://github.com/PixelExperience/prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9.git --depth=1 gcc_arm | |
git clone https://github.com/PixelExperience/prebuilts_clang_kernel_linux-x86_clang-r416183b.git --depth=1 clang-r416183b | |
- name: Patch kernel source | |
run: | | |
cd /home/runner/kernel_sdm845 | |
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main | |
cd /home/runner/kernel_sdm845/KernelSU | |
expr 10000 + $(git rev-list --count HEAD) + 200 > /home/runner/ksu_ver | |
git config --global user.email "[email protected]" | |
git config --global user.name "asdasfgas" | |
git remote add target https://github.com/CZB666-wdnmd/KernelSU.git | |
git fetch target | |
git cherry-pick 5af8a55074f68b72022a93554cee79632feab787 dc8769d6694990011e51c20663bde3457a48be8d | |
- name: Build | |
run: | | |
cd /home/runner/kernel_sdm845 | |
PATH="/home/runner/clang-r416183b/bin:${PATH}" | |
cat ./arch/arm64/configs/vendor/xiaomi/mi845_defconfig > ./arch/arm64/configs/vendor/xiaomi/equuleus_defconfig | |
cat ./arch/arm64/configs/vendor/xiaomi/equuleus.config >> ./arch/arm64/configs/vendor/xiaomi/equuleus_defconfig | |
make O=out ARCH=arm64 vendor/xiaomi/equuleus_defconfig | |
make -j$(nproc --all) O=out CC=clang ARCH=arm64 CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=/home/runner/gcc_aarch64/bin/aarch64-linux-android- CROSS_COMPILE_ARM32=/home/runner/gcc_arm/bin/arm-linux-androideabi- AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip LLVM_IAS=1 LLVM=1 | |
- name: Make boot.img | |
run: | | |
cd /home/runner/ | |
git clone https://github.com/CZB666-wdnmd/kernelsu_xiaomi_equuleus_action.git bootedit | |
cp /home/runner/kernel_sdm845/out/arch/arm64/boot/Image /home/runner/bootedit/img/kernel | |
cd /home/runner/bootedit/img | |
chmod +x ./magiskboot | |
./magiskboot repack ./boot.img ./ksu-boot.img | |
- name: Upload boot.img | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ksu-boot.img | |
path: "/home/runner/bootedit/img/ksu-boot.img" |