Skip to content

Build kernel (KSN) & WIFI A16 - no vendor blobs, KernelSU enabled by default #3

Build kernel (KSN) & WIFI A16 - no vendor blobs, KernelSU enabled by default

Build kernel (KSN) & WIFI A16 - no vendor blobs, KernelSU enabled by default #3

Workflow file for this run

name: OnePlus7 Kernel Build (No Vendor) + AnyKernel + Boot.img Repack
on:
workflow_dispatch:
inputs:
kernel_source_url:
description: "Kernel source repository"
required: false
default: "https://github.com/LineageOS/android_kernel_oneplus_sm8150"
kernel_branch:
description: "Branch of kernel source"
required: false
default: "lineage-23.0"
kernel_defconfig:
description: "Defconfig file to use"
required: false
default: "vendor/sm8150_defconfig"
bootimg_url:
description: "Boot.img URL (base for repack)"
required: false
default: "https://mirrorbits.lineageos.org/full/guacamoleb/20251026/boot.img"
jobs:
build:
runs-on: ubuntu-22.04
env:
ARCH: arm64
SUBARCH: arm64
KERNEL_NAME: OnePlus7_A16_NoVendor
OUT_DIR: out
CCACHE_MAXSIZE: 2G
PATH: /usr/lib/llvm-18/bin:$PATH
steps:
# --- Install essential tools (fixes 'tar' not found) ---
- name: Install system utilities
run: |
sudo apt-get update
sudo apt-get install -y tar gzip xz-utils
- name: Checkout repository
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
bc bison flex clang-18 lld-18 llvm-18 make git wget curl zip unzip \
gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libssl-dev ccache
- name: Clone kernel source
run: |
git clone --depth=1 --branch "${{ github.event.inputs.kernel_branch }}" \
"${{ github.event.inputs.kernel_source_url }}" kernel
cd kernel
git submodule update --init --recursive
cd ..
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 2G
- name: Configure kernel (disable vendor blobs)
working-directory: kernel
run: |
mkdir -p out
make O=out ARCH=arm64 ${{ github.event.inputs.kernel_defconfig }}
cat > ../ci.defaults <<'EOF'
CONFIG_LOCALVERSION_AUTO=y
CONFIG_VENDOR_EDIT=n
CONFIG_OPLUS_DEVICE_INFO=n
CONFIG_MSM_CAMERA=n
CONFIG_QCOM_CAMERA=n
CONFIG_NETFILTER=n
CONFIG_MAC80211=n
EOF
make O=out ARCH=arm64 olddefconfig KCONFIG_ALLCONFIG=../ci.defaults
- name: Build kernel
working-directory: kernel
run: |
make O=out ARCH=arm64 CC="ccache clang-18" LD="ld.lld-18" -j$(nproc)
ls out/arch/arm64/boot/
- name: Verify kernel output
run: |
test -f kernel/out/arch/arm64/boot/Image || exit 1
# -------------------------------------------------------------------
# ANYKERNEL3 PACKAGE
# -------------------------------------------------------------------
- name: Clone AnyKernel3
run: |
git clone https://github.com/osm0sis/AnyKernel3.git
cd AnyKernel3
rm -rf *.img *.zip
sed -i 's|device.name1=.*|device.name1=guacamole|' anykernel.sh
sed -i 's|device.name2=.*|device.name2=guacamoleb|' anykernel.sh
sed -i 's|do.devicecheck=1|do.devicecheck=0|' anykernel.sh
cd ..
- name: Package AnyKernel3 ZIP
run: |
cp kernel/out/arch/arm64/boot/Image* AnyKernel3/
cd AnyKernel3
zip -r9 ../${{ env.KERNEL_NAME }}_Anykernel.zip ./*
# -------------------------------------------------------------------
# BOOT IMAGE REPACK
# -------------------------------------------------------------------
- name: Download base boot image
run: |
mkdir -p boot
wget -O boot/base_boot.img "${{ github.event.inputs.bootimg_url }}"
- name: Clone Android Image Kitchen
run: |
git clone https://github.com/osm0sis/Android-Image-Kitchen.git aik
- name: Repack boot image with new kernel
run: |
cd aik
./unpackimg.sh ../boot/base_boot.img
cp ../kernel/out/arch/arm64/boot/Image* split_img/
./repackimg.sh
mv image-new.img ../${{ env.KERNEL_NAME }}_boot.img
cd ..
# -------------------------------------------------------------------
# UPLOAD ARTIFACTS
# -------------------------------------------------------------------
- name: Upload outputs
uses: actions/upload-artifact@v4
with:
name: ${{ env.KERNEL_NAME }}_Outputs
path: |
${{ env.KERNEL_NAME }}_Anykernel.zip
${{ env.KERNEL_NAME }}_boot.img