Android14-5.15-SM-X910 #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android14-5.15-SM-X910 | |
on: | |
workflow_dispatch: | |
inputs: | |
os_patch_level: | |
required: true | |
type: string | |
description: > | |
Patch level of common kernel manifest, | |
for example: 2024-06 | |
os_version: | |
required: true | |
type: string | |
description: > | |
OS Version of boot image | |
for example: 14.0.0 | |
version_name: | |
required: true | |
type: string | |
description: > | |
With SUBLEVEL of kernel, | |
for example: android13-5.15.123 | |
custom: | |
required: true | |
type: boolean | |
description: > | |
Enable LXC, Docker | |
kernelsu: | |
required: true | |
type: boolean | |
description: > | |
Enable KernelSU | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
sudo apt install repo wget dwarves -y | |
- name: Install latest repo tool | |
run: | | |
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo | |
chmod a+x /usr/local/bin/repo | |
- name: Verify repo version | |
run: repo --version | |
- name: Sync the kernel source code | |
run: | | |
cd $GITHUB_WORKSPACE | |
mkdir android-kernel | |
cd android-kernel | |
# it seems the revision with the least diff with is actually this one from Android 13: | |
# https://github.com/KDEFFALT/kernel_common-5.15/commit/09996673e3139a6d86fc3d95c852b3a020e2fe5f | |
repo init --depth 1 -u https://android.googlesource.com/kernel/manifest -b common-android13-5.15-${{ inputs.os_patch_level }} | |
repo sync | |
- name: Replace pure GKI by SM-X910 GKI | |
run: | | |
cd $GITHUB_WORKSPACE/android-kernel | |
git clone https://github.com/ArchVIsions/android_kernel_samsung_gts9wifi.git --depth=1 | |
mv common common_pure_gki | |
mv android_kernel_samsung_gts9wifi common | |
- name: Apply patches and configuration files | |
if: ${{ inputs.custom == true }} | |
run: | | |
cd $GITHUB_WORKSPACE | |
git clone https://github.com/rvalyi/GKI-Custom.git gki-patch | |
# FIXME FIXME FIXME: inject the LXC settings properly, see the diff I put in config... | |
# cp ./gki-patch/config/gki_defconfig-android13-5.15 ./android-kernel/common/arch/arm64/configs/gki_defconfig | |
cd ./android-kernel/common | |
git apply $GITHUB_WORKSPACE/gki-patch/patchs/*.patch | |
- name: KernelSU | |
if: ${{ inputs.kernelsu == true }} | |
run: | | |
cd $GITHUB_WORKSPACE/android-kernel | |
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash - | |
- name: Build Kernel | |
run: | | |
cd $GITHUB_WORKSPACE/android-kernel | |
echo "ls" | |
ls | |
echo "ls build" | |
ls build | |
echo "head -n 10 common/Makefile" | |
head -n 10 common/Makefile | |
# BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh savedefconfig | |
# LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh | |
export ARCH=arm64 | |
sed -i 's/CONFIG_DEBUG_INFO_BTF=y/CONFIG_DEBUG_INFO_BTF=n/' common/arch/arm64/configs/kalama_gki_defconfig | |
sed -i 's/CONFIG_DEBUG_INFO_BTF_MODULES=y/CONFIG_DEBUG_INFO_BTF_MODULES=n/' common/arch/arm64/configs/kalama_gki_defconfig | |
echo "will do build/config.sh" | |
#BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh savedefconfig | |
BUILD_CONFIG=common/build.config.gki.aarch64 build/config.sh kalama_gki_defconfig | |
# BUILD_CONFIG=common/build.config.gki.aarch64 KERNEL_DEFCONFIG=kalama_gki_defconfig build/config.sh savedefconfig | |
ls -la . | |
echo "build.sh --config done" | |
echo "will build sign-file.c" | |
# gcc common/scripts/sign-file.c -o /home/runner/work/GKI-Custom/GKI-Custom/android-kernel/out/android13-5.15/common/scripts/sign-file -lssl -lcrypto | |
# ls -la /home/runner/work/GKI-Custom/GKI-Custom/android-kernel/out/android13-5.15/common/scripts/sign-file | |
echo "-----------------------------------" | |
sed -i '/build_system_dlkm/i gcc /home/runner/work/GKI-Custom/GKI-Custom/android-kernel/out/android13-5.15/common/scripts/sign-file.c -o /home/runner/work/GKI-Custom/GKI-Custom/android-kernel/out/android13-5.15/common/scripts/sign-file -lssl -lcrypto' build/build.sh | |
cat build/build.sh | |
ls /home/runner/work/GKI-Custom/GKI-Custom/android-kernel/build/ | |
ls build | |
echo "***********************************" | |
KCFLAGS="-g0 -Wno-error" LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh -j2 | |
- name: Prepare artifacts | |
id: prepareArtifacts | |
run: | | |
cd $GITHUB_WORKSPACE | |
OUTDIR=android-kernel/out/android13-5.15/dist | |
mkdir output | |
cp $OUTDIR/Image ./output/ | |
cp $OUTDIR/Image.lz4 ./output/ | |
cp $OUTDIR/Image ./ | |
gzip -n -k -f -9 Image >Image.gz | |
git clone https://github.com/Kernel-SU/AnyKernel3 | |
rm -rf ./AnyKernel3/.git | |
cp $OUTDIR/Image ./AnyKernel3/ | |
wget https://dl.google.com/android/gki/gki-certified-boot-android13-5.15-${{ inputs.os_patch_level }}_r1.zip -O ./gki-kernel.zip | |
unzip -q ./gki-kernel.zip | |
rm ./gki-kernel.zip | |
cd $GITHUB_WORKSPACE/android-kernel | |
echo "Unpack boot" | |
./tools/mkbootimg/unpack_bootimg.py --boot_img $GITHUB_WORKSPACE/boot*.img | |
echo "Build boot.img" | |
./tools/mkbootimg/mkbootimg.py --header_version 4 --kernel out/android13-5.15/dist/Image --ramdisk out/ramdisk --os_version ${{ inputs.os_version }} --os_patch_level ${{ inputs.os_patch_level }} -o $GITHUB_WORKSPACE/output/${{ inputs.version_name }}_${{ inputs.os_patch_level }}-boot.img | |
echo "Build boot-lz4.img" | |
./tools/mkbootimg/mkbootimg.py --header_version 4 --kernel out/android13-5.15/dist/Image.lz4 --ramdisk out/ramdisk --os_version ${{ inputs.os_version }} --os_patch_level ${{ inputs.os_patch_level }} -o $GITHUB_WORKSPACE/output/${{ inputs.version_name }}_${{ inputs.os_patch_level }}-boot-lz4.img | |
echo "Build boot-gz.img" | |
./tools/mkbootimg/mkbootimg.py --header_version 4 --kernel $GITHUB_WORKSPACE/Image.gz --ramdisk out/ramdisk --os_version ${{ inputs.os_version }} --os_patch_level ${{ inputs.os_patch_level }} -o $GITHUB_WORKSPACE/output/${{ inputs.version_name }}_${{ inputs.os_patch_level }}-boot-gz.img | |
- name: Upload Image and Image.gz and boot.img | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Image-${{ inputs.version_name }}_${{ inputs.os_patch_level }} | |
path: ./output/* | |
- name: Upload AnyKernel3 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AnyKernel3-${{ inputs.version_name }}_${{ inputs.os_patch_level }} | |
path: ./AnyKernel3/* |