Skip to content

Commit 7f48297

Browse files
authored
Refactor Novendor workflow for clarity and consistency
Updated the Novendor workflow to improve descriptions and formatting, and modified several steps for clarity and consistency.
1 parent eccd731 commit 7f48297

File tree

1 file changed

+32
-59
lines changed

1 file changed

+32
-59
lines changed

.github/workflows/Novendor.yml

Lines changed: 32 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,78 @@
1-
name: Build kernel (KSN) & WIFI A16 -- no vendor, no blobs
1+
name: Build kernel (KSN) & WIFI A16 - no vendor blobs
22

33
on:
44
workflow_dispatch:
55
inputs:
66
kernel_source_url:
7-
description: "URL of the kernel source repository"
7+
description: URL of the kernel source repository
88
required: true
9-
default: "https://github.com/LineageOS/android_kernel_oneplus_sm8150"
9+
default: https://github.com/LineageOS/android_kernel_oneplus_sm8150
1010
kernel_branch:
11-
description: "Branch of the kernel source"
11+
description: Branch of the kernel source
1212
required: true
13-
default: "lineage-23.0"
13+
default: lineage-23.0
1414
kernel_defconfig:
15-
description: "defconfig file to use"
15+
description: defconfig file to use
1616
required: true
17-
default: "vendor/sm8150_defconfig"
17+
default: vendor/sm8150_defconfig
1818
output_name:
19-
description: "Name of the output.zip"
19+
description: Name of the output zip
2020
required: false
21-
default: "OP7_KSN_wifi-LOS-noVendor.zip"
21+
default: OP7_KSN_wifi-LOS-noVendor.zip
2222
apply_kernelsu:
23-
description: "Apply KernelSU patch (true/false)"
23+
description: Apply KernelSU patch (true/false)
2424
required: true
25-
default: "false"
25+
default: false
2626
kernelsu_patch_url:
27-
description: "KernelSU setup.sh URL (ignored if apply_kernelsu=false)"
27+
description: KernelSU setup.sh URL (used if apply_kernelsu==true)
2828
required: false
29-
default: "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh"
29+
default: https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh
3030

3131
jobs:
3232
build:
3333
runs-on: ubuntu-latest
3434
env:
35-
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
36-
CCACHE_NOHASHDIR: "true"
37-
CCACHE_MAXSIZE: "2G"
38-
KERNEL_CMDLINE: "ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out CROSS_COMPILE=aarch64-linux-gnu- CLANG_TRIPLE=aarch64-linux-gnu-"
35+
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
36+
CCACHE_NOHASHDIR: 'true'
37+
CCACHE_MAXSIZE: '2G'
38+
KERNEL_CMDLINE: 'ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out CROSS_COMPILE=aarch64-linux-gnu- CLANG_TRIPLE=aarch64-linux-gnu-'
3939
OUTPUT_ZIP_NAME: ${{ github.event.inputs.output_name }}
4040

4141
steps:
42-
- name: Checkout repository
43-
uses: actions/checkout@v4
42+
- uses: actions/checkout@v4
4443
with:
4544
fetch-depth: 0
4645

47-
- name: Checkout Kernel Source
48-
env:
49-
KERNEL_SOURCE_URL: ${{ github.event.inputs.kernel_source_url || 'https://github.com/LineageOS/android_kernel_oneplus_sm8150' }}
50-
KERNEL_BRANCH: ${{ github.event.inputs.kernel_branch || 'lineage-23.0' }}
46+
- name: Clone Kernel Source
5147
run: |
5248
set -euo pipefail
53-
git clone --depth=1 --branch "${KERNEL_BRANCH}" "${KERNEL_SOURCE_URL}" kernel
49+
git clone --depth=1 --branch "${{ github.event.inputs.kernel_branch }}" "${{ github.event.inputs.kernel_source_url }}" kernel
5450
cd kernel
5551
git submodule update --init --recursive
5652
57-
- name: Set up ccache
58-
uses: hendrikmuhs/ccache-action@v1.2
59-
60-
- name: Cleanup space
61-
run: |
62-
set -euo pipefail
63-
sudo rm -rf /opt/ghc /usr/local/share/boost /usr/share/dotnet "${AGENT_TOOLSDIRECTORY:-/opt/hostedtoolcache}" || true
64-
65-
- name: Install dependencies
53+
- name: Install dependencies & Setup environment
6654
run: |
6755
set -euo pipefail
6856
sudo apt-get update -y
69-
sudo apt-get install -y \
70-
ccache clang-18 llvm-18 lld-18 gcc-aarch64-linux-gnu \
71-
binutils-aarch64-linux-gnu binutils make python3 libssl-dev \
72-
build-essential bc bison flex unzip git git-lfs libelf-dev pahole \
73-
zip
57+
sudo apt-get install -y ccache clang-18 llvm-18 lld-18 gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu binutils make python3 libssl-dev build-essential bc bison flex unzip git git-lfs libelf-dev pahole zip
7458
git clone https://github.com/khalidaboelmagd/AnyKernel3
7559
rm -rf AnyKernel3/.git
7660
mkdir -p modules/vendor/lib/modules
7761
78-
- name: Optional KernelSU-Next setup
62+
- name: Optional KernelSU Setup
7963
if: ${{ github.event.inputs.apply_kernelsu == 'true' }}
8064
working-directory: kernel
81-
env:
82-
KSU_URL: ${{ github.event.inputs.kernelsu_patch_url }}
8365
run: |
8466
set -euo pipefail
8567
export PATH="/usr/lib/llvm-18/bin:$PATH"
86-
curl -LSs "${KSU_URL}" | bash -
68+
curl -LSs "${{ github.event.inputs.kernelsu_patch_url }}" | bash -
8769
88-
- name: Write novendor.defaults
70+
- name: Write novendor.defaults config
8971
working-directory: kernel
9072
run: |
9173
set -euo pipefail
9274
cat > ../novendor.defaults <<'EOF'
9375
CONFIG_LOCALVERSION_AUTO=y
94-
95-
# Vendor / proprietary modules
9676
CONFIG_VENDOR_EDIT=n
9777
CONFIG_OPLUS_DEVICE_INFO=n
9878
CONFIG_OPLUS_PROJECT_INFO=n
@@ -107,12 +87,10 @@ jobs:
10787
CONFIG_TOUCHSCREEN_OPLUS=n
10888
CONFIG_SOUND_OPLUS=n
10989
110-
# Wireless stacks (likely require blobs)
11190
CONFIG_MAC80211=n
11291
CONFIG_CFG80211=n
11392
CONFIG_WLAN=n
11493
115-
# Netfilter / xt / nf_conntrack (disable entirely)
11694
CONFIG_NETFILTER=n
11795
CONFIG_NETFILTER_XTABLES=n
11896
CONFIG_NF_CONNTRACK=n
@@ -129,37 +107,34 @@ jobs:
129107
CONFIG_NF_TABLES_IPV4=n
130108
CONFIG_NF_TABLES_IPV6=n
131109
132-
# Optional: reduce debug
133110
CONFIG_DEBUG_INFO=n
134111
CONFIG_DEBUG_KERNEL=n
135112
EOF
136113
137-
- name: Prepare defconfig
114+
- name: Prepare kernel build output and defconfig
138115
working-directory: kernel
139116
env:
140-
KERNEL_DEFCONFIG: ${{ github.event.inputs.kernel_defconfig || 'vendor/sm8150_defconfig' }}
117+
KERNEL_DEFCONFIG: ${{ github.event.inputs.kernel_defconfig }}
141118
run: |
142119
set -euo pipefail
143120
export PATH="/usr/lib/llvm-18/bin:$PATH"
144121
mkdir -p out
145122
make O=out ARCH=arm64 "${KERNEL_DEFCONFIG}"
146123
147-
- name: Apply novendor defaults and blackhole dirs
124+
- name: Apply novendor config and blackhole vendor dirs
148125
working-directory: kernel
149126
run: |
150127
set -euo pipefail
151128
export PATH="/usr/lib/llvm-18/bin:$PATH"
152129
153130
make O=out ARCH=arm64 olddefconfig KCONFIG_ALLCONFIG=../novendor.defaults
154-
155131
cp out/.config arch/arm64/configs/oneplus_novendor_defconfig || true
156132
157-
# Blackhole problematic dirs (Makefiles to empty obj lists)
158133
blackhole() {
159134
d="$1"
160135
if [ -d "$d" ]; then
161-
printf '%s\n' '# blackholed for no-vendor build' 'obj-y :=' 'obj-m :=' > "$d/Makefile"
162-
chmod 0644 "$d/Makefile"
136+
echo -e '# blackholed for no-vendor build\nobj-y :=\nobj-m :=' > "$d/Makefile"
137+
chmod 644 "$d/Makefile"
163138
echo "Blackholed: $d"
164139
fi
165140
}
@@ -178,13 +153,11 @@ jobs:
178153
blackhole net/ipv6/netfilter
179154
blackhole net/bridge/netfilter
180155
181-
# Remove vendor fragments from Kconfig includes (best effort)
182156
sed -i '/^source.*vendor/d' arch/arm64/configs/* || true
183157
sed -i '/^# Kconfig: vendor/d' arch/arm64/configs/* || true
184158
185-
# Extra guard: wipe any leftover Makefiles in netfilter families
186159
find net/netfilter net/ipv6/netfilter net/bridge/netfilter -type f -name Makefile -print0 | \
187-
xargs -0 -I{} bash -c "printf '%s\n' '# disabled (no vendor blobs/netfilter)' 'obj-y :=' 'obj-m :=' > '{}'" || true
160+
xargs -0 -I{} sh -c 'echo -e "# disabled (no vendor blobs/netfilter)\nobj-y :=\nobj-m :=" > "$1"' _ {}
188161
189162
- name: Build kernel
190163
working-directory: kernel
@@ -233,7 +206,7 @@ jobs:
233206
fi
234207
cd ..
235208
236-
- name: Upload outputs
209+
- name: Upload build outputs
237210
uses: actions/upload-artifact@v4
238211
with:
239212
name: outputs

0 commit comments

Comments
 (0)