Build Huawei-Sydney-KSU-Kernel #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: Build Huawei-Sydney-KSU-Kernel | |
on: | |
workflow_dispatch: | |
schedule: | |
# Run once at 12:00 on Saturday.. See http://crontab.guru | |
- cron: '00 12 * * 6' | |
push: | |
branches: | |
- HEAD | |
pull_request: | |
branches: | |
- HEAD | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion" | |
CCACHE_NOHASHDIR: "true" | |
CCACHE_MAXSIZE: "2G" | |
CCACHE_HARDLINK: "true" | |
KERNEL_CMDLINE: "ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=out" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
fetch-depth: 100 | |
- name: Set up ccache | |
uses: hendrikmuhs/[email protected] | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt install binutils make python2 libssl-dev flex unzip libssl-dev ca-certificates xz-utils mkbootimg cpio device-tree-compiler git git-lfs bc bison build-essential ccache curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libelf-dev liblz4-tool libncurses5 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev adb fastboot -y | |
git clone https://github.com/Coconutat/ToolChains.git --dept=1 -b linaro_gcc_4.9 | |
- name: GetTime | |
id: get_time | |
run: | | |
echo "TIME=$(TZ=UTC-8 date +%m%d%H%M )" >> $GITHUB_OUTPUT | |
- name: Build Kernel | |
run: | | |
sudo ln -sf /usr/bin/python2.7 /usr/bin/python | |
if [ -d include/config ]; | |
then | |
echo "Find config,will remove it" | |
rm -rf include/config | |
else | |
echo "No Config,good." | |
fi | |
rm -rf KernelSU | |
rm -rf drivers/kernelsu | |
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main | |
export PATH=$(pwd)/ToolChains/bin/:$PATH | |
export ARCH=arm64 | |
export SUBARCH=arm64 | |
make $KERNEL_CMDLINE merge_kirin710_defconfig | |
make $KERNEL_CMDLINE -j$(nproc --all) | |
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x0 --cmdline "loglevel=4 initcall_debug=n page_tracker=on unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=enforcing buildvariant=user" --tags_offset 0x07988000 --kernel_offset 0x00008000 --ramdisk_offset 0x07b88000 --header_version 1 --os_version 9.0.0 --os_patch_level 2019-07 --output sydney_KSU-enforcing-${{ steps.get_time.outputs.TIME }}.img | |
tools/mkbootimg --kernel out/arch/arm64/boot/Image.gz --base 0x0 --cmdline "loglevel=4 initcall_debug=n page_tracker=on unmovable_isolate1=2:192M,3:224M,4:256M printktimer=0xfff0a000,0x534,0x538 androidboot.selinux=permissive buildvariant=user" --tags_offset 0x07988000 --kernel_offset 0x00008000 --ramdisk_offset 0x07b88000 --header_version 1 --os_version 9.0.0 --os_patch_level 2019-07 --output sydney_KSU-permissive-${{ steps.get_time.outputs.TIME }}.img | |
- name: Upload Sydney-KSU-Kernel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sydney_KSU-kernel-${{ steps.get_time.outputs.TIME }} | |
path: "sydney_KSU-*.img" |