Skip to content

Commit 6615068

Browse files
authored
ci: fix android16-6.12 gki build (#2931)
1 parent ab3840a commit 6615068

1 file changed

Lines changed: 32 additions & 7 deletions

File tree

.github/workflows/gki-kernel.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ jobs:
7777
with:
7878
root-reserve-mb: 8192
7979
temp-reserve-mb: 2048
80-
remove-dotnet: 'true'
81-
remove-android: 'true'
82-
remove-haskell: 'true'
83-
remove-codeql: 'true'
80+
remove-dotnet: "true"
81+
remove-android: "true"
82+
remove-haskell: "true"
83+
remove-codeql: "true"
8484

8585
- uses: actions/checkout@v5
8686
with:
@@ -199,14 +199,35 @@ jobs:
199199
sed -i 's/needs unknown symbol/Dont abort when unknown symbol/g' build/kernel/*.sh || echo "No unknown symbol scripts found"
200200
fi
201201
202+
- name: Append ashmem exports if missing
203+
if: startsWith(inputs.version, 'android16-6.12')
204+
working-directory: android-kernel
205+
run: |
206+
FILE=common/drivers/staging/android/ashmem.c
207+
if [[ -f "$FILE" ]] && ! grep -q 'is_ashmem_file' "$FILE"; then
208+
cat >>"$FILE" <<'EOF'
209+
210+
bool is_ashmem_file(struct file *file) { return false; }
211+
int ashmem_area_name(struct file *file, char *name) { return 0; }
212+
long ashmem_area_size(struct file *file) { return 0; }
213+
struct file *ashmem_area_vmfile(struct file *file) { return NULL; }
214+
EXPORT_SYMBOL_GPL(is_ashmem_file);
215+
EXPORT_SYMBOL_GPL(ashmem_area_name);
216+
EXPORT_SYMBOL_GPL(ashmem_area_size);
217+
EXPORT_SYMBOL_GPL(ashmem_area_vmfile);
218+
EOF
219+
fi
220+
221+
sed -i -E 's/\$\(CONFIG_ANDROID_BINDER_IPC_RUST\)/m/g' common/drivers/android/Makefile
222+
202223
- name: Make working directory clean to avoid dirty
203224
working-directory: android-kernel
204225
run: |
205226
# Fix bazel build error
206227
if [ -f common/BUILD.bazel ]; then
207228
[ -f android/abi_gki_protected_exports_aarch64 ] || sed -i '/^[[:space:]]*"protected_exports_list"[[:space:]]*:[[:space:]]*"android\/abi_gki_protected_exports_aarch64",$/d' common/BUILD.bazel
208229
fi
209-
230+
210231
rm common/android/abi_gki_protected_exports_* || echo "No protected exports!"
211232
git config --global user.email "bot@kernelsu.org"
212233
git config --global user.name "KernelSUBot"
@@ -223,7 +244,11 @@ jobs:
223244
if [ -e build/build.sh ]; then
224245
LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh CC="/usr/bin/ccache clang"
225246
else
226-
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common:kernel_aarch64_dist -- --dist_dir=dist
247+
if [ "${{ inputs.version }}" == "android16-6.12" ]; then
248+
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common:kernel_aarch64_dist -- --destdir=dist
249+
else
250+
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --config=stamp --lto=thin //common:kernel_aarch64_dist -- --dist_dir=dist
251+
fi
227252
fi
228253
229254
- name: Prepare artifacts
@@ -234,7 +259,7 @@ jobs:
234259
OUTDIR=android-kernel/dist
235260
fi
236261
mkdir output
237-
if [ "${{ inputs.build_lkm}}" = "true" ]; then
262+
if [ "${{ inputs.build_lkm}}" = "true" ]; then
238263
llvm-strip-15 -d $OUTDIR/kernelsu.ko
239264
mv $OUTDIR/kernelsu.ko ./output/${{ inputs.version }}_kernelsu.ko
240265
else

0 commit comments

Comments
 (0)