Weekly NH KSU Build #11
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: Weekly NH KSU Build | |
on: | |
schedule: | |
- cron: '0 0 * * 1' | |
jobs: | |
build: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
env: | |
KERNEL_CMDLINE: "ARCH=arm64 CROSS_COMPILE=aarch64-elf- O=out" | |
steps: | |
- name: Checkout Kernel Source | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt install bc bison build-essential curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick jq lib32ncurses5-dev lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-gtk3-dev libxml2 libxml2-utils lunzip lzop pngcrush python-is-python3 python3 rr rsync schedtool simg2img squashfs-tools virtualenv xattr xmlstarlet xsltproc xz-utils zip zlib1g-dev -y | |
- name: Get Toolchain | |
run: | | |
wget https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/aarch64-elf/gcc-linaro-7.5.0-2019.12-i686_aarch64-elf.tar.xz --no-check-certificate | |
tar xf gcc-linaro-7.5.0-2019.12-i686_aarch64-elf.tar.xz | |
- name: Checkout KernelSU | |
run: | | |
rm -rf KernelSU | |
rm -rf drivers/kernelsu | |
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main | |
- name: Patch KernelSU Ambient caps | |
run: | | |
cd KernelSU | |
patch -p1 < ../patches/ksu_fix_op_not_permitted.patch | |
cd .. | |
- name: Set Date of Build | |
id: dob | |
run: | | |
echo "TIME=$(TZ=UTC-8 date +%y%m%d )" >> $GITHUB_OUTPUT | |
- name: Build Kernel | |
run: | | |
export PATH=$(pwd)/gcc-linaro-7.5.0-2019.12-i686_aarch64-elf/bin/:$PATH | |
export ARCH=arm64 | |
export SUBARCH=arm64 | |
make $KERNEL_CMDLINE nethunter_defconfig | |
make $KERNEL_CMDLINE -j$(nproc --all) | |
mkdir compiled | |
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x00478000 --cmdline "loglevel=4 coherent_pool=512K page_tracker=on slub_min_objects=12 unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=enforcing buildvariant=user" --kernel_offset 0x00008000 --ramdisk_offset 0x0ff88000 --second_offset 0x00e88000 --tags_offset 0x07988000 --header_version 0 --output compiled/Phenix_NH_KSU-enforcing-${{ steps.dob.outputs.TIME }}.img | |
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x00478000 --cmdline "loglevel=4 coherent_pool=512K page_tracker=on slub_min_objects=12 unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=permissive buildvariant=user" --kernel_offset 0x00008000 --ramdisk_offset 0x0ff88000 --second_offset 0x00e88000 --tags_offset 0x07988000 --header_version 0 --output compiled/Phenix_NH_KSU-permissive-${{ steps.dob.outputs.TIME }}.img | |
cp out/arch/arm64/boot/Image.gz compiled | |
- name: Upload Kernel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Phenix_NH_KSU-kernel-${{ steps.dob.outputs.TIME }} | |
path: "compiled" |