Преглед на файлове

btf: guard sublevel>43 against X/lts non-numeric sublevels

fromJSON(inputs.sublevel) threw for the lts tree (sublevel='X', e.g.
5.10.X-android12-lts), failing at template parse time. Short-circuit the
comparison so 'X'/'lts' are handled before fromJSON is evaluated, since those
are modern working lts trees and should keep the fixes.
TheWildJames преди 1 месец
родител
ревизия
3e17f49d12
променени са 2 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 6 6
      .github/actions/btf/action.yml
  2. 1 1
      .github/actions/setup-build-environment/action.yml

+ 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || 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' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || fromJSON(inputs.sublevel) > 43) }}
       run: |
         set -euo pipefail
         # android12-5.10 pins prebuilt pahole v1.19, which fails to recode the

+ 1 - 1
.github/actions/setup-build-environment/action.yml

@@ -33,7 +33,7 @@ runs:
 
     - name: Install build deps for BTF generation (android12-5.10, sublevel>43)
       shell: bash
-      if: ${{ inputs.version == 'android12-5.10' && fromJSON(inputs.sublevel) > 43 }}
+      if: ${{ inputs.version == 'android12-5.10' && (inputs.sublevel == 'X' || inputs.sublevel == 'lts' || fromJSON(inputs.sublevel) > 43) }}
       run: |
         set -euo pipefail
         sudo apt-get update -qq