| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806 |
- name: Kernel Build Process
- permissions:
- contents: write
- actions: write
- on:
- workflow_call:
- inputs:
- android_version:
- required: true
- type: string
- kernel_version:
- required: true
- type: string
- sub_level:
- required: true
- type: string
- os_patch_level:
- required: true
- type: string
- jobs:
- build-gki:
- name: "${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.android_version }}-${{ inputs.os_patch_level }} (${{ matrix.apply_bypass }})"
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- apply_bypass: ["normal", "bypass"]
- steps:
- - name: Check Initial Disk Space
- run: |
- echo "===== Initial Total Disk Space in GB ====="
- df -BG
-
- - name: Download Apache Arrow's util_free_space.sh
- run: |
- curl -L -o util_free_space.sh https://raw.githubusercontent.com/apache/arrow/main/ci/scripts/util_free_space.sh
- chmod +x util_free_space.sh
- ./util_free_space.sh
-
- - name: Check Disk Space After Cleanup
- run: |
- echo "===== Total Disk Space After Cleanup in GB ====="
- df -BG
-
- - name: Set CONFIG Environment Variable
- run: |
- # Set CONFIG dynamically based on inputs values
- CONFIG="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.sub_level }}"
- # Set CONFIG as an environment variable for future steps
- echo "CONFIG=$CONFIG" >> $GITHUB_ENV
- - name: Setup Build Environment
- run: |
- AOSP_MIRROR=https://android.googlesource.com
- BRANCH=main-kernel-2025
- git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools &
- git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1 mkbootimg &
- wait
-
- echo "AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool" >> $GITHUB_ENV
- echo "MKBOOTIMG=$GITHUB_WORKSPACE/mkbootimg/mkbootimg.py" >> $GITHUB_ENV
- echo "UNPACK_BOOTIMG=$GITHUB_WORKSPACE/mkbootimg/unpack_bootimg.py" >> $GITHUB_ENV
- echo "BOOT_SIGN_KEY_PATH=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem" >> $GITHUB_ENV
- echo "PATH=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin:$PATH" >> $GITHUB_ENV
-
- mkdir -p ./git-repo
- curl https://storage.googleapis.com/git-repo-downloads/repo > ./git-repo/repo
- chmod a+rx ./git-repo/repo
- echo "REPO=$GITHUB_WORKSPACE/./git-repo/repo" >> $GITHUB_ENV
- - name: Set boot sign key
- env:
- BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}
- run: |
- if [ ! -z "$BOOT_SIGN_KEY" ]; then
- echo "$BOOT_SIGN_KEY" > ./kernel-build-tools/linux-x86/share/avb/testkey_rsa2048.pem
- fi
- - name: Clone AnyKernel3 and Other Dependencies
- run: |
- ANYKERNEL_BRANCH="gki-2.0"
- SUSFS_BRANCH="gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}"
-
- git clone https://github.com/WildKernels/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
- git clone https://github.com/WildKernels/kernel_patches.git
- git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
- - name: Initialize and Sync Kernel Source
- run: |
- mkdir -p "$CONFIG"
- cd "$CONFIG"
-
- FORMATTED_BRANCH="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.os_patch_level }}"
-
- $REPO init --depth=1 --u https://android.googlesource.com/kernel/manifest -b common-${FORMATTED_BRANCH} --repo-rev=v2.16
-
- REMOTE_BRANCH=$(git ls-remote https://android.googlesource.com/kernel/common ${FORMATTED_BRANCH})
- DEFAULT_MANIFEST_PATH=.repo/manifests/default.xml
- if grep -q deprecated <<< $REMOTE_BRANCH; then
- sed -i "s/\"${FORMATTED_BRANCH}\"/\"deprecated\/${FORMATTED_BRANCH}\"/g" $DEFAULT_MANIFEST_PATH
- fi
-
- $REPO --trace sync -c -j$(nproc --all) --no-tags --fail-fast
-
- - name: Check Directory Space Usage
- run: |
- echo "===== Total Disk Space After Kernel Download in GB ====="
- df -BG
-
- echo "===== Directory Space Usage in GB ====="
- du -BG -d 1 | sort -nr
-
- echo "===== $CONFIG Directory Space Usage in GB ====="
- cd "$CONFIG"
- du -BG -d 2 | sort -nr
- - name: Extract Actual Sublevel
- run: |
- cd "$CONFIG/common"
-
- if [ -f "Makefile" ]; then
- ACTUAL_SUBLEVEL=$(grep '^SUBLEVEL = ' Makefile | awk '{print $3}')
-
- if [ -n "$ACTUAL_SUBLEVEL" ]; then
- echo "ACTUAL_SUBLEVEL=$ACTUAL_SUBLEVEL" >> $GITHUB_ENV
- echo "Extracted ACTUAL_SUBLEVEL=$ACTUAL_SUBLEVEL; no directory changes performed."
- else
- echo "Warning: SUBLEVEL not found in Makefile; continuing with inputs.sub_level."
- fi
- fi
- - name: Apply glibc 2.38 Compatibility Fix
- run: |
- # Use ACTUAL_SUBLEVEL for LTS builds, otherwise use the input sub_level
-
- if ([[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && (( $ACTUAL_SUBLEVEL <= 186 ))) ||
- ([[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( $ACTUAL_SUBLEVEL <= 119 ))) ||
- ([[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( $ACTUAL_SUBLEVEL <= 110 ))) ||
- ([[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "6.1" ]] && (( $ACTUAL_SUBLEVEL <= 43 ))); then
- GLIBC_VERSION=$(ldd --version 2>/dev/null | head -n 1 | awk '{print $NF}')
- if [ "$(printf '%s\n' "2.38" "$GLIBC_VERSION" | sort -V | head -n1)" = "2.38" ]; then
- cd $CONFIG/common/
- sed -i '/\$(Q)\$(MAKE) -C \$(SUBCMD_SRC) OUTPUT=\$(abspath \$(dir \$@))\/ \$(abspath \$@)/s//$(Q)$(MAKE) -C $(SUBCMD_SRC) EXTRA_CFLAGS="$(CFLAGS)" OUTPUT=$(abspath $(dir $@))\/ $(abspath $@)/' tools/bpf/resolve_btfids/Makefile 2>/dev/null || true
- if ([[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && (( $ACTUAL_SUBLEVEL <= 186 ))) ||
- ([[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( $ACTUAL_SUBLEVEL <= 119 ))) ||
- ([[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( $ACTUAL_SUBLEVEL <= 110 ))); then
- sed -i '/char \*buf = NULL;/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
- sed -i 's/for (int i = 0; subcommands\[i\]; i++) {/for (i = 0; subcommands[i]; i++) {/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
- sed -i '/if (subcommands) {/a int i;' tools/lib/subcmd/parse-options.c 2>/dev/null || true
- sed -i 's/for (int i = 0; subcommands\[i\]; i++)/for (i = 0; subcommands[i]; i++)/' tools/lib/subcmd/parse-options.c 2>/dev/null || true
- fi
- fi
- fi
- - name: Fix Less Then 6.6.50 Builds
- if: inputs.android_version == 'android15' && inputs.kernel_version == '6.6'
- run: |
- cd "$CONFIG/common"
- if ! grep -qxF '#include <trace/hooks/fs.h>' ./fs/namespace.c; then
- sed -i '/#include <trace\/hooks\/blk.h>/a #include <trace\/hooks\/fs.h>' ./fs/namespace.c
- fi
- - name: Apply ptrace patch for older kernels
- if: fromJSON(inputs.kernel_version) < 5.16
- run: |
- cd "$CONFIG/common"
- patch -p1 -F 3 < "../../kernel_patches/gki_ptrace.patch"
- - name: Add KernelSU
- run: |
- cd "$CONFIG"
- curl -LSs "https://raw.githubusercontent.com/WildKernels/Wild_KSU/wild/kernel/setup.sh" | bash -s wild
- - name: Getting KernelSU Version
- run: |
- cd "$CONFIG/Wild_KSU/kernel"
- BASE_VERSION=10200
- COMMIT_COUNT=$(/usr/bin/git rev-list --count HEAD)
- KSU_VERSION=$(expr $COMMIT_COUNT "+" $BASE_VERSION)
- echo "KSUVER=$KSU_VERSION" >> $GITHUB_ENV
- - name: Apply SUSFS Patches for KernelSU Variants
- run: |
- cd "$CONFIG"
-
- # Apply compatibility fixes
- SUSFS_VERSION="1.5.12"
- cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/
- cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
- # Apply core SUSFS patches
- cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./common/
- cd common
- # Pre-SUSFS sed safeguards removed; moved below core patch
- # Apply SUSFS core patch
- patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
- # Post-SUSFS sed safeguards for task_mmu.c 'goto show_pad' handling
- if ( ( [[ "${{ inputs.android_version }}" == "android12" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && (( $ACTUAL_SUBLEVEL <= 209 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && [[ "${{ inputs.os_patch_level }}" != "2024-05" ]] && (( $ACTUAL_SUBLEVEL <= 209 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && [[ "${{ inputs.os_patch_level }}" != "2024-05" ]] && (( $ACTUAL_SUBLEVEL <= 148 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && [[ "${{ inputs.os_patch_level }}" != "2024-05" ]] && (( $ACTUAL_SUBLEVEL <= 148 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "6.1" ]] && [[ "${{ inputs.os_patch_level }}" != "2024-05" ]] && (( $ACTUAL_SUBLEVEL <= 75 )) ) ); then
- sed -i -e 's/goto show_pad;/return 0;/' ./fs/proc/task_mmu.c
- fi
- # Apply additional SUSFS patches for Android 13 5.15 compatibility
- if [[ "${{ inputs.android_version }}" == "android13" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( ${{ inputs.sub_level }} <= 41 )); then
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_fdinfo.c.patch ./
- patch -p1 < fix_fdinfo.c.patch || true
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_namespace.c.patch ./
- patch -p1 < fix_namespace.c.patch || true
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_open.c.patch ./
- patch -p1 < fix_open.c.patch || true
- sed -i 's/i_uid_into_mnt(i_user_ns(inode), inode)/i_uid_into_mnt(inode->i_sb->s_user_ns, inode)/g' fs/susfs.c
- fi
- # Use ACTUAL_SUBLEVEL for LTS or actual kernel sublevel if available
- if ( [[ "${{ inputs.android_version }}" == "android12" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && (( $ACTUAL_SUBLEVEL <= 43 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "6.1" ]] && (( $ACTUAL_SUBLEVEL >= 145 )) ) \
- || ( [[ "${{ inputs.android_version }}" == "android15" ]] && [[ "${{ inputs.kernel_version }}" == "6.6" ]] && (( $ACTUAL_SUBLEVEL >= 98 )) ); then
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/1_fix_base.c.patch ./
- patch -p1 < 1_fix_base.c.patch || true
- fi
- if [[ "${{ inputs.android_version }}" == "android12" ]] && [[ "${{ inputs.kernel_version }}" == "5.10" ]] && (( $ACTUAL_SUBLEVEL <= 43 )); then
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/2_fix_base.c.patch ./
- patch -p1 < 2_fix_base.c.patch || true
- fi
- if ( [[ "${{ inputs.android_version }}" == "android15" ]] && [[ "${{ inputs.kernel_version }}" == "6.6" ]] && (( $ACTUAL_SUBLEVEL <= 58 )) ); then
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_task_mmu.c.patch ./
- patch -p1 < fix_task_mmu.c.patch || true
- fi
- # Apply KSU integration patches
- cd ../Wild_KSU
- cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch .
- patch -p1 < 10_enable_susfs_for_ksu.patch || true
-
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_core_hook.c.patch ./
- patch -p1 < fix_core_hook.c.patch
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_sucompat.c.patch ./
- patch -p1 < fix_sucompat.c.patch
- cp ../../kernel_patches/wild/susfs_fix_patches/v${SUSFS_VERSION}/fix_kernel_compat.c.patch ./
- patch -p1 < fix_kernel_compat.c.patch
- - name: Apply Hooks Patches
- run: |
- cd "$CONFIG/common"
- cp ../../kernel_patches/wild/hooks/scope_min_manual_hooks_v1.4.patch ./
- patch -p1 -F 3 < scope_min_manual_hooks_v1.4.patch
- - name: Scan and collect patch rejects
- if: ${{ always() }}
- run: |
- set -e
- CONFIG_DIR="$CONFIG"
- REJECTS_DIR="$GITHUB_WORKSPACE/patch-rejects"
- mkdir -p "$REJECTS_DIR"
- # Find all .rej files under the configuration directory
- mapfile -t REJS < <(find "$CONFIG_DIR" -type f -name '*.rej')
- REJ_COUNT=${#REJS[@]}
- echo "Found $REJ_COUNT .rej files under $CONFIG_DIR"
- echo "REJ_COUNT=$REJ_COUNT" >> $GITHUB_ENV
- if [ "$REJ_COUNT" -gt 0 ]; then
- for REJ in "${REJS[@]}"; do
- # Relative path from $CONFIG
- REL="${REJ#"$CONFIG_DIR"/}"
- DEST="$REJECTS_DIR/$REL"
- mkdir -p "$(dirname "$DEST")"
- cp "$REJ" "$DEST"
- # Copy the associated original file alongside the .rej
- ORIG="${REJ%.rej}"
- if [ -f "$ORIG" ]; then
- ORIG_DEST="$REJECTS_DIR/${REL%.rej}"
- mkdir -p "$(dirname "$ORIG_DEST")"
- cp "$ORIG" "$ORIG_DEST"
- fi
- echo "$REL" >> "$REJECTS_DIR/index.txt"
- done
- fi
- - name: Add BBG
- run: |
- cd "$CONFIG"
- echo "Adding BBG..."
- wget -O- https://github.com/vc-teahouse/Baseband-guard/raw/main/setup.sh | bash
- echo "CONFIG_BBG=y" >> common/arch/arm64/configs/gki_defconfig
- sed -i '/^config LSM$/,/^help$/{ /^[[:space:]]*default/ { /baseband_guard/! s/lockdown/lockdown,baseband_guard/ } }' common/security/Kconfig
- - name: Apply Module Check Bypass
- if: ${{ matrix.apply_bypass == 'bypass' }}
- run: |
- if [[ "${{ inputs.kernel_version }}" == "6.1" || "${{ inputs.kernel_version }}" == "6.6" ]]; then
- cd "$CONFIG/common/kernel/module"
- sed -i '/bad_version:/{:a;n;/return 0;/{s/return 0;/return 1;/;b};ba}' version.c
- else
- cd "$CONFIG/common/kernel"
- sed -i '/bad_version:/{:a;n;/return 0;/{s/return 0;/return 1;/;b};ba}' module.c
- fi
- - name: Fix WiFi and Bluetooth on Samsung 6.6 GKI devices
- if: ${{ ( inputs.kernel_version == '6.6' ) }}
- run: |
- SYMBOL_LIST=$CONFIG/common/android/abi_gki_aarch64_galaxy
- echo "kdp_set_cred_non_rcu" >> $SYMBOL_LIST
- echo "kdp_usecount_dec_and_test" >> $SYMBOL_LIST
- echo "kdp_usecount_inc" >> $SYMBOL_LIST
-
- cd $CONFIG/common
- PATCH="../../kernel_patches/samsung/min_kdp/add-min_kdp-symbols.patch"
- if patch -p1 --dry-run < $PATCH; then
- patch -p1 --no-backup-if-mismatch < $PATCH
- fi
-
- cd drivers
- cp "../../../kernel_patches/samsung/min_kdp/min_kdp.c" min_kdp.c
- echo "obj-y += min_kdp.o" >> Makefile
- - name: Set Kernel Configuration Variables
- run: |
- cd "$CONFIG"
- echo "Initializing kernel configuration..."
- echo "DEFCONFIG=./common/arch/arm64/configs/gki_defconfig" >> $GITHUB_ENV
-
- # Remove check_defconfig
- sed -i 's/check_defconfig//' ./common/build.config.gki
- - name: Configure KernelSU Core
- run: |
- cd "$CONFIG"
- # KernelSU Configuration
- echo "# KernelSU Configuration" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_KPROBES_HOOK=n" >> "${{ env.DEFCONFIG }}"
- - name: Configure Mountify Support
- run: |
- cd "$CONFIG"
- # Mountify Support
- echo "# Mountify Support" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TMPFS_XATTR=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TMPFS_POSIX_ACL=y" >> "${{ env.DEFCONFIG }}"
- - name: Configure Networking
- run: |
- cd "$CONFIG"
- # Networking Configuration
- echo "# Networking Configuration" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_NF_TARGET_TTL=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP6_NF_TARGET_HL=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP6_NF_MATCH_HL=y" >> "${{ env.DEFCONFIG }}"
- - name: Configure TCP Congestion Control
- run: |
- cd "$CONFIG"
- # BBR TCP Congestion Control
- echo "# BBR TCP Congestion Control" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TCP_CONG_ADVANCED=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TCP_CONG_BBR=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_NET_SCH_FQ=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TCP_CONG_BIC=n" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TCP_CONG_WESTWOOD=n" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_TCP_CONG_HTCP=n" >> "${{ env.DEFCONFIG }}"
- - name: Configure IPSet Support
- run: |
- cd "$CONFIG"
- # IPSet support
- echo "# IPSet Support" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_MAX=65534" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_BITMAP_IP=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_BITMAP_IPMAC=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_BITMAP_PORT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IP=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IPMARK=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IPPORT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IPPORTIP=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IPPORTNET=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_IPMAC=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_MAC=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_NETPORTNET=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_NET=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_NETNET=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_NETPORT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_HASH_NETIFACE=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_IP_SET_LIST_SET=y" >> "${{ env.DEFCONFIG }}"
- - name: Configure SUSFS
- run: |
- cd "$CONFIG"
- # SUSFS Configuration
- echo "# SUSFS Configuration" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS=y" >> "${{ env.DEFCONFIG }}"
- echo "#CONFIG_KSU_SUSFS_HAS_MAGIC_MOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SUS_PATH=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SUS_MOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_TRY_UMOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_KSU_DEFAULT_MOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_AUTO_ADD_SUS_BIND_MOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_AUTO_ADD_TRY_UMOUNT_FOR_BIND_MOUNT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SUS_KSTAT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SUS_OVERLAYFS=n" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SPOOF_UNAME=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_ENABLE_LOG=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> "${{ env.DEFCONFIG }}"
- - name: Configure SND
- if: true
- run: |
- cd "$CONFIG"
- # Sound Configuration
- echo "# Sound Configuration" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_DRIVERS=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_PCM=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_TIMER=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_DYNAMIC_MINORS=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_PROC_FS=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_SND_ALOOP=m" >> "${{ env.DEFCONFIG }}"
-
- # Add snd-aloop.ko to modules list
- echo "sound/drivers/snd-aloop.ko" >> common/android/gki_aarch64_modules
- if [[ -f common/modules.bzl ]]; then
- # Insert before the closing bracket of _COMMON_GKI_MODULES_LIST
- echo "snd-aloop injection: adding to module list"
- sed -i '/_COMMON_GKI_MODULES_LIST = \[/,/^[[:space:]]*\]/{/^[[:space:]]*\]$/i\ "sound/drivers/snd-aloop.ko",
- }' common/modules.bzl
-
- # Verify the injection was successful
- if grep -q '"sound/drivers/snd-aloop.ko"' common/modules.bzl; then
- echo "✓ snd-aloop injection: successfully added to module list"
- else
- echo "✗ snd-aloop injection: failed to add to module list"
- exit 1
- fi
- fi
-
- # Add symbols to abi_gki_aarch64
- #SYMBOL_LIST=common/android/abi_gki_aarch64
- #cat Wild_KSU/kernel/export_symbol.txt | awk '{sub("[ \t]+","");print " "$0}' >> $SYMBOL_LIST
- # ABI compare bypass per kernel/android version
- # Edit each block as needed per version
- if [[ "${{ inputs.android_version }}" == "android12" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
- sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/abi/compare_to_symbol_list
- elif [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.10" ]]; then
- sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
- elif [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
- sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
- elif [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "5.15" ]]; then
- perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
- elif [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then
- perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
- elif [[ "${{ inputs.android_version }}" == "android15" && "${{ inputs.kernel_version }}" == "6.6" ]]; then
- perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
- fi
- - name: Configure Build Optimization
- run: |
- cd "$CONFIG"
- # Build Optimization Configuration
- echo "# Build Optimization Configuration" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_LTO_CLANG_THIN=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_LTO_CLANG=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=n" >> "${{ env.DEFCONFIG }}"
- echo "CONFIG_OPTIMIZE_INLINING=y" >> "${{ env.DEFCONFIG }}"
- - name: Change Kernel Name
- run: |
- cd "$CONFIG"
- #Add Wild to Kernel Version
- sed -i '$s|echo "\$res"|echo "\$res-Wild"|' ./common/scripts/setlocalversion
- #Set Kernel Timestamp
- perl -pi -e 's{UTS_VERSION="\$\(echo \$UTS_VERSION \$CONFIG_FLAGS \$TIMESTAMP \| cut -b -\$UTS_LEN\)"}{UTS_VERSION="#1 SMP PREEMPT Sun Apr 20 04:20:00 UTC 2025"}' ./common/scripts/mkcompile_h
- if [ -f "build/build.sh" ]; then
- #Remove Dirty Flag
- sed -i 's/-dirty//' ./common/scripts/setlocalversion
- else
- #Remove Dirty Flag
- sed -i "/stable_scmversion_cmd/s/-maybe-dirty//g" ./build/kernel/kleaf/impl/stamp.bzl
- #Remove Abi Exports and Error
- rm -rf ./common/android/abi_gki_protected_exports_*
- perl -pi -e 's/^\s*"protected_exports_list"\s*:\s*"android\/abi_gki_protected_exports_aarch64",\s*$//;' ./common/BUILD.bazel
- fi
- - name: Set file name
- run: |
- ARTIFACT_BASE="${{ inputs.kernel_version }}.$ACTUAL_SUBLEVEL-${{ inputs.android_version }}-${{ inputs.os_patch_level }}-${{ matrix.apply_bypass == 'bypass' && 'Bypass' || 'Normal' }}"
- echo "ARTIFACT_BASE=$ARTIFACT_BASE" >> $GITHUB_ENV
- echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
- - name: Build
- run : |
- set -e
- set -x
- cd "$CONFIG"
- echo "Building the kernel..."
- if [ -f "build/build.sh" ]; then
- LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh || exit 1
- else
- tools/bazel build --config=fast --lto=thin //common:kernel_aarch64_dist || exit 1
- fi
- - name: Prepare AnyKernel3
- run: |
- # Copy Image from normal build locations
- if [ -f "./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image" ]; then
- cp ./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image AnyKernel3/Image
- elif [ -f "./$CONFIG/bazel-bin/common/kernel_aarch64/Image" ]; then
- cp ./$CONFIG/bazel-bin/common/kernel_aarch64/Image AnyKernel3/Image
- else
- echo "Error: Image file not found in any expected location"
- exit 1
- fi
- - name: Copy snd-aloop module for Android 12-13
- if: inputs.android_version == 'android12' || inputs.android_version == 'android13'
- run: |
- mkdir -p AnyKernel3/modules/data/adb/lkm
- cp "./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/snd-aloop.ko" AnyKernel3/modules/data/adb/lkm/
- - name: Copy snd-aloop module for Android 14-15
- if: inputs.android_version == 'android14' || inputs.android_version == 'android15'
- run: |
- mkdir -p AnyKernel3/modules/data/adb/lkm
- cp "./$CONFIG/bazel-bin/common/kernel_aarch64/snd-aloop.ko" AnyKernel3/modules/data/adb/lkm/
- - name: Search for Kernel Modules
- run: |
- echo "Searching for kernel modules (.ko files)..."
-
- # Function to scan for modules (search only)
- scan_modules() {
- local search_dir="$1"
- local module_count=0
-
- if [ -d "$search_dir" ]; then
- echo "Scanning directory: $search_dir"
-
- # Find all .ko files and report their locations
- while IFS= read -r -d '' module_file; do
- if [ -f "$module_file" ]; then
- module_name=$(basename "$module_file")
- echo "Found module: $module_name in $(dirname "$module_file")"
- ((module_count++))
- fi
- done < <(find "$search_dir" -name "*.ko" -type f -print0 2>/dev/null)
- fi
-
- return $module_count
- }
-
- # Scan common build output directories
- total_modules=0
-
- # Scan bazel-bin directory
- if scan_modules "./$CONFIG/bazel-bin"; then
- total_modules=$((total_modules + $?))
- fi
-
- # Scan out directory
- if scan_modules "./$CONFIG/out"; then
- total_modules=$((total_modules + $?))
- fi
-
- # Scan dist directory specifically
- if scan_modules "./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist"; then
- total_modules=$((total_modules + $?))
- fi
-
- # Look for snd-aloop.ko specifically
- echo "Searching specifically for snd-aloop.ko..."
- snd_aloop_found=$(find ./$CONFIG -name "snd-aloop.ko" -type f 2>/dev/null | head -1)
- if [ -n "$snd_aloop_found" ]; then
- echo "Found snd-aloop.ko at: $snd_aloop_found"
- else
- echo "snd-aloop.ko not found"
- fi
-
- echo "Total kernel modules found: $total_modules"
- - name: Create Bootimgs Folder and Copy Images for Android 12/13
- if: ${{ inputs.android_version == 'android12' || inputs.android_version == 'android13' }}
- run: |
- mkdir bootimgs
- cp ./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image ./bootimgs
- cp ./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image.lz4 ./bootimgs
- cp ./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image ./${{ env.FILE_NAME }}-Image
- cp ./$CONFIG/out/${{ inputs.android_version }}-${{ inputs.kernel_version }}/dist/Image.lz4 ./${{ env.FILE_NAME }}-Image.lz4
- # Create gzip of the Image file
- gzip -n -k -f -9 ./${{ env.FILE_NAME }}-Image > ./${{ env.FILE_NAME }}-Image.gz
- gzip -n -k -f -9 ./bootimgs/Image > ./bootimgs/Image.gz
- - name: Create Bootimgs Folder and Copy Images for Android 14/15
- if: ${{ inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
- run: |
- mkdir bootimgs
- cp ./$CONFIG/bazel-bin/common/kernel_aarch64/Image ./bootimgs
- cp ./$CONFIG/bazel-bin/common/kernel_aarch64/Image.lz4 ./bootimgs
- cp ./$CONFIG/bazel-bin/common/kernel_aarch64/Image ./${{ env.FILE_NAME }}-Image
- cp ./$CONFIG/bazel-bin/common/kernel_aarch64/Image.lz4 ./${{ env.FILE_NAME }}-Image.lz4
- # Create gzip of the Image file
- gzip -n -k -f -9 ./${{ env.FILE_NAME }}-Image > ./${{ env.FILE_NAME }}-Image.gz
- gzip -n -k -f -9 ./bootimgs/Image > ./bootimgs/Image.gz
- - name: Android 12 boot image build script
- if: ${{ inputs.android_version == 'android12' }}
- run: |
- cd bootimgs
-
- GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${{ inputs.os_patch_level }}"_r1.zip
- FALLBACK_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-2023-01_r1.zip
-
- # Check if the GKI URL is available
- status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null)
-
- if [ "$status" = "200" ]; then
- curl -Lo gki-kernel.zip "$GKI_URL"
- else
- curl -Lo gki-kernel.zip "$FALLBACK_URL"
- fi
-
- # Unzip the downloaded kernel and remove the zip
- unzip gki-kernel.zip && rm gki-kernel.zip
-
- FULL_PATH=$(pwd)/boot-5.10.img
- $UNPACK_BOOTIMG --boot_img="$FULL_PATH"
-
- $MKBOOTIMG --header_version 4 --kernel Image --output boot.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${{ inputs.os_patch_level }}"
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot.img ../${{ env.FILE_NAME }}-boot.img
-
- $MKBOOTIMG --header_version 4 --kernel Image.gz --output boot-gz.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${{ inputs.os_patch_level }}"
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot-gz.img ../${{ env.FILE_NAME }}-boot-gz.img
-
- $MKBOOTIMG --header_version 4 --kernel Image.lz4 --output boot-lz4.img --ramdisk out/ramdisk --os_version 12.0.0 --os_patch_level "${{ inputs.os_patch_level }}"
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot-lz4.img ../${{ env.FILE_NAME }}-boot-lz4.img
- - name: Android 13/14/15 boot image build script
- if: ${{ inputs.android_version == 'android13' || inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
- run: |
- cd bootimgs
-
- echo "Building boot.img"
- $MKBOOTIMG --header_version 4 --kernel Image --output boot.img
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot.img ../${{ env.FILE_NAME }}-boot.img
-
- echo "Building boot-gz.img"
- $MKBOOTIMG --header_version 4 --kernel Image.gz --output boot-gz.img
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-gz.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot-gz.img ../${{ env.FILE_NAME }}-boot-gz.img
-
- echo "Building boot-lz4.img"
- $MKBOOTIMG --header_version 4 --kernel Image.lz4 --output boot-lz4.img
- $AVBTOOL add_hash_footer --partition_name boot --partition_size $((64 * 1024 * 1024)) --image boot-lz4.img --algorithm SHA256_RSA2048 --key $BOOT_SIGN_KEY_PATH
- cp ./boot-lz4.img ../${{ env.FILE_NAME }}-boot-lz4.img
- - name: Upload AnyKernel3 Artifacts
- id: upload_ak3
- uses: actions/upload-artifact@v4
- with:
- name: ${{ env.FILE_NAME }}-AnyKernel3
- path: |
- ./AnyKernel3/**
- compression-level: 9
- - name: Extra Artifacts
- if: ${{ always() }}
- id: upload_misc
- uses: actions/upload-artifact@v4
- with:
- name: ${{ env.FILE_NAME }}-Misc
- path: |
- ${{ env.FILE_NAME }}-Image
- ${{ env.FILE_NAME }}-Image.gz
- ${{ env.FILE_NAME }}-Image.lz4
- ${{ env.FILE_NAME }}-boot.img
- ${{ env.FILE_NAME }}-boot-gz.img
- ${{ env.FILE_NAME }}-boot-lz4.img
- patch-rejects/**
- build_summary.md
- if-no-files-found: ignore
- compression-level: 9
-
- - name: Generate Build Summary
- if: ${{ always() }}
- run: |
- # Create build summary file for inclusion in Misc artifact
- echo "# Kernel Build Summary" > build_summary.md
-
- # Add build variant header
- echo "## ${{ env.FILE_NAME }}" >> build_summary.md
-
- # Add build info
- echo "## Build Information" >> build_summary.md
- echo "- **Android Version**: ${{ inputs.android_version }}" >> build_summary.md
- echo "- **Kernel Version**: ${{ inputs.kernel_version }}.${{ inputs.sub_level }}" >> build_summary.md
- echo "- **BBG**: Installed" >> build_summary.md
- echo "- **Bypass Mode**: ${{ matrix.apply_bypass }}" >> build_summary.md
- echo "" >> build_summary.md
- # Get Wild_KSU commit
- if [ -d "$CONFIG/Wild_KSU" ]; then
- cd "$CONFIG/Wild_KSU"
- WKSU_COMMIT=$(git rev-parse HEAD)
- WKSU_URL="https://github.com/WildKernels/Wild_KSU/commit/$WKSU_COMMIT"
- echo "- **Wild_KSU**: [$WKSU_COMMIT]($WKSU_URL)" >> "$GITHUB_WORKSPACE/build_summary.md"
- cd "$GITHUB_WORKSPACE"
- else
- echo "- **Wild_KSU**: not present" >> build_summary.md
- fi
-
- # Get Baseband-guard commit
- if [ -d "$CONFIG/Baseband-guard" ]; then
- cd "$CONFIG/Baseband-guard"
- BBG_COMMIT=$(git rev-parse HEAD)
- BBG_URL="https://github.com/vc-teahouse/Baseband-guard/commit/$BBG_COMMIT"
- echo "- **Baseband-guard**: [$BBG_COMMIT]($BBG_URL)" >> "$GITHUB_WORKSPACE/build_summary.md"
- cd "$GITHUB_WORKSPACE"
- else
- echo "- **Baseband-guard**: not present" >> build_summary.md
- fi
-
- # Get SUSFS4KSU commit
- if [ -d "$GITHUB_WORKSPACE/susfs4ksu" ]; then
- cd "$GITHUB_WORKSPACE/susfs4ksu"
- SUSFS_COMMIT=$(git rev-parse HEAD)
- SUSFS_URL="https://gitlab.com/simonpunk/susfs4ksu/-/commit/$SUSFS_COMMIT"
- echo "- **SUSFS4KSU (v1.5.12)**: [$SUSFS_COMMIT]($SUSFS_URL)" >> "$GITHUB_WORKSPACE/build_summary.md"
- cd "$GITHUB_WORKSPACE"
- else
- echo "- **SUSFS4KSU (v1.5.12)**: not present" >> build_summary.md
- fi
- echo "" >> build_summary.md
-
- # Add artifact summary with presence verification
- echo "## Build Artifacts" >> build_summary.md
- # Verify AnyKernel3 contents - check if kernel Image was actually copied (indicates successful build)
- if [ -d "AnyKernel3" ] && [ -f "AnyKernel3/Image" ]; then
- AK3_STATUS="✅"
- else
- AK3_STATUS="❌"
- fi
- echo "- **AnyKernel3**: $AK3_STATUS ${{ env.FILE_NAME }}-AnyKernel3" >> build_summary.md
- echo "### Misc (uploaded files)" >> build_summary.md
- FILES_PRESENT=0
- for f in "${{ env.FILE_NAME }}-Image" "${{ env.FILE_NAME }}-Image.gz" "${{ env.FILE_NAME }}-Image.lz4" "${{ env.FILE_NAME }}-boot.img" "${{ env.FILE_NAME }}-boot-gz.img" "${{ env.FILE_NAME }}-boot-lz4.img"; do
- if [ -f "$f" ]; then FILES_PRESENT=$((FILES_PRESENT+1)); fi
- done
- if [ "$FILES_PRESENT" -gt 0 ]; then
- MISC_STATUS="✅"
- else
- MISC_STATUS="❌"
- fi
- echo "- **Set**: $MISC_STATUS ${{ env.FILE_NAME }}-Misc" >> build_summary.md
- if [ "$MISC_STATUS" = "✅" ]; then
- echo " Included:" >> build_summary.md
- for f in "${{ env.FILE_NAME }}-Image" "${{ env.FILE_NAME }}-Image.gz" "${{ env.FILE_NAME }}-Image.lz4" "${{ env.FILE_NAME }}-boot.img" "${{ env.FILE_NAME }}-boot-gz.img" "${{ env.FILE_NAME }}-boot-lz4.img"; do
- if [ -f "$f" ]; then
- echo " - $f" >> build_summary.md
- fi
- done
- fi
- echo "### Diagnostics" >> build_summary.md
- echo "- **Rejected Patches**: ${{ env.FILE_NAME }}-Rejected-Patches" >> build_summary.md
- if [ -f patch-rejects/index.txt ]; then
- if [ -s patch-rejects/index.txt ]; then
- echo " Rejected files:" >> build_summary.md
- while IFS= read -r line; do
- echo " - $line" >> build_summary.md
- done < patch-rejects/index.txt
- else
- echo " Rejected file list is empty." >> build_summary.md
- fi
- else
- echo " No rejected patches found." >> build_summary.md
- fi
|