fix: regenerate v5.4 qmi patch and relax old-kernel objtool flags #56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Validate Drivers | |
| on: | |
| push: | |
| branches: ['v5.4', 'v5.15', 'v6.1', 'v6.6', 'v6.12'] | |
| workflow_dispatch: | |
| concurrency: | |
| group: build-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| kv: ${{ steps.m.outputs.kv }} | |
| major: ${{ steps.m.outputs.major }} | |
| steps: | |
| - id: m | |
| run: | | |
| REF="${GITHUB_REF_NAME}" | |
| [[ "$REF" == */merge ]] && REF="${{ github.head_ref }}" | |
| KV="${REF#v}" | |
| echo "kv=${KV}" >> "$GITHUB_OUTPUT" | |
| echo "major=${KV%%.*}" >> "$GITHUB_OUTPUT" | |
| validate-patches: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download & validate patches | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| KV="${{ needs.setup.outputs.kv }}" | |
| MAJ="${{ needs.setup.outputs.major }}" | |
| curl -fSL --retry 3 -o /tmp/linux.tar.xz "https://cdn.kernel.org/pub/linux/kernel/v${MAJ}.x/linux-${KV}.tar.xz" | |
| mkdir -p /tmp/linux-src | |
| tar xf /tmp/linux.tar.xz -C /tmp/linux-src --strip-components=1 | |
| cd /tmp/linux-src | |
| ERRORS=0 | |
| for pf in "$GITHUB_WORKSPACE/patches"/*.patch; do | |
| [ -f "$pf" ] || continue | |
| name=$(basename "$pf") | |
| head -1 "$pf" | grep -q "No changes" && echo "⊘ $name: no changes needed" && continue | |
| echo "→ $name" | |
| patch --dry-run -p1 < "$pf" && echo "✓ $name" || { echo "✗ $name FAILED"; ERRORS=$((ERRORS+1)); } | |
| done | |
| exit $ERRORS | |
| build-out-of-tree: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install deps | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq build-essential libelf-dev bc flex bison | |
| - name: Download kernel ${{ needs.setup.outputs.kv }} | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| KV="${{ needs.setup.outputs.kv }}" | |
| MAJ="${{ needs.setup.outputs.major }}" | |
| curl -fSL --retry 3 -o /tmp/linux.tar.xz "https://cdn.kernel.org/pub/linux/kernel/v${MAJ}.x/linux-${KV}.tar.xz" | |
| tar xf /tmp/linux.tar.xz -C /tmp --strip-components=1 | |
| - name: Configure & build kernel with USB/NET subsystems | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd /tmp | |
| make allnoconfig > /tmp/allnoconfig.log 2>&1 | |
| scripts/config --enable CONFIG_64BIT || true | |
| scripts/config --enable CONFIG_MODULES | |
| scripts/config --enable CONFIG_PRINTK | |
| scripts/config --enable CONFIG_PROC_FS | |
| scripts/config --enable CONFIG_SYSFS | |
| scripts/config --enable CONFIG_DEVTMPFS | |
| scripts/config --enable CONFIG_TTY | |
| scripts/config --enable CONFIG_BLOCK | |
| scripts/config --enable CONFIG_GENERIC_ALLOCATOR | |
| scripts/config --enable CONFIG_NET | |
| scripts/config --enable CONFIG_INET | |
| scripts/config --enable CONFIG_CRC32 | |
| scripts/config --enable CONFIG_CRC16 | |
| scripts/config --enable CONFIG_CRC_CCITT | |
| scripts/config --enable CONFIG_USB | |
| scripts/config --enable CONFIG_USB_SUPPORT || true | |
| scripts/config --enable CONFIG_USB_COMMON || true | |
| scripts/config --enable CONFIG_USB_ARCH_HAS_HCD || true | |
| scripts/config --enable CONFIG_USB_ANNOUNCE_NEW_DEVICES || true | |
| scripts/config --set-val CONFIG_USB_SERIAL y | |
| scripts/config --enable CONFIG_USB_SERIAL_CONSOLE || true | |
| scripts/config --enable CONFIG_USB_SERIAL_WWAN || true | |
| scripts/config --enable CONFIG_USB_SERIAL_OPTION || true | |
| scripts/config --enable CONFIG_USB_NET_DRIVERS || true | |
| scripts/config --enable CONFIG_USB_ACM || true | |
| scripts/config --enable CONFIG_WWAN || true | |
| scripts/config --enable CONFIG_WWAN_CORE || true | |
| scripts/config --enable CONFIG_MODULE_UNLOAD || true | |
| scripts/config --enable CONFIG_NET_CORE || true | |
| scripts/config --enable CONFIG_FIB_RULES || true | |
| scripts/config --enable CONFIG_MULTIUSER || true | |
| scripts/config --enable CONFIG_FUTEX || true | |
| scripts/config --enable CONFIG_RATIONAL || true | |
| scripts/config --enable CONFIG_CRC32_SLICEBY8 || true | |
| scripts/config --disable CONFIG_STACK_VALIDATION || true | |
| make olddefconfig > /tmp/olddefconfig.log 2>&1 || { tail -100 /tmp/olddefconfig.log; exit 1; } | |
| grep -E 'CONFIG_(USB_SERIAL|USB_NET|WWAN|MODULES|STACK_VALIDATION)[= ]' .config | head -20 || true | |
| make vmlinux -j$(nproc) SKIP_STACK_VALIDATION=1 HOSTCFLAGS="-Wno-error" HOSTCXXFLAGS="-Wno-error" KCFLAGS="-Wno-error" KBUILD_CFLAGS_MODULE="-Wno-error" KBUILD_USERCFLAGS="-Wno-error" > /tmp/vmlinux.log 2>&1 || { tail -200 /tmp/vmlinux.log; exit 1; } | |
| make modules_prepare SKIP_STACK_VALIDATION=1 HOSTCFLAGS="-Wno-error" HOSTCXXFLAGS="-Wno-error" KCFLAGS="-Wno-error" KBUILD_CFLAGS_MODULE="-Wno-error" KBUILD_USERCFLAGS="-Wno-error" > /tmp/modules_prepare.log 2>&1 || { tail -200 /tmp/modules_prepare.log; exit 1; } | |
| [ -f /tmp/vmlinux ] && echo '✓ vmlinux built' | |
| [ -f /tmp/Module.symvers ] && echo '✓ Module.symvers present' || echo '! Module.symvers still missing; modpost warnings will be tolerated' | |
| - name: Build out-of-tree drivers | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| make KDIR=/tmp KBUILD_MODPOST_WARN=1 2>&1 | tee /tmp/build.log | |
| echo "=== Build log ===" | |
| tail -40 /tmp/build.log | |
| - name: Verify modules | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ERRORS=0 | |
| for mod in option.ko usb_wwan.ko qmi_wwan.ko; do | |
| found=$(find build/ -name "$mod" -print -quit 2>/dev/null || true) | |
| if [ -n "$found" ]; then | |
| echo "✓ $mod" | |
| else | |
| echo "✗ $mod NOT found" | |
| ERRORS=$((ERRORS + 1)) | |
| fi | |
| done | |
| if grep -E 'fatal error:' /tmp/build.log; then | |
| echo "✗ Compilation errors!" | |
| ERRORS=$((ERRORS + 1)) | |
| fi | |
| exit $ERRORS | |
| summary: | |
| needs: [setup, validate-patches, build-out-of-tree] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: | | |
| echo "## kernel ${{ needs.setup.outputs.kv }}" | |
| echo "patches: ${{ needs.validate-patches.result }}" | |
| echo "build: ${{ needs.build-out-of-tree.result }}" | |
| [ "${{ needs.validate-patches.result }}" = "success" ] && [ "${{ needs.build-out-of-tree.result }}" = "success" ] || exit 1 |