From 7eeca6d7621962bb54e72df9ce8899f02daf985b Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 16 Jun 2026 22:13:26 +0000 Subject: [PATCH 1/4] Added `make prepare` before Phase 1 `make modules` Co-authored-by: dianlight --- .github/workflows/main_build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index f66ae7c..449effd 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -433,6 +433,13 @@ jobs: fi echo "[INFO] Module build CROSS_COMPILE=${MODULE_CROSS_COMPILE}" + echo "[INFO] Running 'make prepare' for kernel module build ..." + make -C "${LINUX_SRC}" \ + ARCH="${ARCH}" \ + CROSS_COMPILE="${CROSS_COMPILE}" \ + prepare \ + 2>&1 | tail -60 + echo "[INFO] Building base kernel modules ..." make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ From 54464c5b3e3099ed7e8ddcdf155320d5a8eaa0cb Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Wed, 17 Jun 2026 20:44:43 +0000 Subject: [PATCH 2/4] Use consistent CROSS_COMPILE and modules_prepare across all build phases Key changes: - Phase 1: Use MODULE_CROSS_COMPILE (Buildroot toolchain) for both make modules_prepare and make modules, instead of mixing system and Buildroot toolchains - Phase 2 QUIC: Add make modules_prepare before make modules after source patching - Phase 2 ZFS: Resolve MODULE_CROSS_COMPILE earlier and use consistently throughout the step - All phases: Use modules_prepare (which generates module.lds) instead of bare prepare for module build preparation --- .github/workflows/main_build.yml | 39 ++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index 449effd..76cdbdf 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -433,11 +433,11 @@ jobs: fi echo "[INFO] Module build CROSS_COMPILE=${MODULE_CROSS_COMPILE}" - echo "[INFO] Running 'make prepare' for kernel module build ..." + echo "[INFO] Running 'make modules_prepare' for kernel module build ..." make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ - CROSS_COMPILE="${CROSS_COMPILE}" \ - prepare \ + CROSS_COMPILE="${MODULE_CROSS_COMPILE}" \ + modules_prepare \ 2>&1 | tail -60 echo "[INFO] Building base kernel modules ..." @@ -516,6 +516,13 @@ jobs: esac [[ -x "${MODULE_CROSS_COMPILE}gcc" ]] || MODULE_CROSS_COMPILE="${CROSS_COMPILE}" + echo "[INFO] Running 'make modules_prepare' for QUIC module build ..." + make -C "${LINUX_SRC}" \ + ARCH="${ARCH}" \ + CROSS_COMPILE="${MODULE_CROSS_COMPILE}" \ + modules_prepare \ + 2>&1 | tail -60 + make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ KBUILD_MODPOST_WARN=1 \ @@ -550,11 +557,20 @@ jobs: exit 0 fi + # Resolve Buildroot cross-compiler for ZFS build. + OS_DIR="${GITHUB_WORKSPACE}/operating-system" + case "${ARCH}" in + arm64) MODULE_CROSS_COMPILE="${OS_DIR}/output/host/bin/aarch64-buildroot-linux-gnu-" ;; + x86) MODULE_CROSS_COMPILE="${OS_DIR}/output/host/bin/x86_64-buildroot-linux-gnu-" ;; + *) MODULE_CROSS_COMPILE="${CROSS_COMPILE}" ;; + esac + [[ -x "${MODULE_CROSS_COMPILE}gcc" ]] || MODULE_CROSS_COMPILE="${CROSS_COMPILE}" + # ZFS configure needs utsrelease.h from 'make prepare'. echo "[INFO] Running 'make prepare' for ZFS configure ..." make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ - CROSS_COMPILE="${CROSS_COMPILE}" \ + CROSS_COMPILE="${MODULE_CROSS_COMPILE}" \ prepare \ 2>&1 | tail -60 @@ -610,17 +626,16 @@ jobs: make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ - CROSS_COMPILE="${CROSS_COMPILE}" \ + CROSS_COMPILE="${MODULE_CROSS_COMPILE}" \ olddefconfig \ 2>&1 | tail -30 - OS_DIR="${GITHUB_WORKSPACE}/operating-system" - case "${ARCH}" in - arm64) MODULE_CROSS_COMPILE="${OS_DIR}/output/host/bin/aarch64-buildroot-linux-gnu-" ;; - x86) MODULE_CROSS_COMPILE="${OS_DIR}/output/host/bin/x86_64-buildroot-linux-gnu-" ;; - *) MODULE_CROSS_COMPILE="${CROSS_COMPILE}" ;; - esac - [[ -x "${MODULE_CROSS_COMPILE}gcc" ]] || MODULE_CROSS_COMPILE="${CROSS_COMPILE}" + echo "[INFO] Running 'make modules_prepare' for ZFS module build ..." + make -C "${LINUX_SRC}" \ + ARCH="${ARCH}" \ + CROSS_COMPILE="${MODULE_CROSS_COMPILE}" \ + modules_prepare \ + 2>&1 | tail -60 make -C "${LINUX_SRC}" \ ARCH="${ARCH}" \ From 351531bc87a78e04126d5c49a7854f5794cd24d8 Mon Sep 17 00:00:00 2001 From: dianlight Date: Thu, 18 Jun 2026 16:25:03 +0200 Subject: [PATCH 3/4] fix(ci): patch Kconfig as well as Makefile when removing legacy rp1-cfe/ Why this change was needed: The previous dedup step removed rp1-cfe/ and patched the parent Makefile, but left the parent Kconfig untouched. olddefconfig parses Kconfig files before any compilation starts, so it died with "can't open file rp1-cfe/Kconfig" on all three RPi boards (rpi3_64, rpi4_64, rpi5_64). What changed: Added sed -i '/rp1-cfe/d' on the parent Kconfig alongside the existing Makefile patch, and updated the log message accordingly. Problem solved: All RPi board builds no longer fail with "can't open file" during olddefconfig when both rp1-cfe/ and rp1_cfe/ co-exist in the kernel tree. Co-Authored-By: Claude --- .github/workflows/main_build.yml | 45 +++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index f045e0f..bfa274f 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -58,12 +58,48 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Resolve explicit board list from workflow_dispatch input or repository_dispatch payload. + # ── Priority order for board selection ────────────────────────────── + # 1. workflow_dispatch input → explicit user choice + # 2. repository_dispatch payload → caller-specified list + # 3. pull_request event → parse "boards: " from PR body, + # fall back to default fast-CI set, + # or "all" to build every board + # 4. everything else (schedule, push) → auto-detect from HAOS repo + # ──────────────────────────────────────────────────────────────────── + + PR_DEFAULT_BOARDS="generic_aarch64,generic_x86_64,rpi4_64" + BOARDS_INPUT="${{ github.event.inputs.boards }}" + if [[ -z "${BOARDS_INPUT}" && "${{ github.event_name }}" == "repository_dispatch" ]]; then BOARDS_INPUT="${{ github.event.client_payload.boards }}" fi + if [[ -z "${BOARDS_INPUT}" && "${{ github.event_name }}" == "pull_request" ]]; then + # Extract "boards: " from the PR body (case-insensitive, first match). + PR_BODY=$(cat <<'PR_BODY_EOF' +${{ github.event.pull_request.body }} +PR_BODY_EOF +) + BOARDS_INPUT=$(echo "${PR_BODY}" \ + | grep -iE '^[[:space:]]*boards[[:space:]]*:[[:space:]]*' \ + | head -1 \ + | sed -E 's/^[[:space:]]*boards[[:space:]]*:[[:space:]]*//i' \ + | tr -d '\r') + + if [[ -z "${BOARDS_INPUT}" ]]; then + # No "boards:" line in PR body — use the default fast-CI set. + BOARDS_INPUT="${PR_DEFAULT_BOARDS}" + echo "[INFO] PR body has no 'boards:' line — using default: ${BOARDS_INPUT}" + elif [[ "${BOARDS_INPUT,,}" == "all" ]]; then + # Explicit "all" — clear the input so the auto-detect path runs below. + BOARDS_INPUT="" + echo "[INFO] PR body specifies 'all' — detecting all boards from HAOS repo." + else + echo "[INFO] PR body specifies boards: ${BOARDS_INPUT}" + fi + fi + if [[ -n "${BOARDS_INPUT}" ]]; then # Convert comma-separated list to a sorted JSON array, stripping whitespace. BOARDS=$(echo "${BOARDS_INPUT}" \ @@ -409,9 +445,12 @@ jobs: if [[ -d "${RPI_MEDIA}/rp1-cfe" && -d "${RPI_MEDIA}/rp1_cfe" ]]; then echo "[INFO] Both rp1-cfe/ and rp1_cfe/ found — removing legacy rp1-cfe/" rm -rf "${RPI_MEDIA}/rp1-cfe" - # Drop the legacy entry from the parent Makefile to avoid dangling obj- lines. + # Drop the legacy entry from both Makefile (obj- line) and Kconfig + # (source line). olddefconfig reads Kconfig before any compilation, + # so both files must be cleaned up or it fails with "can't open file". sed -i '/rp1-cfe/d' "${RPI_MEDIA}/Makefile" || true - echo "[INFO] rp1-cfe/ removed successfully." + sed -i '/rp1-cfe/d' "${RPI_MEDIA}/Kconfig" || true + echo "[INFO] rp1-cfe/ removed and parent Makefile/Kconfig patched." else echo "[INFO] No rp1-cfe/rp1_cfe duplicate detected, nothing to do." fi From 57eafb1148818c2b9ef6729cadf9fb20f36298ff Mon Sep 17 00:00:00 2001 From: dianlight Date: Thu, 18 Jun 2026 16:30:04 +0200 Subject: [PATCH 4/4] fix(ci): move PR body into env var to fix YAML parse error on line 81 Why this change was needed: The heredoc pattern used to capture github.event.pull_request.body placed a ${{ }} expression and the PR_BODY_EOF delimiter at column 0 inside the run: | block. YAML block scalars terminate at any line with lower indentation than the block content, so the parser saw those lines as outside the scalar and raised a syntax error on line 81. What changed: PR_BODY is now declared in the step's env: map as PR_BODY: ${{ github.event.pull_request.body }} and the run: script reads it directly from the environment variable. The heredoc and its delimiters are gone entirely. Problem solved: The workflow file is valid YAML again. GitHub Actions safely handles multi-line PR body values (newlines, special chars) through env vars without any YAML quoting issues. Co-Authored-By: Claude --- .github/workflows/main_build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_build.yml b/.github/workflows/main_build.yml index 2b97e7d..1e3b0f5 100644 --- a/.github/workflows/main_build.yml +++ b/.github/workflows/main_build.yml @@ -57,6 +57,10 @@ jobs: id: detect env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Pass PR body as an env var to avoid embedding ${{ }} expressions + # inside the run: | block at column-0 (which terminates the YAML + # block scalar prematurely and causes a static YAML parse error). + PR_BODY: ${{ github.event.pull_request.body }} run: | # ── Priority order for board selection ────────────────────────────── # 1. workflow_dispatch input → explicit user choice @@ -77,10 +81,7 @@ jobs: if [[ -z "${BOARDS_INPUT}" && "${{ github.event_name }}" == "pull_request" ]]; then # Extract "boards: " from the PR body (case-insensitive, first match). - PR_BODY=$(cat <<'PR_BODY_EOF' -${{ github.event.pull_request.body }} -PR_BODY_EOF -) + # PR_BODY is injected via env: above to avoid YAML block-scalar issues. BOARDS_INPUT=$(echo "${PR_BODY}" \ | grep -iE '^[[:space:]]*boards[[:space:]]*:[[:space:]]*' \ | head -1 \