Skip to content

ci: build, smoke-test and release the Goke GK7101/GK7102 U-Boot - #21

Merged
dimerr merged 1 commit into
openipcfrom
ci/build-gk710x
Oct 18, 2026
Merged

dimerr merged 1 commit into
openipcfrom
ci/build-gk710x

Conversation

@dimerr

@dimerr dimerr commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Adds build-gk710x.yml for the new openipc-gk710x branch, plus README and CLAUDE.md entries.

  • Same job graph as build-xm.yml: resolve -> build (gk7101, gk7102) + qemu -> qemu_smoke -> release (gk710x tag) / publish (OpenIPC/firmware latest, openipc.org). NOR only; the 256 KiB size check includes the boot ROM header.
  • Smoke test: two boots on qemu-hisilicon's gk7101/gk7102 machines (qemu-hisilicon All plats capsule guid arr v4 u-boot/u-boot#159). The second boot must load the environment the first saved. The flash file is byte-swapped per 32-bit word, as the chip holds it.
  • openipc.org only accepts reports from allowlisted workflows (OpenIPC/website service/internal/builds/verify.go). build-gk710x.yml needs adding there before the first publish.

Tested: I ran the smoke step locally against both images with qemu-hisilicon master, and both pass.

Merge after #22. A PR against openipc builds the current openipc-gk710x, which is plain v2022.10 until #22 lands, so the gk7101/gk7102 build legs here fail with build.sh: No such file or directory until then. After #22 is merged, re-run this PR's checks. openipc-xm went in the same order (#13, then #14).

build-gk710x.yml is build-xm.yml for the openipc-gk710x branch: resolve
-> build (gk7101, gk7102) + qemu -> qemu_smoke -> release (gk710x tag) /
publish (OpenIPC/firmware latest, openipc.org). NOR only, 256 KiB boot
partition including the boot ROM header.

The smoke test boots each image from an 8 MiB flash image twice on
qemu-hisilicon's goke machines; the second boot must load the environment
the first saved. The flash file is written byte-swapped per 32-bit word,
as the chip holds it.

README and CLAUDE.md describe the family and the workflow. openipc.org
must allowlist build-gk710x.yml before the first publish.

The smoke step was run locally against both images with qemu-hisilicon
master: PASS for gk7101 and gk7102.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Build, smoke-test, and release GK7101/GK7102 U-Boot

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add CI builds for both GK710x NOR images, with a 256 KiB boot-partition limit.
• Gate manual releases and publishing on two QEMU boots that verify environment persistence.
• Document the new branch, flash byte order, and publishing prerequisite.
Diagram

graph TD
  Caller["CI or dispatch"] --> Resolve["Pin revision"] --> Build["Build NOR images"] --> Smoke{"Two boots pass?"} -->|manual release| Release["GK710x release"]
  Caller --> Qemu["Build QEMU"] --> Smoke -->|manual publish| Publish["Firmware and website"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Extract a shared family build workflow
  • ➕ Centralizes revision pinning, artifact handling, and publishing gates across SoC families.
  • ➖ Adds reusable-workflow inputs and indirection around family-specific image formats and QEMU boot behavior.

Recommendation: Use the family-specific workflow for this port: it follows an established release path while keeping the GK710x flash conversion and smoke test explicit. Consider extracting shared jobs if further families repeat the pattern. Allowlist build-gk710x.yml in OpenIPC/website before the first publish.

Files changed (3) +438 / -0

Documentation (2) +82 / -0
CLAUDE.mdDocument GK710x branch and CI invariants +26/-0

Document GK710x branch and CI invariants

• Adds the GK710x branch to the repository guide and records its NOR limit, QEMU smoke-test behavior, release destinations, and website allowlist prerequisite.

CLAUDE.md

README.mdDescribe GK710x images, builds, and CI +56/-0

Describe GK710x images, builds, and CI

• Adds a workflow badge and branch entry, then documents supported SoCs, boot-image and flash byte order, kernel hand-off, hardware-testing status, build commands, and release usage.

README.md

Other (1) +356 / -0
build-gk710x.ymlAdd gated GK7101/GK7102 build and distribution workflow +356/-0

Add gated GK7101/GK7102 build and distribution workflow

• Resolves a source SHA, builds and size-checks both NOR images, then smoke-tests each with two boots from byte-swapped flash in qemu-hisilicon. Manual inputs gate uploads to the GK710x release or OpenIPC/firmware latest and the openipc.org report.

.github/workflows/build-gk710x.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Vendor builds fail in the CI environment 📘 Rule violation ☼ Reliability
Description
The build leg installs only a subset of the required tools and never changes /bin/sh to bash. When
vendor recipes require pycryptodome, u-boot-tools, lzop, or bash-specific /bin/sh behavior,
the build can fail before producing its boot image.
Code

.github/workflows/build-gk710x.yml[R75-85]

+      - name: Install dependencies
+        timeout-minutes: 15
+        run: |
+          # apt mirrors on hosted runners intermittently HANG on the
+          # mirrorlist fetch (not just fail). Bound each attempt with its own
+          # `timeout` so a hang is killed fast and the retry actually fires.
+          install() {
+            sudo timeout 180 apt-get update && \
+            sudo timeout 240 apt-get install -y --no-install-recommends \
+              build-essential gcc-arm-linux-gnueabi device-tree-compiler \
+              bison flex bc libssl-dev python3
Evidence
The workflow's dependency installation includes device-tree-compiler but omits u-boot-tools,
lzop, and the Python package installation, and the build job contains no /bin/sh bash setup.
These are required by the checklist for every build leg.

CLAUDE.md: Provide required shell and build dependencies in CI: CLAUDE.md: Provide required shell and build dependencies in CI
.github/workflows/build-gk710x.yml[75-85]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The GK710x build leg does not install `u-boot-tools` or `lzop`, does not install `pycryptodome`, and does not point `/bin/sh` to bash as required by the vendor build recipes.
## Fix Focus Areas
- .github/workflows/build-gk710x.yml[75-85]
## Recommended Fix
Match the established build dependency setup by installing `u-boot-tools` and `lzop`, installing `pycryptodome` with pip, and creating the `/bin/sh` symlink to `/bin/bash` before invoking `build.sh`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Smoke setup can skip revision resolution 📘 Rule violation ☼ Reliability
Description
The qemu job has no needs: resolve, unlike the build job, so QEMU preparation is independent of
the resolved source job. A run can therefore start QEMU preparation before the revision is pinned,
leaving the declared resolve -> build + qemu graph unenforced.
Code

.github/workflows/build-gk710x.yml[R135-139]

+  # Build qemu-system-arm once and share it with every smoke leg.
+  qemu:
+    runs-on: ubuntu-latest
+    timeout-minutes: 45
+    steps:
Evidence
The workflow defines resolve and makes build depend on it, but the QEMU preparation job starts
without any needs dependency. This permits QEMU preparation to run before the required resolution
stage.

CLAUDE.md: Gate release and publication on successful QEMU smoke tests: CLAUDE.md: Gate release and publication on successful QEMU smoke tests
.github/workflows/build-gk710x.yml[135-139]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The QEMU preparation job is not dependent on `resolve`, so it can begin before the workflow pins the source revision even though the required job graph places `resolve` before both build and QEMU preparation.
## Fix Focus Areas
- .github/workflows/build-gk710x.yml[135-139]
## Recommended Fix
Add `needs: resolve` to the `qemu` job so revision resolution completes before QEMU preparation starts, while retaining the existing `qemu_smoke` dependency on both `build` and `qemu`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. The smoke test can miss failed saves 🐞 Bug ≡ Correctness
Description
qemu_smoke waits for the autoboot prompt and kills QEMU without issuing a save command or checking
that a save completed. If the first boot does not persist its environment, the second boot is judged
solely by the absence of the literal bad CRC message rather than by loading a value written on the
first boot.
Code

.github/workflows/build-gk710x.yml[R253-255]

+          if grep -q 'bad CRC' /tmp/uboot2.txt; then
+            echo "FAIL: the environment saved on the first boot did not land"
+            exit 1
Evidence
The flash starts erased outside the U-Boot image. The test only reads UART output and terminates
each boot at the prompt; its sole persistence assertion searches the second boot's output for one
error string.

.github/workflows/build-gk710x.yml[212-219]
.github/workflows/build-gk710x.yml[223-256]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The two-boot smoke test does not explicitly save an environment value or verify that the second boot loaded it.
## Fix Focus Areas
- .github/workflows/build-gk710x.yml[223-256]
## Recommended Fix
On the first boot, interrupt autoboot, set a distinctive environment variable, run the save command, and wait for confirmation before stopping QEMU. On the second boot, verify that the variable has the saved value.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. New releases miss the website record 🐞 Bug ≡ Correctness
Description
The publish job uploads assets before push_build.py reports them, but the new workflow is not
yet on the website's stated allowlist. Until that separate allowlist change is deployed, a manual
publish can update OpenIPC/firmware and then have its openipc.org report rejected.
Code

.github/workflows/build-gk710x.yml[R343-350]

+      - name: Report to openipc.org
+        env:
+          GK_SHA: ${{ needs.resolve.outputs.sha }}
+        run: |
+          set -eu
+          mkdir published
+          find artifacts -type f -name '*.bin' -exec cp {} published/ \;
+          python3 firmware/.github/scripts/push_build.py \
Evidence
The workflow performs the release upload before the website report. The PR's integration
documentation explicitly says the website accepts only allowlisted workflows and that this workflow
still needs to be added.

.github/workflows/build-gk710x.yml[308-328]
.github/workflows/build-gk710x.yml[340-356]
CLAUDE.md[95-101]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Publishing uploads release assets before reporting them, but the website does not yet accept reports from this workflow.
## Fix Focus Areas
- .github/workflows/build-gk710x.yml[308-356]
- CLAUDE.md[95-101]
## Recommended Fix
Add `build-gk710x.yml` to the OpenIPC/website workflow allowlist and deploy that change before the first publish run. Keep the publish input unused until the verifier accepts reports from this workflow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can move or hide resolved findings to focus on what still needs action

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +75 to +85
- name: Install dependencies
timeout-minutes: 15
run: |
# apt mirrors on hosted runners intermittently HANG on the
# mirrorlist fetch (not just fail). Bound each attempt with its own
# `timeout` so a hang is killed fast and the retry actually fires.
install() {
sudo timeout 180 apt-get update && \
sudo timeout 240 apt-get install -y --no-install-recommends \
build-essential gcc-arm-linux-gnueabi device-tree-compiler \
bison flex bc libssl-dev python3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Vendor builds fail in the ci environment 📘 Rule violation ☼ Reliability

The build leg installs only a subset of the required tools and never changes /bin/sh to bash. When
vendor recipes require pycryptodome, u-boot-tools, lzop, or bash-specific /bin/sh behavior,
the build can fail before producing its boot image.
Agent Prompt
## Issue description
The GK710x build leg does not install `u-boot-tools` or `lzop`, does not install `pycryptodome`, and does not point `/bin/sh` to bash as required by the vendor build recipes.

## Fix Focus Areas
- .github/workflows/build-gk710x.yml[75-85]

## Recommended Fix
Match the established build dependency setup by installing `u-boot-tools` and `lzop`, installing `pycryptodome` with pip, and creating the `/bin/sh` symlink to `/bin/bash` before invoking `build.sh`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +135 to +139
# Build qemu-system-arm once and share it with every smoke leg.
qemu:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Smoke setup can skip revision resolution 📘 Rule violation ☼ Reliability

The qemu job has no needs: resolve, unlike the build job, so QEMU preparation is independent of
the resolved source job. A run can therefore start QEMU preparation before the revision is pinned,
leaving the declared resolve -> build + qemu graph unenforced.
Agent Prompt
## Issue description
The QEMU preparation job is not dependent on `resolve`, so it can begin before the workflow pins the source revision even though the required job graph places `resolve` before both build and QEMU preparation.

## Fix Focus Areas
- .github/workflows/build-gk710x.yml[135-139]

## Recommended Fix
Add `needs: resolve` to the `qemu` job so revision resolution completes before QEMU preparation starts, while retaining the existing `qemu_smoke` dependency on both `build` and `qemu`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +253 to +255
if grep -q 'bad CRC' /tmp/uboot2.txt; then
echo "FAIL: the environment saved on the first boot did not land"
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

3. The smoke test can miss failed saves 🐞 Bug ≡ Correctness

qemu_smoke waits for the autoboot prompt and kills QEMU without issuing a save command or checking
that a save completed. If the first boot does not persist its environment, the second boot is judged
solely by the absence of the literal bad CRC message rather than by loading a value written on the
first boot.
Agent Prompt
## Issue description
The two-boot smoke test does not explicitly save an environment value or verify that the second boot loaded it.

## Fix Focus Areas
- .github/workflows/build-gk710x.yml[223-256]

## Recommended Fix
On the first boot, interrupt autoboot, set a distinctive environment variable, run the save command, and wait for confirmation before stopping QEMU. On the second boot, verify that the variable has the saved value.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +343 to +350
- name: Report to openipc.org
env:
GK_SHA: ${{ needs.resolve.outputs.sha }}
run: |
set -eu
mkdir published
find artifacts -type f -name '*.bin' -exec cp {} published/ \;
python3 firmware/.github/scripts/push_build.py \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

4. New releases miss the website record 🐞 Bug ≡ Correctness

The publish job uploads assets before push_build.py reports them, but the new workflow is not
yet on the website's stated allowlist. Until that separate allowlist change is deployed, a manual
publish can update OpenIPC/firmware and then have its openipc.org report rejected.
Agent Prompt
## Issue description
Publishing uploads release assets before reporting them, but the website does not yet accept reports from this workflow.

## Fix Focus Areas
- .github/workflows/build-gk710x.yml[308-356]
- CLAUDE.md[95-101]

## Recommended Fix
Add `build-gk710x.yml` to the OpenIPC/website workflow allowlist and deploy that change before the first publish run. Keep the publish input unused until the verifier accepts reports from this workflow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@dimerr
dimerr merged commit eb46237 into openipc Oct 18, 2026
77 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant