Skip to content

Update Novendor.yml #15

Update Novendor.yml

Update Novendor.yml #15

Workflow file for this run

name: Build Kernel - No Vendor Blobs
on:
workflow_dispatch:
inputs:
kernel_source_url:
description: "URL of the kernel source repository"
required: true
default: "https://github.com/crdroidandroid/android_kernel_oneplus_sm8150"
kernel_branch:
description: "Branch of the kernel source"
required: true
default: "14.0"
kernel_defconfig:
description: "defconfig file to use"
required: true
default: "vendor/sm8150_defconfig"
output_name:
description: "Name of the output zip"
required: false
default: "OP7_Kernel-NoVendor.zip"
apply_kernelsu:
description: "Apply KernelSU patch (true/false)"
type: boolean
required: true
default: false
kernelsu_patch_url:
description: "KernelSU setup.sh URL"
required: false
default: "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh"
jobs:
build:
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_MAXSIZE: "2G"
KERNEL_CMDLINE: "ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out CROSS_COMPILE=aarch64-linux-gnu- CLANG_TRIPLE=aarch64-linux-gnu-"
OUTPUT_ZIP_NAME: ${{ github.event.inputs.output_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Kernel Source
run: |
set -euo pipefail
git clone --depth=1 --branch "${{ github.event.inputs.kernel_branch }}" "${{ github.event.inputs.kernel_source_url }}" kernel
cd kernel
git submodule update --init --recursive
- name: Install dependencies
run: |
set -euo pipefail
sudo apt-get update -y
sudo apt-get install -y clang-18 llvm-18 lld-18 gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu make python3 libssl-dev build-essential bc bison flex unzip git git-lfs libelf-dev pahole zip
git clone https://github.com/khalidaboelmagd/AnyKernel3
rm -rf AnyKernel3/.git
mkdir -p modules/vendor/lib/modules
- name: Optional: KernelSU Setup

Check failure on line 62 in .github/workflows/Novendor.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/Novendor.yml

Invalid workflow file

You have an error in your yaml syntax on line 62
if: ${{ github.event.inputs.apply_kernelsu }}
working-directory: kernel
run: |
set -euo pipefail
export PATH="/usr/lib/llvm-18/bin:$PATH"
curl -LSs "${{ github.event.inputs.kernelsu_patch_url }}" | bash -
- name: Prepare "No Vendor" Config
working-directory: kernel
run: |
set -euo pipefail
cat > ../novendor.defaults <<'EOF'
CONFIG_LOCALVERSION_AUTO=y
CONFIG_VENDOR_EDIT=n
CONFIG_OPLUS_DEVICE_INFO=n
CONFIG_OPLUS_PROJECT_INFO=n
CONFIG_OPLUS_ARCH_EXTENDS=n
CONFIG_OPLUS_FEATURE_CHG_BASIC=n
CONFIG_OPLUS_FEATURE_SENSOR=n
CONFIG_MSM_CAMERA=n
CONFIG_QCOM_CAMERA=n
CONFIG_SPECTRA_CAMERA=n
CONFIG_SPECTRA_EEPROM=n
CONFIG_DRM_MSM_OPLUS=n
CONFIG_TOUCHSCREEN_OPLUS=n
CONFIG_SOUND_OPLUS=n
CONFIG_MAC80211=n
CONFIG_CFG80211=n
CONFIG_WLAN=n
CONFIG_NETFILTER=n
CONFIG_NETFILTER_XTABLES=n
CONFIG_NF_CONNTRACK=n
CONFIG_DEBUG_INFO=n
CONFIG_DEBUG_KERNEL=n
EOF
- name: Apply Config and Blackhole Directories
working-directory: kernel
run: |
set -euo pipefail
export PATH="/usr/lib/llvm-18/bin:$PATH"
mkdir -p out
make O=out ARCH=arm64 ${{ github.event.inputs.kernel_defconfig }}
make O=out ARCH=arm64 olddefconfig KCONFIG_ALLCONFIG=../novendor.defaults
blackhole() {
if [ -d "$1" ]; then
echo -e '# Blackholed for no-vendor build\nobj-y := \nobj-m :=' > "$1/Makefile"
echo "Blackholed: $1"
fi
}
blackhole drivers/gpu/drm/msm/oplus
blackhole drivers/misc/oplus
blackhole drivers/soc/oplus
blackhole drivers/input/oplus
blackhole drivers/oneplus
blackhole drivers/staging/qcacld-3.0
blackhole net/netfilter
blackhole net/ipv6/netfilter
blackhole net/bridge/netfilter
- name: Build kernel
working-directory: kernel
run: |
set -euo pipefail
export PATH="/usr/lib/llvm-18/bin:$PATH"
export KBUILD_OUTPUT=out
make ${KERNEL_CMDLINE} CC="ccache clang-18" LD="ld.lld-18" -j$(nproc)
cp out/arch/arm64/boot/Image ../AnyKernel3/
- name: Package Kernel
run: |
set -euo pipefail
cd AnyKernel3
zip -r "../${OUTPUT_ZIP_NAME}" *
cd ..
- name: Upload Kernel Artifact
uses: actions/upload-artifact@v4
with:
name: kernel-zip
path: ${{ env.OUTPUT_ZIP_NAME }}
if-no-files-found: error