|
@@ -6,27 +6,22 @@ permissions:
|
|
|
on:
|
|
on:
|
|
|
workflow_call:
|
|
workflow_call:
|
|
|
inputs:
|
|
inputs:
|
|
|
- android_version:
|
|
|
|
|
- required: true
|
|
|
|
|
- type: string
|
|
|
|
|
- kernel_version:
|
|
|
|
|
|
|
+ branch:
|
|
|
required: true
|
|
required: true
|
|
|
type: string
|
|
type: string
|
|
|
- sub_level:
|
|
|
|
|
|
|
+ android_version:
|
|
|
required: true
|
|
required: true
|
|
|
type: string
|
|
type: string
|
|
|
- os_patch_level:
|
|
|
|
|
|
|
+ kernel_version:
|
|
|
required: true
|
|
required: true
|
|
|
type: string
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
|
- build-gki:
|
|
|
|
|
- name: "${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.android_version }}-${{ inputs.os_patch_level }} (${{ matrix.apply_bypass }})"
|
|
|
|
|
|
|
+ build-samsung-gki:
|
|
|
|
|
+ name: "${{ inputs.branch }}-${{ inputs.kernel_version }}-${{ inputs.android_version }}"
|
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
strategy:
|
|
strategy:
|
|
|
fail-fast: false
|
|
fail-fast: false
|
|
|
- matrix:
|
|
|
|
|
- apply_bypass: ["normal", "bypass"]
|
|
|
|
|
|
|
|
|
|
steps:
|
|
steps:
|
|
|
- name: Check Initial Disk Space
|
|
- name: Check Initial Disk Space
|
|
@@ -48,38 +43,11 @@ jobs:
|
|
|
- name: Set CONFIG Environment Variable
|
|
- name: Set CONFIG Environment Variable
|
|
|
run: |
|
|
run: |
|
|
|
# Set CONFIG dynamically based on inputs values
|
|
# Set CONFIG dynamically based on inputs values
|
|
|
- CONFIG="${{ inputs.android_version }}-${{ inputs.kernel_version }}-${{ inputs.sub_level }}"
|
|
|
|
|
|
|
+ CONFIG="${{ inputs.branch }}-${{ inputs.android_version }}-${{ inputs.kernel_version }}
|
|
|
|
|
|
|
|
# Set CONFIG as an environment variable for future steps
|
|
# Set CONFIG as an environment variable for future steps
|
|
|
echo "CONFIG=$CONFIG" >> $GITHUB_ENV
|
|
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
|
|
- name: Clone AnyKernel3 and Other Dependencies
|
|
|
run: |
|
|
run: |
|
|
|
ANYKERNEL_BRANCH="gki-2.0"
|
|
ANYKERNEL_BRANCH="gki-2.0"
|
|
@@ -88,23 +56,11 @@ jobs:
|
|
|
git clone https://github.com/WildKernels/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
|
|
git clone https://github.com/WildKernels/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
|
|
|
git clone https://github.com/WildKernels/kernel_patches.git
|
|
git clone https://github.com/WildKernels/kernel_patches.git
|
|
|
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
|
|
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
|
|
|
-
|
|
|
|
|
- - name: Initialize and Sync Kernel Source
|
|
|
|
|
|
|
+
|
|
|
|
|
+ - name: Clone AnyKernel3 and Other Dependencies
|
|
|
run: |
|
|
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
|
|
|
|
|
|
|
+ git clone https://github.com/WildKernels/Samsung_Kernels.git -b ${{ inputs.branch }} $CONFIG
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- name: Check Directory Space Usage
|
|
- name: Check Directory Space Usage
|
|
|
run: |
|
|
run: |
|
|
@@ -118,58 +74,6 @@ jobs:
|
|
|
cd "$CONFIG"
|
|
cd "$CONFIG"
|
|
|
du -BG -d 2 | sort -nr
|
|
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
|
|
- name: Add KernelSU
|
|
|
run: |
|
|
run: |
|
|
|
cd "$CONFIG"
|
|
cd "$CONFIG"
|
|
@@ -260,36 +164,6 @@ jobs:
|
|
|
cp ../../kernel_patches/wild/hooks/scope_min_manual_hooks_v1.4.patch ./
|
|
cp ../../kernel_patches/wild/hooks/scope_min_manual_hooks_v1.4.patch ./
|
|
|
patch -p1 -F 3 < 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
|
|
- name: Add BBG
|
|
|
run: |
|
|
run: |
|
|
|
cd "$CONFIG"
|
|
cd "$CONFIG"
|
|
@@ -298,35 +172,6 @@ jobs:
|
|
|
echo "CONFIG_BBG=y" >> common/arch/arm64/configs/gki_defconfig
|
|
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
|
|
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
|
|
- name: Set Kernel Configuration Variables
|
|
|
run: |
|
|
run: |
|
|
|
cd "$CONFIG"
|
|
cd "$CONFIG"
|
|
@@ -422,64 +267,6 @@ jobs:
|
|
|
echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> "${{ env.DEFCONFIG }}"
|
|
echo "CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS=y" >> "${{ env.DEFCONFIG }}"
|
|
|
echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> "${{ 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 or _COMMON_GKI_MODULES_LIST
|
|
|
|
|
- echo "snd-aloop injection: adding to module list"
|
|
|
|
|
- if ( [[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "5.15" ]] && (( $ACTUAL_SUBLEVEL <= 110 )) && [[ "${{ inputs.os_patch_level }}" != "2023-09" ]] ) \
|
|
|
|
|
- || ( [[ "${{ inputs.android_version }}" == "android14" ]] && [[ "${{ inputs.kernel_version }}" == "6.1" ]] && (( $ACTUAL_SUBLEVEL <= 25 )) && [[ "${{ inputs.os_patch_level }}" != "2023-09" ]] ); then
|
|
|
|
|
- sed -i '/COMMON_GKI_MODULES_LIST = \[/,/^[[:space:]]*\]/{/^[[:space:]]*\]$/i\ "sound/drivers/snd-aloop.ko",
|
|
|
|
|
- }' common/modules.bzl
|
|
|
|
|
- else
|
|
|
|
|
- sed -i '/_COMMON_GKI_MODULES_LIST = \[/,/^[[:space:]]*\]/{/^[[:space:]]*\]$/i\ "sound/drivers/snd-aloop.ko",
|
|
|
|
|
- }' common/modules.bzl
|
|
|
|
|
- fi
|
|
|
|
|
-
|
|
|
|
|
- # 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
|
|
- name: Configure Build Optimization
|
|
|
run: |
|
|
run: |
|
|
|
cd "$CONFIG"
|
|
cd "$CONFIG"
|
|
@@ -511,7 +298,7 @@ jobs:
|
|
|
|
|
|
|
|
- name: Set file name
|
|
- name: Set file name
|
|
|
run: |
|
|
run: |
|
|
|
- ARTIFACT_BASE="${{ inputs.kernel_version }}.$ACTUAL_SUBLEVEL-${{ inputs.android_version }}-${{ inputs.os_patch_level }}-${{ matrix.apply_bypass == 'bypass' && 'Bypass' || 'Normal' }}"
|
|
|
|
|
|
|
+ ARTIFACT_BASE="${{ inputs.branch }}-${{ inputs.kernel_version }}-${{ inputs.android_version }}"
|
|
|
echo "ARTIFACT_BASE=$ARTIFACT_BASE" >> $GITHUB_ENV
|
|
echo "ARTIFACT_BASE=$ARTIFACT_BASE" >> $GITHUB_ENV
|
|
|
echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
|
|
echo "FILE_NAME=$ARTIFACT_BASE" >> $GITHUB_ENV
|
|
|
|
|
|
|
@@ -539,85 +326,6 @@ jobs:
|
|
|
exit 1
|
|
exit 1
|
|
|
fi
|
|
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
|
|
- name: Create Bootimgs Folder and Copy Images for Android 14/15
|
|
|
if: ${{ inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
|
|
if: ${{ inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
|
|
|
run: |
|
|
run: |
|
|
@@ -630,60 +338,6 @@ jobs:
|
|
|
# Create gzip of the Image file
|
|
# 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 ./${{ env.FILE_NAME }}-Image > ./${{ env.FILE_NAME }}-Image.gz
|
|
|
gzip -n -k -f -9 ./bootimgs/Image > ./bootimgs/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
|
|
cp ./boot-lz4.img ../${{ env.FILE_NAME }}-boot-lz4.img
|
|
|
|
|
|
|
|
- name: Upload AnyKernel3 Artifacts
|
|
- name: Upload AnyKernel3 Artifacts
|
|
@@ -694,25 +348,37 @@ jobs:
|
|
|
path: |
|
|
path: |
|
|
|
./AnyKernel3/**
|
|
./AnyKernel3/**
|
|
|
compression-level: 9
|
|
compression-level: 9
|
|
|
-
|
|
|
|
|
- - name: Extra Artifacts
|
|
|
|
|
|
|
+
|
|
|
|
|
+ - name: Scan and collect patch rejects
|
|
|
if: ${{ always() }}
|
|
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
|
|
|
|
|
-
|
|
|
|
|
|
|
+ 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: Generate Build Summary
|
|
- name: Generate Build Summary
|
|
|
if: ${{ always() }}
|
|
if: ${{ always() }}
|
|
|
run: |
|
|
run: |
|
|
@@ -809,4 +475,3 @@ jobs:
|
|
|
else
|
|
else
|
|
|
echo " No rejected patches found." >> build_summary.md
|
|
echo " No rejected patches found." >> build_summary.md
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|