Procházet zdrojové kódy

btf: gate all android12-5.10 fixes to sublevel>43

The 5.10.43 sublevel (2021-08/09/10) fails with 'FAILED unresolved symbol
xdp_buff' regardless of toolchain or patches: its DWARF is not fully recodable
even by pahole 1.31, so xdp_buff is dropped from BTF. No source patch fixes it
(verified across 4 CI runs). All sublevels >=66 build cleanly.

Gate the six btf action fixes (libbpf feature-detect, resolve_btfids linker
flags, BTF_TYPE_EMIT, ELF_T_WORD, host dd, source-built pahole) AND the apt
build-deps install (dwarves/libelf-dev) in setup-build-environment to
android12-5.10 && sublevel>43, so the unfixable 5.10.43 trees skip them while
every working sublevel keeps the fixes.
TheWildJames před 1 měsícem
rodič
revize
69df6c9f23

+ 6 - 6
.github/actions/btf/action.yml

@@ -17,7 +17,7 @@ runs:
     - name: Apply libbpf feature-detection fix (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         patch -p1 -N < ${{ github.action_path }}/patches/0001-libbpf-remove-feature-detection-BTF.patch
@@ -25,7 +25,7 @@ runs:
     - name: Apply resolve_btfids linker-flag fix (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         patch -p1 -N < ${{ github.action_path }}/patches/0002-resolve_btfids-inherit-host-linker-flags.patch
@@ -33,7 +33,7 @@ runs:
     - name: Apply xdp_buff BTF-emit fix (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         # bpf_types.h references struct xdp_buff via
@@ -51,7 +51,7 @@ runs:
     - name: Apply resolve_btfids ELF_T_WORD endian fix (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         # Backport of upstream 61e8aeda9398 ("bpf: Fix libelf endian handling
@@ -72,7 +72,7 @@ runs:
     - name: Expose host dd for hermetic BTF generation (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel/common
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         # The hermetic toolchain PATH (build.config.common -> HERMETIC_TOOLCHAIN=1)
@@ -88,7 +88,7 @@ runs:
     - name: Build and use pahole >=1.26 for hermetic BTF generation (android12-5.10)
       shell: bash
       working-directory: ${{ github.workspace }}/kernel
-      if: ${{ inputs.version == 'android12-5.10' }}
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
       run: |
         set -euo pipefail
         # android12-5.10 pins prebuilt pahole v1.19, which fails to recode the

+ 13 - 2
.github/actions/setup-build-environment/action.yml

@@ -1,6 +1,14 @@
 name: 'Setup Build Environment'
 description: 'Clones dependencies and exports mkbootimg/avbtool paths'
 
+inputs:
+  version:
+    description: 'Kernel config version (e.g., android12-5.10)'
+    required: true
+  sublevel:
+    description: 'Kernel sublevel'
+    required: true
+
 runs:
   using: composite
   steps:
@@ -23,7 +31,10 @@ runs:
         if [ -d "${{ github.workspace }}/AnyKernel3" ]; then rm -rf "${{ github.workspace }}/AnyKernel3"; fi
         git clone https://github.com/WildKernels/AnyKernel3.git -b gki-2.0 "${{ github.workspace }}/AnyKernel3"
 
-        # Install build deps needed for BTF generation on older kernels (android12-5.10)
+    - name: Install build deps for BTF generation (android12-5.10, sublevel>43)
+      shell: bash
+      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
+      run: |
+        set -euo pipefail
         sudo apt-get update -qq
         sudo apt-get install -y -qq dwarves libelf-dev
-        

+ 3 - 0
.github/workflows/build.yml

@@ -73,6 +73,9 @@ jobs:
 
     - name: Setup Build Environment
       uses: ./.github/actions/setup-build-environment
+      with:
+        version: ${{ inputs.version }}
+        sublevel: ${{ inputs.sublevel }}
       env:
         BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}