|
|
@@ -1,15 +1,17 @@
|
|
|
-name: GKI Kernel Build
|
|
|
+name: Build Script
|
|
|
permissions:
|
|
|
- contents: write # Allow writing to repository contents (for pushing tags)
|
|
|
- actions: write # Allows triggering actions
|
|
|
+ contents: write
|
|
|
+ actions: write
|
|
|
|
|
|
on:
|
|
|
- workflow_call: # This allows this workflow to be called from another workflow
|
|
|
+ workflow_call:
|
|
|
inputs:
|
|
|
make_release:
|
|
|
required: true
|
|
|
type: boolean
|
|
|
- default: true
|
|
|
+ include_susfs:
|
|
|
+ required: true
|
|
|
+ type: boolean
|
|
|
android_version:
|
|
|
required: true
|
|
|
type: string
|
|
|
@@ -36,8 +38,8 @@ on:
|
|
|
type: string
|
|
|
|
|
|
jobs:
|
|
|
- build-kernel-kernelsu-susfs:
|
|
|
- runs-on: ubuntu-22.04
|
|
|
+ build-gki:
|
|
|
+ runs-on: ubuntu-latest
|
|
|
env:
|
|
|
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
|
|
|
CCACHE_NOHASHDIR: "true"
|
|
|
@@ -65,13 +67,12 @@ jobs:
|
|
|
|
|
|
echo "CONFIG set to: $CONFIG"
|
|
|
|
|
|
- # Install ccache
|
|
|
- name: Install ccache
|
|
|
run: sudo apt update && sudo apt install -y ccache
|
|
|
|
|
|
- name: Set up ccache
|
|
|
run: |
|
|
|
- mkdir -p ~/.cache/bazel # Ensure the directory exists
|
|
|
+ mkdir -p ~/.cache/bazel
|
|
|
ccache --version
|
|
|
ccache --max-size=2G
|
|
|
ccache --set-config=compression=true
|
|
|
@@ -94,7 +95,6 @@ jobs:
|
|
|
mkbootimg
|
|
|
key: toolchain-${{ runner.os }}-v1
|
|
|
|
|
|
- # Step 2: Download toolchain if cache was not found
|
|
|
- name: Download toolchain (if cache not found)
|
|
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
|
|
run: |
|
|
|
@@ -123,7 +123,6 @@ jobs:
|
|
|
|
|
|
- name: Install Repo
|
|
|
run: |
|
|
|
- # Install dependencies
|
|
|
mkdir -p ./git-repo
|
|
|
curl https://storage.googleapis.com/git-repo-downloads/repo > ./git-repo/repo
|
|
|
chmod a+rx ./git-repo/repo
|
|
|
@@ -133,27 +132,18 @@ jobs:
|
|
|
run: |
|
|
|
echo "Cloning AnyKernel3 and other dependencies..."
|
|
|
|
|
|
- # Define the branch names using the inputs values
|
|
|
+ ANYKERNEL_BRANCH="gki-2.0"
|
|
|
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/WildPlusKernel/AnyKernel3.git -b "gki-2.0"
|
|
|
+ git clone https://github.com/WildPlusKernel/AnyKernel3.git -b "$ANYKERNEL_BRANCH"
|
|
|
git clone https://gitlab.com/simonpunk/susfs4ksu.git -b "$SUSFS_BRANCH"
|
|
|
git clone https://github.com/WildPlusKernel/kernel_patches.git
|
|
|
|
|
|
- - 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
|
|
|
-
|
|
|
- echo "CONFIG set to: $CONFIG"
|
|
|
-
|
|
|
- name: Initialize and Sync Kernel Source
|
|
|
run: |
|
|
|
echo "Creating folder for configuration: $CONFIG..."
|
|
|
@@ -178,30 +168,13 @@ jobs:
|
|
|
$REPO --version
|
|
|
$REPO --trace sync -c -j$(nproc --all) --no-tags --fail-fast
|
|
|
|
|
|
- - name: Copy file
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- run: |
|
|
|
- cp -r $CONFIG source-clean-$CONFIG
|
|
|
-
|
|
|
- - name: Upload artifact
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
- with:
|
|
|
- name: source-clean-${{ env.CONFIG }}
|
|
|
- path: source-clean-${{ env.CONFIG }}
|
|
|
-
|
|
|
- - name: Remove file
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- run: |
|
|
|
- rm -rf source-clean-$CONFIG
|
|
|
-
|
|
|
- name: Determine the branch for KernelSU
|
|
|
run: |
|
|
|
if [[ "${{ inputs.kernelsu_branch }}" == "Stable" ]]; then
|
|
|
echo "BRANCH=-" >> $GITHUB_ENV
|
|
|
- elif [[ "${{ inputs.kernelsu_branch }}" == "Dev" && ( "${{ inputs.kernelsu_variant }}" == "Official" || "${{ inputs.kernelsu_variant }}" == "MKSU" ) ]]; then
|
|
|
+ elif [[ "${{ inputs.kernelsu_branch }}" == "Dev" && ( "${{ inputs.kernelsu_variant }}" == "KSU" || "${{ inputs.kernelsu_variant }}" == "MKSU" || "${{ inputs.kernelsu_variant }}" == "ALL" ) ]]; then
|
|
|
echo "BRANCH=-s main" >> $GITHUB_ENV
|
|
|
- elif [[ "${{ inputs.kernelsu_branch }}" == "Dev" && "${{ inputs.kernelsu_variant }}" == "Next" ]]; then
|
|
|
+ elif [[ "${{ inputs.kernelsu_branch }}" == "Dev" && "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]]; then
|
|
|
echo "BRANCH=-s next" >> $GITHUB_ENV
|
|
|
elif [[ "${{ inputs.kernelsu_branch }}" == "Other" && -n "${{ inputs.kernelsu_branch_other }}" ]]; then
|
|
|
echo "BRANCH=-s ${{ inputs.kernelsu_branch_other }}" >> $GITHUB_ENV
|
|
|
@@ -215,19 +188,19 @@ jobs:
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG"
|
|
|
|
|
|
- if [ "${{ inputs.kernelsu_variant }}" == "Official" ]; then
|
|
|
+ if [[ "${{ inputs.kernelsu_variant }}" == "KSU" || "${{ inputs.kernelsu_variant }}" == "ALL" ]]; then
|
|
|
echo "Adding KernelSU Official..."
|
|
|
- curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash $BRANCH
|
|
|
- elif [ "${{ inputs.kernelsu_variant }}" == "Next" ]; then
|
|
|
+ curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash ${{ env.BRANCH }}
|
|
|
+ elif [[ "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]]; then
|
|
|
echo "Adding KernelSU Next..."
|
|
|
- curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash $BRANCH
|
|
|
- #curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next-susfs/kernel/setup.sh" | bash -s next-susfs
|
|
|
- elif [ "${{ inputs.kernelsu_variant }}" == "MKSU" ]; then
|
|
|
+ curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash ${{ env.BRANCH }}
|
|
|
+ elif [[ "${{ inputs.kernelsu_variant }}" == "MKSU" ]]; then
|
|
|
echo "Adding KernelSU MKSU..."
|
|
|
- curl -LSs "https://raw.githubusercontent.com/5ec1cff/KernelSU/main/kernel/setup.sh" | bash $BRANCH
|
|
|
+ curl -LSs "https://raw.githubusercontent.com/5ec1cff/KernelSU/main/kernel/setup.sh" | bash ${{ env.BRANCH }}
|
|
|
fi
|
|
|
-
|
|
|
+
|
|
|
- name: Apply SUSFS Patches for KernelSU Variants
|
|
|
+ if: ${{ inputs.include_susfs == true }}
|
|
|
run: |
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG"
|
|
|
@@ -238,48 +211,60 @@ jobs:
|
|
|
cp ../susfs4ksu/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./common/
|
|
|
cp ../susfs4ksu/kernel_patches/fs/* ./common/fs/
|
|
|
cp ../susfs4ksu/kernel_patches/include/linux/* ./common/include/linux/
|
|
|
-
|
|
|
- if [ "${{ inputs.kernelsu_variant }}" == "Official" ]; then
|
|
|
+
|
|
|
+ if [[ "${{ inputs.kernelsu_variant }}" == "KSU" || "${{ inputs.kernelsu_variant }}" == "ALL" ]]; then
|
|
|
echo "Applying SUSFS patches for Official KernelSU..."
|
|
|
cd ./KernelSU
|
|
|
cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./
|
|
|
- patch -p1 --forward < 10_enable_susfs_for_ksu.patch
|
|
|
- elif [ "${{ inputs.kernelsu_variant }}" == "Next" ]; then
|
|
|
+ patch -p1 --forward --fuzz=3 < 10_enable_susfs_for_ksu.patch
|
|
|
+ elif [[ "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]]; then
|
|
|
echo "Applying SUSFS patches for KernelSU-Next..."
|
|
|
cd ./KernelSU-Next
|
|
|
cp ../../kernel_patches/next/0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch ./
|
|
|
- patch -p1 --forward < 0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch || true
|
|
|
- elif [ "${{ inputs.kernelsu_variant }}" == "MKSU" ]; then
|
|
|
+ patch -p1 --forward --fuzz=3 < 0001-kernel-patch-susfs-v1.5.5-to-KernelSU-Next-v1.0.5.patch || true
|
|
|
+ elif [[ "${{ inputs.kernelsu_variant }}" == "MKSU" ]]; then
|
|
|
echo "Applying SUSFS patches for MKSU..."
|
|
|
- cd ./KernelSU
|
|
|
+ cd ./KernelSU
|
|
|
cp ../../susfs4ksu/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./
|
|
|
- patch -p1 --forward < 10_enable_susfs_for_ksu.patch || true
|
|
|
-
|
|
|
- echo "Applying MKSU specific SUSFS patch..."
|
|
|
- cp ../../kernel_patches/mksu/mksu_susfs.patch ../KernelSU/
|
|
|
- patch -p1 < mksu_susfs.patch
|
|
|
- cp ../../kernel_patches/mksu/fix.patch ./KernelSU/
|
|
|
- patch -p1 < fix.patch
|
|
|
+ patch -p1 --forward --fuzz=3 < 10_enable_susfs_for_ksu.patch || true
|
|
|
|
|
|
+ if [ "${{ inputs.include_susfs }}" = "true" ]; then
|
|
|
+ echo "Applying MKSU specific SUSFS patch..."
|
|
|
+ cp ../../kernel_patches/mksu/mksu_susfs.patch ../KernelSU/
|
|
|
+ patch -p1 --fuzz=3 < mksu_susfs.patch
|
|
|
+ cp ../../kernel_patches/mksu/fix.patch ../KernelSU/
|
|
|
+ patch -p1 --fuzz=3 < fix.patch
|
|
|
+ fi
|
|
|
else
|
|
|
echo "Invalid KernelSU variant selected!"
|
|
|
exit 1
|
|
|
fi
|
|
|
-
|
|
|
- # Change to common directory and apply common SUSFS patch
|
|
|
+
|
|
|
cd ../common
|
|
|
- patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
|
|
|
+ patch -p1 --fuzz=3 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true
|
|
|
+
|
|
|
+ - name: Add All Managers
|
|
|
+ if: ${{ inputs.kernelsu_variant == 'ALL' }}
|
|
|
+ run: |
|
|
|
+ cd "$CONFIG"
|
|
|
+ if [ "${{ inputs.include_susfs }}" = "true" ]; then
|
|
|
+ cp ../kernel_patches/apk_sign.c_fix.patch ./
|
|
|
+ patch -p1 --fuzz=3 < apk_sign.c_fix.patch
|
|
|
+ else
|
|
|
+ cp ../kernel_patches/no-susfs_apk_sign.c_fix.patch ./
|
|
|
+ patch -p1 --fuzz=3 < no-susfs_apk_sign.c_fix.patch
|
|
|
+ fi
|
|
|
|
|
|
- name: Apply New Hooks Patches
|
|
|
run: |
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG/common"
|
|
|
-
|
|
|
- #if [ "${{ inputs.kernelsu_variant }}" == "Official" ]; then
|
|
|
+
|
|
|
+ #if [ "${{ inputs.kernelsu_variant }}" == "KSU" || "${{ inputs.kernelsu_variant }}" == "ALL" ]; then
|
|
|
# echo "Applying hooks for Official KernelSU..."
|
|
|
# cp ../../kernel_patches/hooks/ksu_hooks.patch ./
|
|
|
# patch -p1 -F 3 < ksu_hooks.patch
|
|
|
- if [ "${{ inputs.kernelsu_variant }}" == "Next" ]; then
|
|
|
+ if [ "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]; then
|
|
|
echo "Applying hooks for KernelSU-Next..."
|
|
|
cp ../../kernel_patches/next/syscall_hooks.patch ./
|
|
|
patch -p1 -F 3 < syscall_hooks.patch
|
|
|
@@ -288,28 +273,52 @@ jobs:
|
|
|
# cp ../../kernel_patches/hooks/ksu_hooks.patch ./
|
|
|
# patch -p1 -F 3 < ksu_hooks.patch
|
|
|
fi
|
|
|
-
|
|
|
+
|
|
|
- name: Apply Hide Stuff Patches
|
|
|
run: |
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG/common"
|
|
|
- # Apply additional patch
|
|
|
cp ../../kernel_patches/69_hide_stuff.patch ./
|
|
|
patch -p1 -F 3 < 69_hide_stuff.patch
|
|
|
-
|
|
|
- - name: Add SUSFS Configuration Settings
|
|
|
+
|
|
|
+ - name: Add Configuration Settings
|
|
|
run: |
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG"
|
|
|
-
|
|
|
echo "Adding configuration settings to gki_defconfig..."
|
|
|
|
|
|
# Add KSU configuration settings
|
|
|
echo "CONFIG_KSU=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
|
|
|
- if [ "${{ inputs.kernelsu_variant }}" == "Next" ]; then
|
|
|
+ if [ "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]; then
|
|
|
echo "CONFIG_KSU_WITH_KPROBES=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
fi
|
|
|
+
|
|
|
+ # Add additional tmpfs config setting
|
|
|
+ echo "CONFIG_TMPFS_XATTR=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_TMPFS_POSIX_ACL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+
|
|
|
+ # Add additional config setting
|
|
|
+ echo "CONFIG_IP_NF_TARGET_TTL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_IP6_NF_TARGET_HL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_IP6_NF_MATCH_HL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+
|
|
|
+ # Add BBR Config
|
|
|
+ echo "CONFIG_TCP_CONG_ADVANCED=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_TCP_CONG_BBR=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_NET_SCH_FQ=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_TCP_CONG_BIC=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_TCP_CONG_WESTWOOD=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+ echo "CONFIG_TCP_CONG_HTCP=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
+
|
|
|
+ # Remove check_defconfig
|
|
|
+ sed -i 's/check_defconfig//' ./common/build.config.gki
|
|
|
+
|
|
|
+ - name: Add SUSFS Configuration Settings
|
|
|
+ if: ${{ inputs.include_susfs == false }}
|
|
|
+ run: |
|
|
|
+ echo "Changing to configuration directory: $CONFIG..."
|
|
|
+ cd "$CONFIG"
|
|
|
|
|
|
# Add SUSFS configuration settings
|
|
|
echo "CONFIG_KSU_SUSFS=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
@@ -328,50 +337,20 @@ jobs:
|
|
|
echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
|
|
|
- if [ "${{ inputs.kernelsu_variant }}" == "Next" ]; then
|
|
|
+ if [ "${{ inputs.kernelsu_variant }}" == "KSU_NEXT" ]; then
|
|
|
echo "CONFIG_KSU_SUSFS_SUS_SU=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
else
|
|
|
echo "CONFIG_KSU_SUSFS_SUS_SU=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
fi
|
|
|
-
|
|
|
- # Add additional tmpfs config setting
|
|
|
- echo "CONFIG_TMPFS_XATTR=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_TMPFS_POSIX_ACL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
-
|
|
|
- # Add additional config setting
|
|
|
- echo "CONFIG_IP_NF_TARGET_TTL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_IP6_NF_TARGET_HL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_IP6_NF_MATCH_HL=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
-
|
|
|
- # Remove check_defconfig
|
|
|
- sed -i 's/check_defconfig//' ./common/build.config.gki
|
|
|
-
|
|
|
- - name: Config BBR
|
|
|
- #if: ${{ inputs.kernel_version != '6.6' }}
|
|
|
- run: |
|
|
|
- cd "$CONFIG/common"
|
|
|
- # Add bbrv3 config setting
|
|
|
- #cp ../../kernel_patches/bbr/tcp_bbr.c ./net/ipv4/
|
|
|
|
|
|
- cd ..
|
|
|
- echo "CONFIG_TCP_CONG_ADVANCED=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_TCP_CONG_BBR=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_NET_SCH_FQ=y" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_TCP_CONG_BIC=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_TCP_CONG_WESTWOOD=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
- echo "CONFIG_TCP_CONG_HTCP=n" >> ./common/arch/arm64/configs/gki_defconfig
|
|
|
-
|
|
|
- - name: Config Kernel Name
|
|
|
+ - name: Change Kernel Name
|
|
|
run: |
|
|
|
- echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd "$CONFIG"
|
|
|
|
|
|
- sed -i '$s|echo "\$res"|echo "\$res-Wild+"|' ./common/scripts/setlocalversion
|
|
|
-
|
|
|
- # Run perl command to modify UTS_VERSION
|
|
|
+ # modify UTS_VERSION
|
|
|
perl -pi -e 's{UTS_VERSION="\$\(echo \$UTS_VERSION \$CONFIG_FLAGS \$TIMESTAMP \| cut -b -\$UTS_LEN\)"}{UTS_VERSION="#1 SMP PREEMPT Sat Apr 20 04:20:00 UTC 2024"}' ./common/scripts/mkcompile_h
|
|
|
|
|
|
- echo "Building the kernel..."
|
|
|
+ sed -i '$s|echo "\$res"|echo "\$res-Wild+"|' ./common/scripts/setlocalversion
|
|
|
if [ -f "build/build.sh" ]; then
|
|
|
sed -i 's/-dirty//' ./common/scripts/setlocalversion
|
|
|
else
|
|
|
@@ -380,23 +359,6 @@ jobs:
|
|
|
sed -E -i '/^CONFIG_LOCALVERSION=/ s/(.*)"$/\1-Wild+"/' ./common/arch/arm64/configs/gki_defconfig
|
|
|
fi
|
|
|
|
|
|
- - name: Copy file
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- run: |
|
|
|
- cp -r $CONFIG source-patched-$CONFIG
|
|
|
-
|
|
|
- - name: Upload artifact
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
- with:
|
|
|
- name: source-patched-${{ env.CONFIG }}
|
|
|
- path: source-patched-${{ env.CONFIG }}
|
|
|
-
|
|
|
- - name: Remove file
|
|
|
- if: ${{ inputs.make_release == false }}
|
|
|
- run: |
|
|
|
- rm -rf source-patched-$CONFIG
|
|
|
-
|
|
|
- name: Build with retry
|
|
|
uses: nick-fields/retry@v3
|
|
|
with:
|
|
|
@@ -414,11 +376,10 @@ jobs:
|
|
|
tools/bazel build --disk_cache=/home/runner/.cache/bazel --config=fast --lto=thin //common:kernel_aarch64_dist || exit 1
|
|
|
fi
|
|
|
ccache --show-stats
|
|
|
-
|
|
|
- - name: Create Bootimgs Folder and Copy Images
|
|
|
+
|
|
|
+ - name: Create Bootimgs Folder and Copy Images for Android 12/13
|
|
|
if: ${{ inputs.android_version == 'android12' || inputs.android_version == 'android13' }}
|
|
|
run: |
|
|
|
- echo "Changing to configuration directory: $CONFIG..."
|
|
|
mkdir bootimgs
|
|
|
|
|
|
echo "Creating bootimgs folder and copying images..."
|
|
|
@@ -430,10 +391,9 @@ jobs:
|
|
|
# Create gzip of the Image file
|
|
|
gzip -n -k -f -9 ./Image > ./Image.gz
|
|
|
|
|
|
- - name: Create Bootimgs Folder and Copy Images
|
|
|
+ - name: Create Bootimgs Folder and Copy Images for Android 14/15
|
|
|
if: ${{ inputs.android_version == 'android14' || inputs.android_version == 'android15' }}
|
|
|
run: |
|
|
|
- echo "Changing to configuration directory: $CONFIG..."
|
|
|
mkdir bootimgs
|
|
|
|
|
|
echo "Creating bootimgs folder and copying images..."
|
|
|
@@ -449,39 +409,39 @@ jobs:
|
|
|
run: |
|
|
|
echo "Creating zip files for all formats..."
|
|
|
cd ./AnyKernel3
|
|
|
-
|
|
|
+
|
|
|
# Create and upload zip for each format
|
|
|
- ZIP_NAME="${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3.zip"
|
|
|
+ ZIP_NAME="${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3.zip"
|
|
|
echo "Creating zip file: $ZIP_NAME..."
|
|
|
mv ../Image ./Image
|
|
|
zip -r "../$ZIP_NAME" ./*
|
|
|
rm ./Image
|
|
|
-
|
|
|
- ZIP_NAME="${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3-lz4.zip"
|
|
|
+
|
|
|
+ ZIP_NAME="${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3-lz4.zip"
|
|
|
echo "Creating zip file: $ZIP_NAME..."
|
|
|
mv ../Image.lz4 ./Image.lz4
|
|
|
zip -r "../$ZIP_NAME" ./*
|
|
|
rm ./Image.lz4
|
|
|
-
|
|
|
- ZIP_NAME="${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3-gz.zip"
|
|
|
+
|
|
|
+ ZIP_NAME="${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-AnyKernel3-gz.zip"
|
|
|
echo "Creating zip file: $ZIP_NAME..."
|
|
|
mv ../Image.gz ./Image.gz
|
|
|
zip -r "../$ZIP_NAME" ./*
|
|
|
rm ./Image.gz
|
|
|
|
|
|
- - name: Run Boot Image ${{ inputs.android_version }} Build Script
|
|
|
+ - name: Android 12 boot image build script
|
|
|
if: ${{ inputs.android_version == 'android12' }}
|
|
|
run: |
|
|
|
echo "Changing to configuration directory: $CONFIG..."
|
|
|
cd bootimgs
|
|
|
-
|
|
|
+
|
|
|
GKI_URL=https://dl.google.com/android/gki/gki-certified-boot-android12-5.10-"${{ inputs.os_patch_level }}"_"${{ inputs.revision }}".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
|
|
|
echo "Checking if GKI kernel URL is reachable: $GKI_URL"
|
|
|
status=$(curl -sL -w "%{http_code}" "$GKI_URL" -o /dev/null)
|
|
|
-
|
|
|
+
|
|
|
if [ "$status" = "200" ]; then
|
|
|
echo "[+] Downloading from GKI_URL"
|
|
|
curl -Lo gki-kernel.zip "$GKI_URL"
|
|
|
@@ -489,63 +449,76 @@ jobs:
|
|
|
echo "[+] $GKI_URL not found, using $FALLBACK_URL"
|
|
|
curl -Lo gki-kernel.zip "$FALLBACK_URL"
|
|
|
fi
|
|
|
-
|
|
|
+
|
|
|
# Unzip the downloaded kernel and remove the zip
|
|
|
echo "Unzipping the downloaded kernel..."
|
|
|
unzip gki-kernel.zip && rm gki-kernel.zip
|
|
|
-
|
|
|
+
|
|
|
echo "Unpacking boot.img..."
|
|
|
FULL_PATH=$(pwd)/boot-5.10.img
|
|
|
echo "Unpacking using: $FULL_PATH"
|
|
|
-
|
|
|
+
|
|
|
echo "Running unpack_bootimg.py..."
|
|
|
$UNPACK_BOOTIMG --boot_img="$FULL_PATH"
|
|
|
-
|
|
|
- echo "Building Image.gz"
|
|
|
+
|
|
|
+ # Create gzip of the Image file
|
|
|
gzip -n -k -f -9 ./Image > ./Image.gz
|
|
|
-
|
|
|
+
|
|
|
echo "Building boot.img"
|
|
|
$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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot.img
|
|
|
-
|
|
|
+ cp ./boot.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot.img
|
|
|
+
|
|
|
echo "Building boot-gz.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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-gz.img
|
|
|
-
|
|
|
+ cp ./boot-gz.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-gz.img
|
|
|
+
|
|
|
echo "Building boot-lz4.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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-lz4.img
|
|
|
+ cp ./boot-lz4.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-lz4.img
|
|
|
|
|
|
- - name: Run Boot Image ${{ inputs.android_version }} Build Script
|
|
|
+ - 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 Image.gz"
|
|
|
+ # Create gzip of the Image file
|
|
|
gzip -n -k -f -9 ./Image > ./Image.gz
|
|
|
-
|
|
|
+
|
|
|
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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot.img
|
|
|
-
|
|
|
+ cp ./boot.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-gz.img
|
|
|
-
|
|
|
+ cp ./boot-gz.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-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 ../${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-lz4.img
|
|
|
+ cp ./boot-lz4.img ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-boot-lz4.img
|
|
|
+
|
|
|
+ echo "Transfering kernel files"
|
|
|
+ cp ./Image ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-Image
|
|
|
+ cp ./Image.gz ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-Image.gz
|
|
|
+ cp ./Image.lz4 ../${{ inputs.kernelsu_variant }}_${{ inputs.android_version }}-${{ inputs.kernel_version }}.${{ inputs.sub_level }}-${{ inputs.os_patch_level }}-Image.lz4
|
|
|
+
|
|
|
+ - name: Compress all img files with gzip
|
|
|
+ run: |
|
|
|
+ for image in *.img; do
|
|
|
+ gzip -vnf9 "$image"
|
|
|
+ done
|
|
|
+
|
|
|
|
|
|
- name: Upload Build Artifacts
|
|
|
uses: actions/upload-artifact@v4
|
|
|
with:
|
|
|
- name: kernel-${{ env.CONFIG }}
|
|
|
+ name: ${{ inputs.kernelsu_variant }}_kernel-${{ env.CONFIG }}
|
|
|
path: |
|
|
|
*.zip
|
|
|
- *.img
|
|
|
+ *.img.gz
|
|
|
+ *Image*
|