diff --git a/.github/workflows/android-gs-akita-android16.yml b/.github/workflows/android-gs-akita-android16.yml new file mode 100644 index 00000000..4130398b --- /dev/null +++ b/.github/workflows/android-gs-akita-android16.yml @@ -0,0 +1,452 @@ +name: AOSP Zuma A16 KSU + +permissions: + contents: read + actions: read + +on: + workflow_dispatch: + inputs: + kernel_branch: + description: "Google zuma kernel branch" + required: false + default: "android-gs-akita-android16" + android_version: + description: "Android version string for SUSFS branch" + required: false + default: "android16" + kernel_version: + description: "Kernel version string for SUSFS branch" + required: false + default: "6.1" + localversion: + description: 'CONFIG_LOCALVERSION override (empty = keep stock)' + required: false + default: "" + enable_baseband_guard: + description: "Enable Baseband-guard integration" + required: false + default: "true" + + push: + paths-ignore: + - "README.md" + + pull_request: + paths-ignore: + - "README.md" + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + build: + # KSUN (KernelSU-Next) + SUSFS + - type: KSUN + ksu: true + repo: "KernelSU-Next/KernelSU-Next" + branch: "next" + ak3_suffix: "_KSUNext" + + # RKSU (rsuntk) + SUSFS + - type: RKSU + ksu: true + repo: "rsuntk/KernelSU" + branch: "susfs-main" + ak3_suffix: "_RKSU" + + # xxKSU (backslashxx) + SUSFS + - type: xxKSU + ksu: true + repo: "backslashxx/KernelSU" + branch: "master" + ak3_suffix: "_xxKSU" + + kernel: + - codename: "zuma" + defconfig: "zuma_defconfig" + + env: + KERNEL_REPO: "https://android.googlesource.com/kernel/devices/google/zuma" + ANYKERNEL_REPO: "https://github.com/TheWildJames/AnyKernel3.git" + ARCH: "arm64" + + steps: + - name: Checkout this repo (for workflow context) + uses: actions/checkout@v4 + + # ------------------------------------------------------------------ + # Dependencies + ccache + # ------------------------------------------------------------------ + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + bc bison flex git ccache \ + libssl-dev libncurses5-dev \ + build-essential wget zip \ + libelf-dev lz4 + + - name: Setup ccache + run: | + ccache --max-size=5G + ccache --set-config=compression=true + echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV + + # ------------------------------------------------------------------ + # Toolchain - GCC 14.2.0 nolibc (aarch64) with auto-detect + # ------------------------------------------------------------------ + - name: Download and extract GCC 14.2.0 toolchain + run: | + set -e + mkdir -p "$GITHUB_WORKSPACE/toolchain" + cd "$GITHUB_WORKSPACE/toolchain" + + echo "Downloading GCC 14.2.0 cross-compiler..." + wget -O toolchain.tar.gz \ + https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/14.2.0/x86_64-gcc-14.2.0-nolibc-aarch64-linux.tar.gz + + echo "Extracting toolchain..." + mkdir -p toolchain_raw + tar -xzf toolchain.tar.gz -C toolchain_raw + + echo "Searching for aarch64-linux-gcc* inside extracted toolchain..." + GCC_CANDIDATE=$(find toolchain_raw -maxdepth 7 -type f -name 'aarch64-linux-gcc*' | head -n1 || true) + + if [ -z "$GCC_CANDIDATE" ]; then + echo "ERROR: Could not find any aarch64-linux-gcc* binary inside toolchain_raw." + find toolchain_raw -maxdepth 6 -type f | head -n 80 || true + exit 1 + fi + + echo "Found GCC candidate: $GCC_CANDIDATE" + + TOOLCHAIN_BIN_DIR=$(cd "$(dirname "$GCC_CANDIDATE")" && pwd) + echo "TOOLCHAIN_BIN_DIR=$TOOLCHAIN_BIN_DIR" + + # Pastikan ada aarch64-linux-gcc, kalau namanya beda buat symlink + GCC_BASENAME=$(basename "$GCC_CANDIDATE") + if [ "$GCC_BASENAME" != "aarch64-linux-gcc" ]; then + echo "Creating symlink aarch64-linux-gcc -> $GCC_BASENAME" + ln -sf "$GCC_BASENAME" "$TOOLCHAIN_BIN_DIR/aarch64-linux-gcc" + fi + + echo "CROSS_COMPILE=${TOOLCHAIN_BIN_DIR}/aarch64-linux-" >> $GITHUB_ENV + echo "CC=${TOOLCHAIN_BIN_DIR}/aarch64-linux-gcc" >> $GITHUB_ENV + + echo "Toolchain bin dir content:" + ls -l "$TOOLCHAIN_BIN_DIR" + + # ------------------------------------------------------------------ + # Clone repos: AnyKernel3, SUSFS, James patches, AOSP zuma kernel + # ------------------------------------------------------------------ + - name: Clone dependencies and set environment + run: | + set -e + cd "$GITHUB_WORKSPACE" + + CODENAME="${{ matrix.kernel.codename }}" + DEFCONFIG="${{ matrix.kernel.defconfig }}" + ANDROID_VERSION="${{ github.event.inputs.android_version }}" + KERNEL_VERSION="${{ github.event.inputs.kernel_version }}" + KBRANCH="${{ github.event.inputs.kernel_branch }}" + [ -z "$KBRANCH" ] && KBRANCH="android-gs-akita-android16" + + SUSFS_BRANCH="gki-${ANDROID_VERSION}-${KERNEL_VERSION}" + + echo "Using:" + echo " codename = $CODENAME" + echo " defconfig = $DEFCONFIG" + echo " kernel branch = $KBRANCH" + echo " SUSFS branch = $SUSFS_BRANCH" + + # AnyKernel3: Sultan zuma branch as template + git clone --depth=1 "$ANYKERNEL_REPO" -b "sultan-${CODENAME}" AK3 + echo "ak3_dir=$PWD/AK3" >> $GITHUB_ENV + + # SUSFS patches + git clone --depth=5 https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH" susfs + echo "susfs_dir=$PWD/susfs" >> $GITHUB_ENV + + # WildKernels patches (syscall_hooks + sys.c_fix) + git clone --depth=1 https://github.com/WildKernels/kernel_patches.git james_patches + echo "james_dir=$PWD/james_patches" >> $GITHUB_ENV + + # AOSP zuma kernel (Google) + git clone "$KERNEL_REPO" kernel + cd kernel + git checkout "$KBRANCH" + + echo "kernel_dir=$PWD" >> $GITHUB_ENV + echo "KERNEL_BRANCH=$KBRANCH" >> $GITHUB_ENV + echo "ANDROID_VERSION=$ANDROID_VERSION" >> $GITHUB_ENV + echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV + echo "CODENAME=$CODENAME" >> $GITHUB_ENV + echo "DEFCONFIG=$DEFCONFIG" >> $GITHUB_ENV + + echo "Kernel HEAD:" + git log -1 --oneline + + cd "$GITHUB_WORKSPACE" + DATE="$(date +'%Y%m%d')" + ZIP_NAME="${DATE}-${CODENAME}${{ matrix.build.ak3_suffix }}.SUSFS_A16_AOSP-${GITHUB_RUN_NUMBER}" + echo "zip_name=$ZIP_NAME" >> $GITHUB_ENV + echo "Will produce: $ZIP_NAME.zip" + + # ------------------------------------------------------------------ + # Mountify-style configs + # ------------------------------------------------------------------ + - name: Apply Mountify-related config options + run: | + set -e + cd "${{ env.kernel_dir }}" + + DEFCONFIG_PATH="arch/arm64/configs/${{ env.DEFCONFIG }}" + echo "Using defconfig: $DEFCONFIG_PATH" + + configs="\ + CONFIG_TMPFS_XATTR=y \ + CONFIG_TMPFS_POSIX_ACL=y \ + CONFIG_IP_NF_TARGET_TTL=y \ + CONFIG_IP6_NF_TARGET_HL=y \ + CONFIG_IP6_NF_MATCH_HL=y \ + CONFIG_TCP_CONG_ADVANCED=y \ + CONFIG_TCP_CONG_BBR=y \ + CONFIG_NET_SCH_FQ=y \ + CONFIG_TCP_CONG_BIC=n \ + CONFIG_TCP_CONG_WESTWOOD=n \ + CONFIG_TCP_CONG_HTCP=n \ + CONFIG_DEFAULT_BBR=y \ + CONFIG_BPF_STREAM_PARSER=y \ + CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y \ + CONFIG_NETFILTER_XT_SET=y \ + CONFIG_IP_SET=y \ + CONFIG_IP_SET_MAX=65534 \ + CONFIG_IP_SET_BITMAP_IP=y \ + CONFIG_IP_SET_BITMAP_IPMAC=y \ + CONFIG_IP_SET_BITMAP_PORT=y \ + CONFIG_IP_SET_HASH_IP=y \ + CONFIG_IP_SET_HASH_IPMARK=y \ + CONFIG_IP_SET_HASH_IPPORT=y \ + CONFIG_IP_SET_HASH_IPPORTIP=y \ + CONFIG_IP_SET_HASH_IPPORTNET=y \ + CONFIG_IP_SET_HASH_IPMAC=y \ + CONFIG_IP_SET_HASH_MAC=y \ + CONFIG_IP_SET_HASH_NETPORTNET=y \ + CONFIG_IP_SET_HASH_NET=y \ + CONFIG_IP_SET_HASH_NETNET=y \ + CONFIG_IP_SET_HASH_NETPORT=y \ + CONFIG_IP_SET_HASH_NETIFACE=y \ + CONFIG_IP_SET_LIST_SET=y \ + CONFIG_IP6_NF_NAT=y \ + CONFIG_IP6_NF_TARGET_MASQUERADE=y" + + for cfg in $configs; do + name="$(echo "$cfg" | cut -d '=' -f1)" + echo "Enabling $cfg in $DEFCONFIG_PATH" + + sed -i -E "s/.*($name=.*)/# \1/g" "$DEFCONFIG_PATH" || true + printf "\n%s\n" "$cfg" >> "$DEFCONFIG_PATH" + done + + # ------------------------------------------------------------------ + # Optional CONFIG_LOCALVERSION override + # ------------------------------------------------------------------ + - name: Override CONFIG_LOCALVERSION (optional) + if: github.event.inputs.localversion != '' + run: | + set -e + cd "${{ env.kernel_dir }}" + DEFCONFIG_PATH="arch/arm64/configs/${{ env.DEFCONFIG }}" + LV="${{ github.event.inputs.localversion }}" + + echo "Overriding CONFIG_LOCALVERSION to: $LV" + + sed -i -E 's/CONFIG_LOCALVERSION="[^"]*"/# &/' "$DEFCONFIG_PATH" || true + printf '\nCONFIG_LOCALVERSION="%s"\n' "$LV" >> "$DEFCONFIG_PATH" + + # ------------------------------------------------------------------ + # Baseband-guard (optional) + # ------------------------------------------------------------------ + - name: Add Baseband-guard (BBG) + if: github.event.inputs.enable_baseband_guard == 'true' + shell: bash + run: | + set -euo pipefail + cd "${{ env.kernel_dir }}" + + echo "Adding Baseband-guard..." + wget -O- https://github.com/vc-teahouse/Baseband-guard/raw/main/setup.sh | bash + + DEFCONFIG_PATH="arch/arm64/configs/${{ env.DEFCONFIG }}" + echo 'CONFIG_BBG=y' >> "$DEFCONFIG_PATH" + + sed -i '/^config LSM$/,/^help$/{ /^[[:space:]]*default/ { /baseband_guard/! s/lockdown/lockdown,baseband_guard/ } }' \ + security/Kconfig + + # ------------------------------------------------------------------ + # KernelSU (KSUN / RKSU / xxKSU) + syscall_hooks + # ------------------------------------------------------------------ + - name: Add KernelSU (${{ matrix.build.type }}) + if: matrix.build.ksu + run: | + set -e + cd "${{ env.kernel_dir }}" + + echo "Integrating KernelSU variant: ${{ matrix.build.type }} (repo: ${{ matrix.build.repo }}, branch: ${{ matrix.build.branch }})" + curl -LSs "https://raw.githubusercontent.com/${{ matrix.build.repo }}/${{ matrix.build.branch }}/kernel/setup.sh" | bash -s "${{ matrix.build.branch }}" + + if [[ "${{ matrix.build.type }}" == "KSUN" || "${{ matrix.build.type }}" == "RKSU" ]]; then + echo "Applying syscall_hooks patch from WildKernels..." + patch -p1 -F 3 < "${{ env.james_dir }}/sultan/sys.c_fix.patch" || true + else + echo "xxKSU: no external syscall patch applied." + fi + + DEFCONFIG_PATH="arch/arm64/configs/${{ env.DEFCONFIG }}" + + { + echo "CONFIG_KSU=y" + echo "CONFIG_KSU_KPROBES_HOOK=n" + } >> "$DEFCONFIG_PATH" + + if [[ "${{ matrix.build.type }}" == "RKSU" || "${{ matrix.build.type }}" == "KSUN" ]]; then + echo "CONFIG_KSU_MANUAL_HOOK=y" >> "$DEFCONFIG_PATH" + fi + + # ------------------------------------------------------------------ + # SUSFS + # ------------------------------------------------------------------ + - name: Apply SUSFS patches + run: | + set -e + cd "${{ env.kernel_dir }}" + + ANDROID_VERSION="${{ env.ANDROID_VERSION }}" + KERNEL_VERSION="${{ env.KERNEL_VERSION }}" + + SRC="${{ env.susfs_dir }}/kernel_patches" + PATCH_FILE="50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch" + + echo "Applying SUSFS with patch: $PATCH_FILE" + + cp "$SRC/$PATCH_FILE" ./ + cp "$SRC/fs/"* "./fs/" + cp "$SRC/include/linux/"* "./include/linux/" + + patch -p1 < "$PATCH_FILE" || true + + echo "Applying sys.c_fix from WildKernels..." + patch -p1 --fuzz=3 < "${{ env.james_dir }}/sultan/sys.c_fix.patch" + + DEFCONFIG_PATH="arch/arm64/configs/${{ env.DEFCONFIG }}" + + { + echo "CONFIG_KSU_SUSFS=y" + echo "CONFIG_KSU_SUSFS_SUS_PATH=y" + echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" + echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" + echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" + echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" + echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" + echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" + echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" + echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" + echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" + echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" + echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" + echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" + echo "CONFIG_KSU_SUSFS_SUS_SU=n" + } >> "$DEFCONFIG_PATH" + + # ------------------------------------------------------------------ + # ccache cache + # ------------------------------------------------------------------ + - name: Cache kernel build (ccache) + uses: actions/cache@v4 + with: + path: ~/.ccache + key: aosp-zuma-a16-${{ matrix.build.type }}-ccache-${{ github.sha }} + restore-keys: | + aosp-zuma-a16-${{ matrix.build.type }}-ccache- + aosp-zuma-a16-ccache- + + # ------------------------------------------------------------------ + # Build + # ------------------------------------------------------------------ + - name: Build kernel (defconfig + Image) + run: | + set -e + cd "${{ env.kernel_dir }}" + + export ARCH=${{ env.ARCH }} + export KBUILD_BUILD_USER="GitHub" + export KBUILD_BUILD_HOST="Actions" + + echo "Using CROSS_COMPILE=$CROSS_COMPILE" + echo "Using CC=$CC" + + mkdir -p out + + echo "=== Running defconfig: ${{ env.DEFCONFIG }} ===" + make O=out ARCH=$ARCH \ + CROSS_COMPILE="$CROSS_COMPILE" \ + CC="$CC" \ + "${{ env.DEFCONFIG }}" + + echo "=== Building kernel with ccache ===" + make O=out ARCH=$ARCH \ + CROSS_COMPILE="ccache $CROSS_COMPILE" \ + CC="ccache $CC" \ + -j"$(nproc --all)" + + ls -R out/arch/arm64/boot || true + ls -R out/google-devices || true + + # ------------------------------------------------------------------ + # AnyKernel3 packaging + # ------------------------------------------------------------------ + - name: Prepare AnyKernel3 files + run: | + set -e + KDIR="${{ env.kernel_dir }}" + AK3="${{ env.ak3_dir }}" + CODENAME="${{ env.CODENAME }}" + + cd "$KDIR" + + IMG="out/arch/arm64/boot/Image.lz4" + if [ ! -f "$IMG" ]; then + echo "Image.lz4 not found at $IMG" + exit 1 + fi + + DTB_DIR="out/google-devices/${CODENAME}/dts" + if [ ! -d "$DTB_DIR" ]; then + echo "DTB directory not found: $DTB_DIR" + ls -R out/google-devices || true + exit 1 + fi + + echo "Copying Image.lz4 and concatenating DTB into AnyKernel3..." + cp "$IMG" "$AK3/Image.lz4" + cat "$DTB_DIR"/*.dtb > "$AK3/dtb" + + - name: Create flashable zip + run: | + set -e + cd "${{ env.ak3_dir }}" + + ZIP_NAME="${{ env.zip_name }}.zip" + echo "Creating $ZIP_NAME..." + zip -r "../$ZIP_NAME" ./* + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.zip_name }} + path: | + ${{ github.workspace }}/**/*.zip diff --git a/.github/workflows/build-kernel-release.yml b/.github/workflows/build-kernel-release.yml deleted file mode 100644 index 5810019d..00000000 --- a/.github/workflows/build-kernel-release.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: Build and Release Sultan Kernels - -permissions: - contents: write # Allow writing to repository contents (for pushing tags) - actions: write # Allows triggering actions - -on: - workflow_dispatch: - -jobs: - build-kernel-gs201: - uses: ./.github/workflows/sultan.yml - secrets: inherit - with: - codename: "gs201" - repo: "android_kernel_google_gs201" - android_version: "android14" - kernel_version: "6.1" - - build-kernel-zuma: - uses: ./.github/workflows/sultan.yml - secrets: inherit - with: - codename: "zuma" - repo: "android_kernel_google_zuma" - android_version: "android14" - kernel_version: "6.1" - - build-kernel-zumapro: - uses: ./.github/workflows/sultan.yml - secrets: inherit - with: - codename: "zumapro" - repo: "android_kernel_google_zumapro" - android_version: "android14" - kernel_version: "6.1" - - trigger-release: - runs-on: ubuntu-latest - needs: - - build-kernel-gs201 - - build-kernel-zuma - - build-kernel-zumapro - env: - REPO_OWNER: TheWildJames - REPO_NAME: Sultan_KernelSU_SUSFS - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_NAME: "Sultan Kernels With KernelSU Next & SUSFS v1.5.12" - RELEASE_NOTES: | - This release contains KernelSU Next and SUSFS v1.5.12 - - ⚠️ **COMPATIBILITY NOTICE** ⚠️ - Please ensure compatibility by comparing release dates with official Sultan kernel releases - - Module: - -> https://github.com/sidex15/ksu_module_susfs - - Managers: - -> https://github.com/WildKernels/Wild_KSU and others! - - Features: - [+] Wild KSU - [+] SUSFS v1.5.12 - - steps: - # Checkout the code - - name: Checkout code - uses: actions/checkout@v3 - - # Get the Latest Tag from GitHub - - name: Generate and Create New Tag - run: | - # Fetch the latest tag from GitHub (this is the latest tag based on the GitHub API) - LATEST_TAG=$(gh api repos/$REPO_OWNER/$REPO_NAME/tags --jq '.[0].name') - if [ -z "$LATEST_TAG" ]; then - LATEST_TAG="v1.5.12-r0" # Default to v1.5.7-0 if no tag exists - fi - - # Increment the suffix (e.g., v1.5.7-0 becomes v1.5.7-1) - NEW_TAG=$(echo "$LATEST_TAG" | awk -F'-r' '{suffix=$2; if (!suffix) suffix=0; suffix++; printf "%s-r%d", $1, suffix}') - - # Output the new tag to be used - echo "New tag: $NEW_TAG" - - # Set the new tag as an environment variable to be used in later steps - echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV - - # Create the tag in the repository - git tag $NEW_TAG - git push origin $NEW_TAG - - # Download Artifacts for A12 (Only if A12 Build is successful or input is true or empty) - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: ./downloaded-artifacts - - # Create GitHub Release and upload files if make_release is true - - name: Create GitHub Release - uses: actions/create-release@v1 - with: - tag_name: ${{ env.NEW_TAG }} # Use the generated tag for the release - release_name: ${{ env.RELEASE_NAME }} # Pass the RELEASE_NAME to the action - body: ${{ env.RELEASE_NOTES }} # Pass the RELEASE_NOTES to the action - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Release Assets Dynamically - run: | - # Loop through all files in the downloaded-artifacts directory - for file in ./downloaded-artifacts/kernel-*/*; do - # Skip directories - if [ -d "$file" ]; then - continue - fi - - # Upload the file to the GitHub release - echo "Uploading $file..." - gh release upload ${{ env.NEW_TAG }} "$file" - done - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NEW_TAG: ${{ env.NEW_TAG }} - - # Display Files Uploaded - - name: Display Files Uploaded - run: | - echo "GitHub release created with the following files:" - ls ./downloaded-artifacts/**/* diff --git a/.github/workflows/sultan.yml b/.github/workflows/sultan.yml deleted file mode 100644 index 46226880..00000000 --- a/.github/workflows/sultan.yml +++ /dev/null @@ -1,261 +0,0 @@ -name: Sultan -permissions: - contents: write # Allow writing to repository contents (for pushing tags) - actions: write # Allows triggering actions - -on: - workflow_call: # This allows this workflow to be called from another workflow - inputs: - codename: - required: true - type: string - repo: - required: true - type: string - android_version: - required: true - type: string - kernel_version: - required: true - type: string - -jobs: - build-kernel-sultan-kernelsu-susfs: - runs-on: ubuntu-latest - steps: - #- name: Maximize Build Space - # uses: AdityaGarg8/remove-unwanted-software@v5 - # with: - # remove-dotnet: 'true' # Frees ~2 GB - # remove-android: 'true' # Frees ~9 GB - # remove-haskell: 'true' # Frees ~5.2 GB - # remove-codeql: 'true' # Frees ~5.4 GB - # remove-docker-images: 'true' # Frees ~3.2 GB - # remove-large-packages: 'true' # Frees ~3.1 GB - # remove-swapfile: 'true' # Frees ~4 GB - # remove-cached-tools: 'false' # Avoid unless confirmed safe - # verbose: 'true' # Enable detailed logging - - - - name: Download and extract GCC 14.2.0 toolchain - run: | - echo "Downloading GCC 14.2.0 cross-compiler toolchain..." - wget https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/14.2.0/x86_64-gcc-14.2.0-nolibc-aarch64-linux.tar.gz - echo "Extracting .gz file..." - gunzip x86_64-gcc-14.2.0-nolibc-aarch64-linux.tar.gz - echo "Extracting .tar file..." - tar -xf x86_64-gcc-14.2.0-nolibc-aarch64-linux.tar - echo "GCC 14.2.0 toolchain extracted successfully" - - - name: Set CONFIG Environment Variable - run: | - CONFIG="${{ inputs.repo }}" - - # Set CONFIG as an environment variable for future steps - echo "CONFIG=$CONFIG" >> $GITHUB_ENV - - echo "CONFIG set to: $CONFIG" - - - name: Clone AnyKernel3 and Other Dependencies - run: | - echo "Cloning AnyKernel3 and other dependencies..." - - ANYKERNEL_BRANCH="sultan-${{ inputs.codename }}" - SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}" - - # Debug print the branches - echo "Using branch for AnyKernel3: $ANYKERNEL_BRANCH" - echo "Using branch for SUSFS: $SUSFS_BRANCH" - - # Clone repositories using the branch names - git clone https://github.com/TheWildJames/AnyKernel3.git -b "$ANYKERNEL_BRANCH" - git clone https://github.com/TheWildJames/kernel_patches.git - git clone https://github.com/kerneltoast/${{ inputs.repo }} - git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH" - cd susfs4ksu - git checkout a162e2469d0b472545e5e46457eee171c0975fb0 - - - name: Add KernelSU - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - - echo "Adding KernelSU..." - curl -LSs "https://raw.githubusercontent.com/WildKernels/Wild_KSU/wild/kernel/setup.sh" | bash -s wild - - - name: Apply SUSFS Patches - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - - echo "Applying SUSFS patches..." - - # Copy SUSFS patches - cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./ - cp ../susfs4ksu/kernel_patches/fs/* ./fs/ - cp ../susfs4ksu/kernel_patches/include/linux/* ./include/linux/ - - cd ./Wild_KSU - - echo "Applying wild SUSFS patches..." - cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./ - patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true - - echo "Applying wild SUSFS Fix patches..." - cp ../../kernel_patches/wild/susfs_fix_patches/v1.5.12/fix_core_hook.c.patch ./ - patch -p1 --forward < fix_core_hook.c.patch - - cp ../../kernel_patches/wild/susfs_fix_patches/v1.5.12/fix_sucompat.c.patch ./ - patch -p1 --forward < fix_sucompat.c.patch - - cp ../../kernel_patches/wild/susfs_fix_patches/v1.5.12/fix_kernel_compat.c.patch ./ - patch -p1 --forward < fix_kernel_compat.c.patch - - # Change to common directory and apply SUSFS patch - cd .. - patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true - cp ../kernel_patches/sultan/sys.c_fix.patch ./ - patch -p1 --fuzz=3 < sys.c_fix.patch - - - name: Apply KSU Hooks - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - # Apply additional patch - cp ../kernel_patches/wild/hooks/syscall_hooks.patch ./ - patch -p1 -F 3 < syscall_hooks.patch - - - name: Configure KernelSU - run: | - cd "$CONFIG" - # KernelSU Configuration - echo "# KernelSU Configuration" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_KPROBES_HOOK=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Configure Mountify Support - run: | - cd "$CONFIG" - # Mountify Support - echo "# Mountify Support" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TMPFS_XATTR=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TMPFS_POSIX_ACL=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Configure Networking - run: | - cd "$CONFIG" - # Networking Configuration - echo "# Networking Configuration" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_NF_TARGET_TTL=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP6_NF_TARGET_HL=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP6_NF_MATCH_HL=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Configure TCP Congestion Control - run: | - cd "$CONFIG" - # BBR TCP Congestion Control - echo "# BBR TCP Congestion Control" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TCP_CONG_ADVANCED=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TCP_CONG_BBR=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_NET_SCH_FQ=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TCP_CONG_BIC=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TCP_CONG_WESTWOOD=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_TCP_CONG_HTCP=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Configure IPSet Support - run: | - cd "$CONFIG" - # IPSet support - echo "# IPSet Support" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_MAX=65534" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_BITMAP_IP=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_BITMAP_IPMAC=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_BITMAP_PORT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IP=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IPMARK=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IPPORT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IPPORTIP=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IPPORTNET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_IPMAC=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_MAC=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_NETPORTNET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_NET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_NETNET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_NETPORT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_HASH_NETIFACE=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_IP_SET_LIST_SET=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Configure SUSFS - run: | - cd "$CONFIG" - # SUSFS Configuration - echo "# SUSFS Configuration" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - - name: Run sed and perl Commands - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - - echo "Running sed commands..." - sed -i 's/CONFIG_LOCALVERSION="-Sultan"/CONFIG_LOCALVERSION="-Sultan-Wild"/' ./arch/arm64/configs/${{ inputs.codename }}_defconfig - - - name: Build the Kernel - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - - make CROSS_COMPILE=$GITHUB_WORKSPACE/gcc-14.2.0-nolibc/aarch64-linux/bin/aarch64-linux- CC=$GITHUB_WORKSPACE/gcc-14.2.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc -j$(nproc --all) ${{ inputs.codename }}_defconfig - make CROSS_COMPILE=$GITHUB_WORKSPACE/gcc-14.2.0-nolibc/aarch64-linux/bin/aarch64-linux- CC=$GITHUB_WORKSPACE/gcc-14.2.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc -j$(nproc --all) - - - name: Copy Images - run: | - echo "Changing to configuration directory: $CONFIG..." - cd "$CONFIG" - - echo "Copying Image.lz4 and concatenating DTB files..." - cp ./out/arch/arm64/boot/Image.lz4 ../AnyKernel3/Image.lz4 - if [ "${{ inputs.codename }}" == "gs201" ]; then - cat ./out/google-devices/gs201/dts/*.dtb > ../AnyKernel3/dtb - #cp ./out/google-devices/gs201/dts/dtbo.img ../AnyKernel3/dtbo.img - elif [ "${{ inputs.codename }}" == "zuma" ]; then - cat ./out/google-devices/zuma/dts/*.dtb > ../AnyKernel3/dtb - elif [ "${{ inputs.codename }}" == "zumapro" ]; then - cat ./out/google-devices/zumapro/dts/*.dtb > ../AnyKernel3/dtb - fi - - - name: Create ZIP Files for Different Formats - run: | - echo "Navigating to AnyKernel3 directory..." - cd ./AnyKernel3 - - # Zip the files in the AnyKernel3 directory with a new naming convention - ZIP_NAME="${{ inputs.codename }}_A16_Sultan_WKSU_SUSFS.zip" - echo "Creating zip file $ZIP_NAME..." - zip -r "../$ZIP_NAME" ./* - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: kernel-${{ inputs.codename }} - path: | - *.zip diff --git a/README.md b/README.md index 15a8ee31..05830c98 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,8 @@ -# Wild Kernels for Android +# zuma only ## Your warranty is no longer valid! -I am **not responsible** for bricked devices, damaged hardware, or any issues that arise from using this kernel. - -**Please** do thorough research and fully understand the features included in this kernel before flashing it! - -By flashing this kernel, **YOU** are choosing to make these modifications. If something goes wrong, **do not blame me**! - ---- - -### Proceed at your own risk! - ---- - -# Kernels: - -[GKI](https://github.com/WildKernels/GKI_KernelSU_SUSFS) -[Sultan](https://github.com/WildKernels/Sultan_KernelSU_SUSFS) -[OnePlus](https://github.com/WildKernels/OnePlus_KernelSU_SUSFS) -[Legacy Pixels](https://github.com/WildKernels/Pixel_KernelSU_SUSFS) - ---- - -# Other Links: - -[Kernel Patches](https://github.com/WildKernels/kernel_patches) -[Old Build Scripts](https://github.com/TheWildJames/kernel_build_scripts) -[Horizon Kernel Flasher](https://github.com/libxzr/HorizonKernelFlasher) - ---- - -# Installation instructions: - -Follow the steps for GKI: -[Installation](https://kernelsu.org/guide/installation.html) - -To get boot.img format: -[Get My Kernel Format](https://github.com/TheWildJames/Get_My_Kernel_Format) - ---- - -# Features - -- **KernelSU**: KernelSU is a root solution for Android GKI devices, it works in kernel mode and grants root permission to userspace applications directly in kernel space. -- **SUSFS**: An addon root hiding kernel patches and userspace module for KernelSU. - ---- +personal use only # Credits @@ -60,27 +16,10 @@ Special thanks to the open-source community for their contributions! --- -# Support - -If you encounter any issues or need help, feel free to open an issue in this repository or reach out to me. - ---- - # Disclaimer Flashing this kernel will void your warranty, and there is always a risk of bricking your device. Please make sure to back up your data and ensure you understand the risks before proceeding. **Proceed at your own risk!** ---- - -[Telegram](https://t.me/TheWildJames) -[Telegram Group](https://t.me/WildKernels) - -# Special thanks to the following people for their contributions! -This helps me alot! <3 - -[simonpunk](https://gitlab.com/simonpunk/susfs4ksu.git) - Created SUSFS! -[sidex15](https://github.com/sidex15) - Created module! -If you have contributed and are not here please remind me!