Skip to content

Commit 1124e2c

Browse files
authored
Update KSN-WIFI-A16.yml
1 parent 9abb2dd commit 1124e2c

File tree

1 file changed

+26
-32
lines changed

1 file changed

+26
-32
lines changed

.github/workflows/KSN-WIFI-A16.yml

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
CCACHE_NOHASHDIR: "true"
3535
CCACHE_MAXSIZE: "2G"
3636
CCACHE_HARDLINK: "true"
37-
# Use LLVM toolchain with Ubuntu cross-binutils; O=out matches Copilot’s layout.
37+
# LLVM + Ubuntu cross-binutils for Android 16 era; out-of-tree build directory
3838
KERNEL_CMDLINE: "ARCH=arm64 LLVM=1 LLVM_IAS=1 O=out CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- CLANG_TRIPLE=aarch64-linux-gnu-"
3939
KERNEL_DEFCONFIG: ${{ github.event.inputs.kernel_defconfig || 'lineage_sm8150_defconfig' }}
4040
KERNEL_SOURCE_URL: ${{ github.event.inputs.kernel_source_url || 'https://github.com/LineageOS/android_kernel_oneplus_sm8150' }}
@@ -76,6 +76,7 @@ jobs:
7676
binutils-aarch64-linux-gnu binutils \
7777
make python3 libssl-dev build-essential bc bison flex unzip \
7878
ca-certificates xz-utils mkbootimg cpio device-tree-compiler git git-lfs
79+
# Packaging template
7980
git clone https://github.com/khalidaboelmagd/AnyKernel3
8081
rm -rf AnyKernel3/.git
8182
@@ -101,7 +102,7 @@ jobs:
101102
export PATH=/usr/lib/llvm-18/bin:$PATH
102103
curl -LSs "https://raw.githubusercontent.com/KernelSU-Next/KernelSU-Next/next/kernel/setup.sh" | bash -
103104
104-
# Copilot: create O=out defconfig for a clean base
105+
# 1) Seed config into O=out
105106
- name: Prepare kernel output directory (defconfig)
106107
working-directory: kernel
107108
run: |
@@ -111,39 +112,30 @@ jobs:
111112
export HOSTCXX=clang++-18
112113
make O=out $KERNEL_DEFCONFIG
113114
114-
# Copilot: adjust config non-interactively, then olddefconfig to accept defaults for any new symbols
115-
- name: Fix kernel config for CI (no source changes)
115+
# 2) Build scripts so scripts/config is available
116+
- name: Build Kconfig tools
116117
working-directory: kernel
117118
run: |
118-
set -e
119119
export PATH=/usr/lib/llvm-18/bin:$PATH
120-
OUT_CONFIG=out/.config
121-
122-
if [ ! -f "$OUT_CONFIG" ]; then
123-
echo "No $OUT_CONFIG found, generating defconfig"
124-
make O=out $KERNEL_DEFCONFIG
125-
fi
126-
127-
if [ -x scripts/config ]; then
128-
echo "Using scripts/config to update config"
129-
./scripts/config --file "$OUT_CONFIG" --set-val CONFIG_NR_CPUS 64 || true
130-
./scripts/config --file "$OUT_CONFIG" --disable CONFIG_HUGETLB_PAGE || true
131-
./scripts/config --file "$OUT_CONFIG" --disable CONFIG_HUGETLBFS || true
132-
else
133-
echo "scripts/config not found, editing $OUT_CONFIG directly"
134-
sed -i '/^CONFIG_NR_CPUS=/d' "$OUT_CONFIG" || true
135-
echo 'CONFIG_NR_CPUS=64' >> "$OUT_CONFIG"
136-
sed -i '/^CONFIG_HUGETLB_PAGE=/d' "$OUT_CONFIG" || true
137-
echo 'CONFIG_HUGETLB_PAGE=n' >> "$OUT_CONFIG"
138-
sed -i '/^CONFIG_HUGETLBFS=/d' "$OUT_CONFIG" || true
139-
echo 'CONFIG_HUGETLBFS=n' >> "$OUT_CONFIG"
140-
fi
120+
make O=out scripts
141121
142-
# Critical: resolve any new symbols without prompts
143-
make O=out olddefconfig
144-
145-
echo "==== Effective kernel config adjustments ===="
146-
grep -E '^CONFIG_NR_CPUS=|^CONFIG_HUGETLB' out/.config || true
122+
# 3) Non-interactive config finalize: preseed QTI_GVM=n and apply defaults
123+
- name: Finalize kernel config (non-interactive)
124+
working-directory: kernel
125+
run: |
126+
set -e
127+
export PATH=/usr/lib/llvm-18/bin:$PATH
128+
# Preseed new symbols to avoid CI prompts (QTI_GVM=n) and keep Copilot adjustments
129+
cat > ../ci.defaults <<'EOF'
130+
CONFIG_QTI_GVM=n
131+
CONFIG_NR_CPUS=64
132+
CONFIG_HUGETLB_PAGE=n
133+
CONFIG_HUGETLBFS=n
134+
EOF
135+
# Merge defaults and generate auto.conf without prompts
136+
make O=out olddefconfig KCONFIG_ALLCONFIG=../ci.defaults
137+
echo "==== Effective kernel config deltas ===="
138+
grep -E '^CONFIG_QTI_GVM=|^CONFIG_NR_CPUS=|^CONFIG_HUGETLB' out/.config || true
147139
148140
- name: Prepare scripts and headers
149141
working-directory: ./kernel
@@ -165,9 +157,10 @@ jobs:
165157
export DTC_EXT=dtc
166158
export HOSTCC=clang-18
167159
export HOSTCXX=clang++-18
168-
# Ensure no interactive Kconfig runs before build
160+
# Safety: ensure no pending prompts
169161
make O=out olddefconfig
170162
make $KERNEL_CMDLINE CC="ccache clang-18" LD="ld.lld-18" AR="llvm-ar-18" NM="llvm-nm-18" OBJCOPY="llvm-objcopy-18" OBJDUMP="llvm-objdump-18" STRIP="llvm-strip-18" -j"$(nproc)"
163+
test -f out/arch/arm64/boot/Image
171164
cp out/arch/arm64/boot/Image ../AnyKernel3
172165
173166
- name: Run simple verification on build output
@@ -222,6 +215,7 @@ jobs:
222215
with:
223216
name: kernel-out
224217
path: kernel/out
218+
if-no-files-found: warn
225219

226220
- name: Upload zips
227221
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)