From 01c75f0c5842216c66cb41d0d4235304dc78aee1 Mon Sep 17 00:00:00 2001 From: Riko Date: Sun, 25 Oct 2026 11:49:39 -0700 Subject: [PATCH] Phicomm N1: newer Cypress Wi-Fi firmware for channels 36-48 under CN The image's BCM43455 firmware (7.45.154) and Broadcom master CLM leave channels 36-144 disabled under CN, so wlan0 cannot join a car hotspot on 36-48. The device package now ships the unmodified linux-firmware cypress/cyfmac43455-sdio.{bin,clm_blob} (7.45.286, commit a137a09be163) as the board-specific files in /usr/lib/firmware/updates/brcm, which the kernel reads before /lib/firmware. The image's own files stay untouched; removing the package restores them at the next boot. The files and LICENCE.cypress are pinned in install/firmware.txt, fetched and verified by the release workflow, verified again by build-deb.sh, and recorded in SOURCES.txt. Signed-off-by: Riko --- .../workflows/release-phicomm-n1-device.yml | 7 +- PhicommN1/README-zh.md | 10 +- PhicommN1/README.md | 10 +- PhicommN1/install/firmware.txt | 9 ++ PhicommN1/package/build-bundle.sh | 17 ++- PhicommN1/package/build-deb.sh | 57 +++++++++- PhicommN1/package/debian/postinst | 2 +- PhicommN1/package/tests/chroot-test.sh | 50 ++++++++- PhicommN1/package/tests/fixtures.py | 30 +++++ PhicommN1/package/tests/installer-test.py | 105 +++++++++++++++++- UFI003/package/release-common.sh | 30 +++++ UFI003/package/tests/release-test.py | 52 +++++++++ 12 files changed, 351 insertions(+), 28 deletions(-) create mode 100644 PhicommN1/install/firmware.txt diff --git a/.github/workflows/release-phicomm-n1-device.yml b/.github/workflows/release-phicomm-n1-device.yml index bf8faa6..5479715 100644 --- a/.github/workflows/release-phicomm-n1-device.yml +++ b/.github/workflows/release-phicomm-n1-device.yml @@ -49,11 +49,15 @@ jobs: run: | . UFI003/package/release-common.sh phicomm_n1_fetch_debs PhicommN1/install/debs.txt "$RUNNER_TEMP/debs" + - name: Fetch and verify pinned firmware + run: | + . UFI003/package/release-common.sh + phicomm_n1_fetch_firmware PhicommN1/install/firmware.txt "$RUNNER_TEMP/firmware" - name: Build bundle env: DEBVERSION: ${{ steps.version.outputs.debversion }} run: | - sh PhicommN1/package/build-bundle.sh --version "$DEBVERSION" "$RUNNER_TEMP/debs" "$RUNNER_TEMP/dist" + sh PhicommN1/package/build-bundle.sh --version "$DEBVERSION" --firmware "$RUNNER_TEMP/firmware" "$RUNNER_TEMP/debs" "$RUNNER_TEMP/dist" - name: Check bundle and checksum release files env: DEBVERSION: ${{ steps.version.outputs.debversion }} @@ -108,6 +112,7 @@ jobs: printf '\nBuilt from OpenXPlay-Hardware@%s\n\n' "$(git rev-parse HEAD)" printf -- '- `%s`\n' "$asset" SHA256SUMS printf '\nThe bundle carries unmodified Debian 13 packages whose sources are named in SOURCES.txt. OpenXPlay-Hardware is under the OpenXPlay-Hardware License 1.0 (no commercial use).\n' + printf '\nThe device package carries unmodified Cypress Wi-Fi firmware from linux-firmware under LICENCE.cypress.\n' } > "$notes" cd "$RUNNER_TEMP/release" sha256sum -c SHA256SUMS || { echo '::error::Release artifact checksum mismatch'; exit 1; } diff --git a/PhicommN1/README-zh.md b/PhicommN1/README-zh.md index 491ac3f..cde2d78 100644 --- a/PhicommN1/README-zh.md +++ b/PhicommN1/README-zh.md @@ -9,15 +9,15 @@ Created by riko chen on 2026-10-21 斐讯 N1 电视盒子(晶晨 S905D)的支持文件,适用于从 eMMC 运行 ophub Armbian(Debian 13,内核 6.12)的设备。 -`package/` 构建设备包,以及 OpenXPlay Flasher 通过网络 SSH 安装的离线设备整合包。设备包安装主机配置,并修复两个板级问题:把以太网 PHY 的 ID 写入启动设备树(内核更新后会重新写入),使每次开机都能识别 PHY;给 wlan0 和蓝牙控制器换成由出厂以太网 MAC 推导的地址,取代所有 N1 共用的地址: +`package/` 构建设备包,以及 OpenXPlay Flasher 通过网络 SSH 安装的离线设备整合包。设备包安装主机配置,把以太网 PHY 的 ID 写入启动设备树(内核更新后会重新写入),并给 wlan0 和蓝牙控制器换成由出厂以太网 MAC 推导的地址。它还为板载 BCM43455 安装较新的 Cypress Wi-Fi 固件,使 wlan0 在 CN 监管域下可以使用 5 GHz 信道 36-48。 ```sh -sh package/build-deb.sh out -sh package/build-bundle.sh --version 0.1.0 /path/to/debs out +sh package/build-deb.sh --firmware /path/to/firmware out +sh package/build-bundle.sh --version 0.1.0 --firmware /path/to/firmware /path/to/debs out ``` -构建需要 Linux 上的 `dpkg-deb`,或已缓存的 `debian:trixie` Docker 镜像。将 `install/debs.txt` 固定版本的 Debian 包放到 `/path/to/debs`,支持 `arm64` 和 `all`。清单列出全新 ophub Debian 13 服务器镜像缺少、而设备包和中继包需要的软件包,因此整合包可以离线安装。构建和安装脚本均不下载软件包。`--sources DIR` 可带入本地 Debian 源码归档,`SOURCES.txt` 记录对应源码位置。 +构建需要 Linux 上的 `dpkg-deb`,或已缓存的 `debian:trixie` Docker 镜像。将 `install/debs.txt` 固定版本的 Debian 包放到 `/path/to/debs`,支持 `arm64` 和 `all`。将 `install/firmware.txt` 固定的未修改固件和许可证文件按上游文件名放到 `/path/to/firmware`。Debian 清单列出全新 ophub Debian 13 服务器镜像缺少、而设备包和中继包需要的软件包,因此整合包可以离线安装。构建会校验所有固件哈希;构建和安装脚本均不下载文件。`--sources DIR` 可带入本地 Debian 源码归档,`SOURCES.txt` 记录源码位置和固件来源。 ## 许可证 -本目录全部内容与本仓库其余部分一样采用 [OpenXPlay-Hardware License](../LICENSE)。 +本目录文件采用 [OpenXPlay-Hardware License](../LICENSE)。打包的 Cypress 固件采用 LICENCE.cypress,许可证全文包含在设备包中。 diff --git a/PhicommN1/README.md b/PhicommN1/README.md index 09409c0..d7b3929 100644 --- a/PhicommN1/README.md +++ b/PhicommN1/README.md @@ -9,15 +9,15 @@ Created by riko chen on 2026-10-21 Support files for the Phicomm N1 TV box (Amlogic S905D) running ophub Armbian (Debian 13, kernel 6.12) from eMMC. -`package/` builds the device package and the offline device bundle that the OpenXPlay Flasher installs over SSH on the network. The package installs the host profile and fixes two board problems: it writes the Ethernet PHY's ID into the boot device tree (again after kernel updates), so the PHY is found on every boot, and it gives wlan0 and the Bluetooth controller addresses derived from the factory Ethernet MAC instead of the ones every N1 shares: +`package/` builds the device package and the offline device bundle that the OpenXPlay Flasher installs over SSH on the network. The package installs the host profile, writes the Ethernet PHY's ID into the boot device tree (again after kernel updates), and gives wlan0 and the Bluetooth controller addresses derived from the factory Ethernet MAC. It also installs newer Cypress Wi-Fi firmware for the onboard BCM43455 so wlan0 can use 5 GHz channels 36-48 under the CN regulatory domain. ```sh -sh package/build-deb.sh out -sh package/build-bundle.sh --version 0.1.0 /path/to/debs out +sh package/build-deb.sh --firmware /path/to/firmware out +sh package/build-bundle.sh --version 0.1.0 --firmware /path/to/firmware /path/to/debs out ``` -Builds need `dpkg-deb` on Linux, or a cached `debian:trixie` Docker image. Put the pinned Debian binaries from `install/debs.txt` in `/path/to/debs`; both `arm64` and `all` packages are accepted. The list holds what the device and relay packages need that a fresh ophub Debian 13 server image lacks, so the bundle installs offline. No build or installer downloads packages. `--sources DIR` includes local Debian source archives; `SOURCES.txt` records corresponding source locations. +Builds need `dpkg-deb` on Linux, or a cached `debian:trixie` Docker image. Put the pinned Debian binaries from `install/debs.txt` in `/path/to/debs`; both `arm64` and `all` packages are accepted. Put the unmodified firmware and licence files pinned in `install/firmware.txt` in `/path/to/firmware`, using their upstream basenames. The Debian list holds what the device and relay packages need that a fresh ophub Debian 13 server image lacks, so the bundle installs offline. Builds verify all firmware hashes; no build or installer downloads files. `--sources DIR` includes local Debian source archives; `SOURCES.txt` records source locations and firmware provenance. ## License -Everything here is under the [OpenXPlay-Hardware License](../LICENSE) like the rest of this repository. +Files here use the [OpenXPlay-Hardware License](../LICENSE). The packaged Cypress firmware uses LICENCE.cypress, included in the device package. diff --git a/PhicommN1/install/firmware.txt b/PhicommN1/install/firmware.txt new file mode 100644 index 0000000..639c770 --- /dev/null +++ b/PhicommN1/install/firmware.txt @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2026 OpenXPlay.org +# SPDX-License-Identifier: LicenseRef-OpenXPlay-Hardware-1.0 +# Created by riko chen on 2026-10-26 +# linux-firmware commit upstream-path sha256; files are unmodified upstream objects. +# Cypress 7.45.286 firmware and CLM enable BCM43455 5 GHz channels 36-48 under CN. +# LICENCE.cypress permits object-code redistribution for use with Cypress chips. +a137a09be163c5e3fc6e96ba3bfb9eb328394c34 cypress/cyfmac43455-sdio.bin eaff8d2b6d2501bb5c477ba343900c7487af915898eac13bc91b33b1285dadce +a137a09be163c5e3fc6e96ba3bfb9eb328394c34 cypress/cyfmac43455-sdio.clm_blob 8fbe9fc2952e2fbab062a142c1ea3e261cd74604761e12f304781b911df4a328 +a137a09be163c5e3fc6e96ba3bfb9eb328394c34 LICENSES/LICENCE.cypress ae0db6cc4db33941148df0f67de53e76a77b1b5a46b3165edb7040aa2750015f diff --git a/PhicommN1/package/build-bundle.sh b/PhicommN1/package/build-bundle.sh index 7b83a96..0553736 100755 --- a/PhicommN1/package/build-bundle.sh +++ b/PhicommN1/package/build-bundle.sh @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2026 OpenXPlay.org # SPDX-License-Identifier: LicenseRef-OpenXPlay-Hardware-1.0 # Created by riko chen on 2026-10-21 -# Usage: build-bundle.sh [--version VERSION] [--sources DIR] DEBS_DIR OUTPUT_DIR +# Usage: build-bundle.sh [--version VERSION] [--sources DIR] --firmware DIR DEBS_DIR OUTPUT_DIR # All inputs are local. debs/debs.txt preserves dependency order for the offline installer. set -eu here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) @@ -11,14 +11,17 @@ repo=$(dirname "$n1") fail() { echo "Error: $*" >&2; exit 1; } version=0.1.0 sources= +firmware= while [ "$#" -gt 2 ]; do case "$1" in --version) version=$2; shift 2 ;; --sources) sources=$(CDPATH= cd -- "$2" && pwd); shift 2 ;; + --firmware) firmware=$(CDPATH= cd -- "$2" && pwd); shift 2 ;; *) fail "Unknown option: $1" ;; esac done -[ "$#" -eq 2 ] || fail "Usage: $0 [--version VERSION] [--sources DIR] DEBS_DIR OUTPUT_DIR" +[ "$#" -eq 2 ] && [ -n "$firmware" ] || + fail "Usage: $0 [--version VERSION] [--sources DIR] --firmware DIR DEBS_DIR OUTPUT_DIR" case "$version" in ''|*[!0-9A-Za-z.+~-]*|[!0-9]*) fail "Invalid Debian version: $version" ;; esac debs=$(CDPATH= cd -- "$1" && pwd) mkdir -p "$2" @@ -69,7 +72,7 @@ while read -r pkg ver digest extra || [ -n "$pkg" ]; do [ -n "$found" ] || fail "Missing pinned .deb: $pkg $ver (arm64 or all)" cp -f "$found" "$root/debs/" done < "$n1/install/debs.txt" -sh "$here/build-deb.sh" --version "$version" "$root/debs" >&2 +sh "$here/build-deb.sh" --version "$version" --firmware "$firmware" "$root/debs" >&2 device=$root/debs/openxplay-phicomm-n1_${version}_all.deb # Keep the generated device package last, after all pinned dependencies (including an empty list). printf '\nopenxplay-phicomm-n1 %s %s\n' "$version" "$(sum "$device")" >> "$root/debs/debs.txt" @@ -94,6 +97,14 @@ fi done echo echo 'openxplay-phicomm-n1: https://github.com/OpenXPlay/OpenXPlay-Hardware (PhicommN1/).' + echo + echo 'Unmodified Cypress Wi-Fi firmware and LICENCE.cypress from linux-firmware:' + # Match the builder's test-only fixture pins; production always records the committed list. + while read -r commit path digest extra || [ -n "$commit" ]; do + case "$commit" in ''|'#'*) continue ;; esac + printf 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/%s?id=%s sha256 %s\n' \ + "$path" "$commit" "$digest" + done < "${OPENXPLAY_N1_TEST_FIRMWARE_PINS:-$n1/install/firmware.txt}" } > "$root/SOURCES.txt" json() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'; } { diff --git a/PhicommN1/package/build-deb.sh b/PhicommN1/package/build-deb.sh index 65ffe94..d0e3a79 100755 --- a/PhicommN1/package/build-deb.sh +++ b/PhicommN1/package/build-deb.sh @@ -3,24 +3,50 @@ # SPDX-License-Identifier: LicenseRef-OpenXPlay-Hardware-1.0 # Created by riko chen on 2026-10-21 # Builds openxplay-phicomm-n1__all.deb. No relay or kernel binaries. -# Usage: build-deb.sh [--version VERSION] OUTPUT_DIR +# Usage: build-deb.sh [--version VERSION] --firmware DIR OUTPUT_DIR set -eu here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) n1=$(dirname "$here") repo=$(dirname "$n1") fail() { echo "Error: $*" >&2; exit 1; } version=0.1.0 +firmware= inside=false while [ "$#" -gt 1 ]; do case "$1" in --version) version=$2; shift 2 ;; + --firmware) firmware=$2; shift 2 ;; --inside) inside=true; shift ;; *) break ;; esac done -[ "$#" -eq 1 ] || fail "Usage: $0 [--version VERSION] OUTPUT_DIR" +[ "$#" -eq 1 ] && [ -n "$firmware" ] || fail "Usage: $0 [--version VERSION] --firmware DIR OUTPUT_DIR" case "$version" in ''|*[!0-9A-Za-z.+~-]*|[!0-9]*) fail "Invalid Debian version: $version" ;; esac out=$1 +firmware=$(CDPATH= cd -- "$firmware" && pwd) || fail 'Missing firmware directory' +sum() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$1"; else shasum -a 256 "$1"; fi | cut -d' ' -f1; } +# Test-only fixture pins replace the inputs, never the checks. Production uses the committed list. +firmware_pins=${OPENXPLAY_N1_TEST_FIRMWARE_PINS:-$n1/install/firmware.txt} +seen=' ' +while read -r commit path digest extra || [ -n "$commit" ]; do + case "$commit" in ''|'#'*) continue ;; esac + [ -z "$extra" ] && printf '%s\n' "$commit" | LC_ALL=C grep -Eq '^[0-9a-fA-F]{40}$' && + printf '%s\n' "$path" | LC_ALL=C grep -Eq '^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*$' && + printf '%s\n' "$digest" | LC_ALL=C grep -Eq '^[0-9a-fA-F]{64}$' || fail "Invalid firmware.txt row: $commit" + case "/$path/" in *..*|*/./*) fail "Invalid firmware path: $path" ;; esac + base=${path##*/} + case "$base" in cyfmac43455-sdio.bin|cyfmac43455-sdio.clm_blob|LICENCE.cypress) ;; + *) fail "Unexpected pinned firmware file: $base" ;; + esac + case "$seen" in *" $base "*) fail "Duplicate firmware basename: $base" ;; esac + seen="$seen$base " + [ ! -L "$firmware/$base" ] || fail "Symlink firmware input: $base" + [ -f "$firmware/$base" ] || fail "Missing regular firmware file: $base" + [ "$(sum "$firmware/$base")" = "$(printf '%s' "$digest" | tr 'A-F' 'a-f')" ] || fail "SHA-256 mismatch: $base" +done < "$firmware_pins" +for base in cyfmac43455-sdio.bin cyfmac43455-sdio.clm_blob LICENCE.cypress; do + case "$seen" in *" $base "*) ;; *) fail "Missing firmware pin: $base" ;; esac +done SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-$(git -C "$repo" log -1 --format=%ct 2>/dev/null || echo 1792540800)} case "$SOURCE_DATE_EPOCH" in ''|*[!0-9]*) fail 'SOURCE_DATE_EPOCH must be an integer' ;; esac export SOURCE_DATE_EPOCH @@ -32,11 +58,21 @@ if ! command -v dpkg-deb >/dev/null 2>&1; then stream=$(mktemp -d) trap 'rm -rf "$stream"' 0 trap 'exit 1' HUP INT TERM + mkdir "$stream/firmware" + for base in cyfmac43455-sdio.bin cyfmac43455-sdio.clm_blob LICENCE.cypress; do + cp -f "$firmware/$base" "$stream/firmware/$base" + done + if [ -n "${OPENXPLAY_N1_TEST_FIRMWARE_PINS:-}" ]; then + cp -f "$firmware_pins" "$stream/firmware/test-pins.txt" + export OPENXPLAY_N1_TEST_FIRMWARE_PINS=/work/firmware/test-pins.txt + fi COPYFILE_DISABLE=1 tar --no-xattrs -cf "$stream/input.tar" -C "$repo" LICENSE PhicommN1 + COPYFILE_DISABLE=1 tar --no-xattrs -rf "$stream/input.tar" -C "$stream" firmware if ! docker run -i --rm --pull=never --network=none --platform linux/arm64 -e SOURCE_DATE_EPOCH \ + -e OPENXPLAY_N1_TEST_FIRMWARE_PINS \ debian:trixie sh -c \ "mkdir -p /work /out && tar -xf - -C /work && - sh /work/PhicommN1/package/build-deb.sh --inside --version '$version' /out >&2 && + sh /work/PhicommN1/package/build-deb.sh --inside --version '$version' --firmware /work/firmware /out >&2 && tar -cf - -C /out ." < "$stream/input.tar" > "$stream/output.tar"; then fail 'Container build failed' fi @@ -62,6 +98,9 @@ put 0644 "$n1/wifi/70-openxplay-n1-wifi-mac.rules" /lib/udev/rules.d/70-openxpla doc=$root/usr/share/doc/openxplay-phicomm-n1 install -d "$doc" "$root/DEBIAN" install -m 0644 "$repo/LICENSE" "$doc/LICENSE" +put 0644 "$firmware/cyfmac43455-sdio.bin" /usr/lib/firmware/updates/brcm/brcmfmac43455-sdio.phicomm,n1.bin +put 0644 "$firmware/cyfmac43455-sdio.clm_blob" /usr/lib/firmware/updates/brcm/brcmfmac43455-sdio.phicomm,n1.clm_blob +install -m 0644 "$firmware/LICENCE.cypress" "$doc/LICENCE.cypress" cat > "$doc/copyright" < "$ctl/md5sums" diff --git a/PhicommN1/package/debian/postinst b/PhicommN1/package/debian/postinst index 955650c..c3296b8 100755 --- a/PhicommN1/package/debian/postinst +++ b/PhicommN1/package/debian/postinst @@ -26,7 +26,7 @@ configure|abort-upgrade|abort-deconfigure|abort-remove) deb-systemd-invoke start bluetooth.service >/dev/null || : fi if [ "$1" = configure ]; then - echo 'openxplay-phicomm-n1: the Ethernet PHY fix and the per-device Wi-Fi and Bluetooth addresses take effect at the next boot.' + echo 'openxplay-phicomm-n1: the Ethernet PHY fix, Wi-Fi firmware and per-device Wi-Fi and Bluetooth addresses take effect at the next boot.' fi ;; esac diff --git a/PhicommN1/package/tests/chroot-test.sh b/PhicommN1/package/tests/chroot-test.sh index 14104d8..d4216d0 100755 --- a/PhicommN1/package/tests/chroot-test.sh +++ b/PhicommN1/package/tests/chroot-test.sh @@ -26,12 +26,23 @@ if [ "${1:-}" != --inside ]; then work=$(mktemp -d) trap 'rm -rf "$work"' 0 trap 'exit 1' HUP INT TERM - sh "$here/../build-deb.sh" "$work/debs" + mkdir "$work/firmware" + for base in cyfmac43455-sdio.bin cyfmac43455-sdio.clm_blob LICENCE.cypress; do + printf 'test-only %s\n' "$base" > "$work/firmware/$base" + path=cypress/$base + if [ "$base" = LICENCE.cypress ]; then path=LICENSES/$base; fi + printf 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa %s %s\n' "$path" \ + "$(sha256sum "$work/firmware/$base" | cut -d' ' -f1)" >> "$work/firmware/pins.txt" + done + OPENXPLAY_N1_TEST_FIRMWARE_PINS=$work/firmware/pins.txt \ + sh "$here/../build-deb.sh" --firmware "$work/firmware" "$work/debs" COPYFILE_DISABLE=1 tar --no-xattrs -cf "$work/test.tar" -C "$repo" LICENSE PhicommN1 - tar -rf "$work/test.tar" -C "$work" debs + COPYFILE_DISABLE=1 tar --no-xattrs -rf "$work/test.tar" -C "$work" debs firmware docker run -i --rm --pull=never --network=none --platform linux/arm64 \ -e OPENXPLAY_N1_CHROOT_TEST=1 debian:trixie \ - sh -c 'mkdir /work && tar -xf - -C /work && sh /work/PhicommN1/package/tests/chroot-test.sh --inside' < "$work/test.tar" + sh -c 'mkdir /work && tar -xf - -C /work && + export OPENXPLAY_N1_TEST_FIRMWARE_PINS=/work/firmware/pins.txt && + sh /work/PhicommN1/package/tests/chroot-test.sh --inside' < "$work/test.tar" exit 0 fi [ "${OPENXPLAY_N1_CHROOT_TEST:-}" = 1 ] && [ -d /work/debs ] || { @@ -98,7 +109,7 @@ EOF deb=$inputs/oxp-test-pinned-runtime_1.0_all.deb dpkg-deb --root-owner-group -b /work/pinned-runtime "$deb" >/dev/null printf 'oxp-test-pinned-runtime 1.0 %s\n' "$(sha256sum "$deb" | cut -d' ' -f1)" > "$source/PhicommN1/install/debs.txt" -sh "$source/PhicommN1/package/build-bundle.sh" "$inputs" /work/bundles >/work/bundle.log 2>&1 || { +sh "$source/PhicommN1/package/build-bundle.sh" --firmware /work/firmware "$inputs" /work/bundles >/work/bundle.log 2>&1 || { cat /work/bundle.log; exit 1; } bundle=/work/bundles/openxplay-phicomm-n1-device-0.1.0 @@ -127,12 +138,37 @@ helper_state() { find /var/lib/systemd -path '*deb-systemd-helper*' \( -name 'op units='openxplay-n1-phy-id.service openxplay-n1-phy-id.path openxplay-n1-bt-addr.service' check 'container is not booted with systemd' test ! -d /run/systemd/system unit_links > /work/units-before +# Model the image's unowned firmware, which dpkg must never replace or remove. +image_firmware=/usr/lib/firmware/brcm/brcmfmac43455-sdio.phicomm,n1.bin +mkdir -p "$(dirname "$image_firmware")" +printf 'original image firmware\n' > /work/image-firmware +cp -f /work/image-firmware "$image_firmware" dpkg -i /work/debs/openxplay-phicomm-n1_*_all.deb >/work/install.log 2>&1 || { cat /work/install.log; exit 1; } check 'package installed' sh -c '[ "$(dpkg-query -W -f="\${Status} \${Version}" openxplay-phicomm-n1)" = "install ok installed 0.1.0" ]' check 'package files unmodified' sh -c '[ -z "$(dpkg -V openxplay-phicomm-n1)" ]' check 'dpkg audit clean' sh -c '[ -z "$(dpkg --audit)" ]' check 'host profile conffile' sh -c 'dpkg-query -W -f="\${Conffiles}" openxplay-phicomm-n1 | grep -q /etc/openxplay/host.json' check 'host profile bytes' cmp /etc/openxplay/host.json "$here/../../host.json" +check 'install preserves image firmware' cmp /work/image-firmware "$image_firmware" +updates=/usr/lib/firmware/updates/brcm/brcmfmac43455-sdio.phicomm,n1 +for extension in bin clm_blob; do + check "firmware bytes: $extension" cmp "$updates.$extension" "/work/firmware/cyfmac43455-sdio.$extension" + check "firmware mode: $extension" test "$(stat -c %a "$updates.$extension")" = 644 +done +printf '%s.bin\n%s.clm_blob\n' "$updates" "$updates" > /work/firmware-expected +dpkg-query -L openxplay-phicomm-n1 | grep '^/usr/lib/firmware/updates/brcm/.' | sort > /work/firmware-actual +check 'exactly two updates firmware files' cmp /work/firmware-expected /work/firmware-actual +check 'package ships no image firmware paths' sh -c '! dpkg-query -L openxplay-phicomm-n1 | grep -E "^/lib/firmware(/|$)|^/usr/lib/firmware/brcm(/|$)"' +doc=/usr/share/doc/openxplay-phicomm-n1 +check 'Cypress licence bytes' cmp "$doc/LICENCE.cypress" /work/firmware/LICENCE.cypress +check 'Cypress licence mode' test "$(stat -c %a "$doc/LICENCE.cypress")" = 644 +for text in 'Files: usr/lib/firmware/updates/brcm/*' \ + 'Copyright: Cypress Semiconductor Corporation, an Infineon Technologies company' \ + 'License: LicenseRef-LICENCE.cypress' 'cypress/cyfmac43455-sdio.bin' \ + 'cypress/cyfmac43455-sdio.clm_blob' '7.45.286' 'a137a09be163c5e3fc6e96ba3bfb9eb328394c34' \ + 'See LICENCE.cypress for the full text'; do + check "firmware copyright: $text" grep -qF "$text" "$doc/copyright" +done check 'package ships no openxplay-usb-* units' sh -c '! dpkg-query -L openxplay-phicomm-n1 | grep -E "/openxplay-usb-[^/]+$"' check 'package ships no serial-getty@ttyGS0 drop-in' sh -c '! dpkg-query -L openxplay-phicomm-n1 | grep -F "/serial-getty@ttyGS0.service.d"' for program in phy-id wifi-mac bt-addr; do @@ -157,7 +193,7 @@ check 'mode 0644: Wi-Fi udev rule' test "$(stat -c %a "$rule")" = 644 check 'Wi-Fi udev rule bytes' cmp "$rule" "$here/../../wifi/70-openxplay-n1-wifi-mac.rules" check 'image install does not run PHY apply' test ! -e "$fixture/run/lock/openxplay-n1-phy-id.lock" check 'configure message printed once' test "$(grep -cFx \ - 'openxplay-phicomm-n1: the Ethernet PHY fix and the per-device Wi-Fi and Bluetooth addresses take effect at the next boot.' /work/install.log)" -eq 1 + 'openxplay-phicomm-n1: the Ethernet PHY fix, Wi-Fi firmware and per-device Wi-Fi and Bluetooth addresses take effect at the next boot.' /work/install.log)" -eq 1 /usr/lib/openxplay-phicomm-n1/phy-id status > /work/phy-status || fail 'PHY status failed in container' check 'container PHY status is unsupported' grep -qx 'unsupported .*' /work/phy-status helper_state > /work/helper-state @@ -232,6 +268,9 @@ runtime_is() { } check 'remove stops watcher and reloads systemd' runtime_is /work/remove-expected check 'package license removed' test ! -e /usr/share/doc/openxplay-phicomm-n1/LICENSE +check 'Cypress licence removed' test ! -e "$doc/LICENCE.cypress" +check 'remove preserves image firmware' cmp /work/image-firmware "$image_firmware" +for extension in bin clm_blob; do check "remove deletes updates firmware: $extension" test ! -e "$updates.$extension"; done check 'conffile kept on remove' test -f /etc/openxplay/host.json check 'state kept until purge' test -f /var/lib/openxplay-phicomm-n1/purge-marker for unit in $units; do check "helper masks removed unit: $unit" test "$(readlink "/etc/systemd/system/$unit")" = /dev/null; done @@ -244,6 +283,7 @@ PATH="/work/bin:$PATH" dpkg --purge openxplay-phicomm-n1 > /work/purge.log 2>&1 printf 'systemctl --system daemon-reload\n' > /work/purge-expected check 'purge reloads systemd' runtime_is /work/purge-expected check 'conffile removed on purge' test ! -e /etc/openxplay/host.json +check 'purge preserves image firmware' cmp /work/image-firmware "$image_firmware" check 'package state removed on purge' test ! -e /var/lib/openxplay-phicomm-n1 helper_state > /work/helper-state check 'helper state removed on purge' test ! -s /work/helper-state diff --git a/PhicommN1/package/tests/fixtures.py b/PhicommN1/package/tests/fixtures.py index 2972796..d81c29f 100755 --- a/PhicommN1/package/tests/fixtures.py +++ b/PhicommN1/package/tests/fixtures.py @@ -4,12 +4,42 @@ # Created by riko chen on 2026-10-21 """Small real Debian archives for offline bundle tests; no dpkg or Docker required.""" import gzip +import hashlib import io from pathlib import Path import sys import tarfile +def firmware(directory, pins): + directory.mkdir() + contents = {"cyfmac43455-sdio.bin": b"test-only Wi-Fi firmware\n", + "cyfmac43455-sdio.clm_blob": b"test-only CLM\n", + "LICENCE.cypress": b"test-only licence\n"} + rows = ["# Test-only linux-firmware commit upstream-path sha256"] + for name, data in contents.items(): + (directory / name).write_bytes(data) + upstream = ("LICENSES/" if name == "LICENCE.cypress" else "cypress/") + name + rows.append(f"{'a' * 40} {upstream} {hashlib.sha256(data).hexdigest()}") + pins.write_text("\n".join(rows)) # Exercise a final row without a newline. + return contents + + +def payload(path): + data = Path(path).read_bytes() + assert data[:8] == b"!\n", path + offset = 8 + while offset < len(data): + header = data[offset:offset + 60] + size = int(header[48:58]) + if header[:16].decode().strip().startswith("data.tar"): + with tarfile.open(fileobj=io.BytesIO(data[offset + 60:offset + 60 + size])) as tar: + return {entry.name.removeprefix("./"): (tar.extractfile(entry).read(), entry.mode) + for entry in tar if entry.isfile()} + offset += 60 + size + size % 2 + raise AssertionError("No data member: " + str(path)) + + def deb(path, name, version, arch, source=None): fields = {"Package": name, "Version": version, "Architecture": arch, "Maintainer": "Test ", "Description": "Offline fixture"} diff --git a/PhicommN1/package/tests/installer-test.py b/PhicommN1/package/tests/installer-test.py index 3cdbb95..0a019c3 100755 --- a/PhicommN1/package/tests/installer-test.py +++ b/PhicommN1/package/tests/installer-test.py @@ -14,7 +14,7 @@ import tempfile sys.dont_write_bytecode = True -from fixtures import deb +from fixtures import deb, firmware, payload n1 = Path(__file__).resolve().parents[2] checks = 0 @@ -37,6 +37,9 @@ def digest(path): shutil.copyfile(n1.parent / "LICENSE", source.parent / "LICENSE") inputs = work / "inputs" inputs.mkdir() + firmware_dir = work / "firmware" + firmware_pins = work / "firmware.txt" + firmware_bytes = firmware(firmware_dir, firmware_pins) out = work / "out" bins = work / "bin" bins.mkdir() @@ -52,8 +55,6 @@ def digest(path): state.write_text("{}") log = work / "commands.jsonl" fixture_script = n1 / "package/tests/fixtures.py" - # Only the package build is stubbed. The bundle builder reads real ar/control archives. - (source / "package/build-deb.sh").write_text('#!/bin/sh\nexec "$FIXTURE_PYTHON" "$FIXTURES" "$2" "$3"\n') stub = r'''import json, os, pathlib, re, sys sys.dont_write_bytecode = True sys.path.insert(0, os.environ["FIXTURE_LIB"]) @@ -156,10 +157,13 @@ def order(c): (runtime / cmd).symlink_to(executable) env = dict(os.environ, SOURCE_DATE_EPOCH="1792540800", FIXTURE_PYTHON=sys.executable, FIXTURES=str(fixture_script), FIXTURE_LIB=str(fixture_script.parent), + OPENXPLAY_N1_TEST_FIRMWARE_PINS=str(firmware_pins), OPENXPLAY_N1_ROOT=str(root), TEST_LOG=str(log), TEST_STATE=str(state)) def run(script, args=(), code=0, error=None, extra=None, device=False, stderr_lines=()): e = {**env, **(extra or {})} + if Path(script).name == "build-bundle.sh": + args = ["--firmware", firmware_dir, *args] if device: e["PATH"] = str(bins) + os.pathsep + str(runtime) result = subprocess.run(["sh", str(script), *map(str, args)], env=e, text=True, @@ -175,6 +179,97 @@ def run(script, args=(), code=0, error=None, extra=None, device=False, stderr_li check(output.splitlines()[-1].startswith(prefix), output) return output + deb_builder = source / "package/build-deb.sh" + rejected = work / "rejected" + run(deb_builder, [rejected], code=1, error="--firmware DIR") + build_args = ["--firmware", firmware_dir, rejected] + # Production pins must reject the tiny fixtures even when every required file exists. + run(deb_builder, build_args, code=1, error="SHA-256 mismatch", + extra={"OPENXPLAY_N1_TEST_FIRMWARE_PINS": ""}) + for name, data in firmware_bytes.items(): + path = firmware_dir / name + path.unlink() + run(deb_builder, build_args, code=1, error="Missing regular firmware file") + path.symlink_to(firmware_pins) + run(deb_builder, build_args, code=1, error="Symlink firmware input") + path.unlink() + path.write_bytes(data + b"corrupt") + run(deb_builder, build_args, code=1, error="SHA-256 mismatch") + path.write_bytes(data) + pin_text = firmware_pins.read_text() + for text, error in ((pin_text + " extra", "Invalid firmware.txt row"), + (pin_text + "\n" + pin_text.splitlines()[1], "Duplicate firmware basename"), + ("\n".join(pin_text.splitlines()[:-1]), "Missing firmware pin")): + firmware_pins.write_text(text) + run(deb_builder, build_args, code=1, error=error) + firmware_pins.write_text(pin_text) + check(not rejected.exists(), "Invalid firmware never creates an output directory") + if shutil.which("dpkg-deb"): + run(deb_builder, build_args) + device_deb = rejected / "openxplay-phicomm-n1_0.1.0_all.deb" + files = payload(device_deb) + updates = "usr/lib/firmware/updates/brcm/brcmfmac43455-sdio.phicomm,n1" + expected = {updates + ".bin": firmware_bytes["cyfmac43455-sdio.bin"], + updates + ".clm_blob": firmware_bytes["cyfmac43455-sdio.clm_blob"]} + check({p for p in files if p.startswith("usr/lib/firmware/")} == set(expected), "Exactly two updates files") + check(not any(p.startswith(("lib/firmware/", "usr/lib/firmware/brcm/")) for p in files), "No image firmware paths") + for path, data in expected.items(): + check(files[path] == (data, 0o644), "Firmware bytes and mode: " + path) + doc = "usr/share/doc/openxplay-phicomm-n1/" + check(files[doc + "LICENCE.cypress"] == (firmware_bytes["LICENCE.cypress"], 0o644), "Firmware licence") + copyright = files[doc + "copyright"][0].decode() + for value in ("Files: usr/lib/firmware/updates/brcm/*", + "Copyright: Cypress Semiconductor Corporation, an Infineon Technologies company", + "License: LicenseRef-LICENCE.cypress", "cypress/cyfmac43455-sdio.bin", + "cypress/cyfmac43455-sdio.clm_blob", "7.45.286", + "a137a09be163c5e3fc6e96ba3bfb9eb328394c34", "See LICENCE.cypress for the full text"): + check(value in copyright, "Firmware copyright: " + value) + first_digest = digest(device_deb) + run(deb_builder, build_args) + check(digest(device_deb) == first_digest, "Reproducible device package") + else: + print("SKIP N1 native .deb payload: dpkg-deb unavailable (also covered by chroot-test.sh)") + # Exercise the macOS tar-stream fallback without a daemon, image, mounts or network. + container_tools = work / "container-tools" + container_tools.mkdir() + for cmd in ("sh", "dirname", "grep", "cut", "tr", "sha256sum", "mkdir", "mktemp", "cp", "tar", "rm"): + (container_tools / cmd).symlink_to(shutil.which(cmd)) + docker = container_tools / "docker" + docker.write_text(f"#!{sys.executable}\n" + r'''import io, os, pathlib, sys, tarfile +sys.dont_write_bytecode = True +sys.path.insert(0, os.environ["FIXTURE_LIB"]) +from fixtures import deb +args = sys.argv[1:] +assert args[:2] == ["run", "-i"] and "--pull=never" in args and "--network=none" in args +assert "--firmware /work/firmware" in args[-1] +with tarfile.open(fileobj=io.BytesIO(sys.stdin.buffer.read())) as tar: + for name in ("cyfmac43455-sdio.bin", "cyfmac43455-sdio.clm_blob", "LICENCE.cypress"): + assert tar.extractfile("firmware/" + name).read() == (pathlib.Path(os.environ["TEST_FIRMWARE"]) / name).read_bytes() + assert tar.extractfile("PhicommN1/install/firmware.txt") + if os.environ.get("OPENXPLAY_N1_TEST_FIRMWARE_PINS"): + assert os.environ["OPENXPLAY_N1_TEST_FIRMWARE_PINS"] == "/work/firmware/test-pins.txt" + assert tar.extractfile("firmware/test-pins.txt").read() == pathlib.Path(os.environ["TEST_FIRMWARE_PINS"]).read_bytes() + else: + assert "firmware/test-pins.txt" not in tar.getnames() +path = pathlib.Path(os.environ["TEST_CONTAINER_DEB"]) +deb(path, "openxplay-phicomm-n1", "0.1.0", "all") +with tarfile.open(fileobj=sys.stdout.buffer, mode="w|") as tar: + tar.add(path, arcname="openxplay-phicomm-n1_0.1.0_all.deb") +''') + docker.chmod(0o755) + container_env = {"PATH": str(container_tools), "TEST_FIRMWARE": str(firmware_dir), + "TEST_FIRMWARE_PINS": str(firmware_pins), "TEST_CONTAINER_DEB": str(work / "container.deb")} + run(deb_builder, ["--firmware", firmware_dir, work / "container-out"], extra=container_env) + production_pins = source / "install/firmware.txt" + original_pins = production_pins.read_text() + production_pins.write_text(firmware_pins.read_text()) + run(deb_builder, ["--firmware", firmware_dir, work / "container-out"], + extra={**container_env, "OPENXPLAY_N1_TEST_FIRMWARE_PINS": ""}) + production_pins.write_text(original_pins) + # Bundle/installer checks use small real ar/control archives on hosts without dpkg or Docker. + deb_builder.write_text('#!/bin/sh\n[ "$3" = --firmware ] && [ -d "$4" ] || exit 1\n' + 'exec "$FIXTURE_PYTHON" "$FIXTURES" "$2" "$5"\n') + pins = source / "install/debs.txt" rows = [] packages = [("z-runtime-data", "1.2-1", "all"), ("a-runtime-lib", "2.0~rc1-1", "arm64"), @@ -215,6 +310,10 @@ def run(script, args=(), code=0, error=None, extra=None, device=False, stderr_li for package in manifest["packages"]: check(digest(bundle / package["file"]) == package["sha256"], "Manifest package digest") check("runtime-source 1.0" in (bundle / "SOURCES.txt").read_text(), "Source field is used") + for row in firmware_pins.read_text().splitlines()[1:]: + commit, path, sha256 = row.split() + check(f"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/{path}?id={commit} sha256 {sha256}" + in (bundle / "SOURCES.txt").read_text(), "Firmware provenance: " + path) check((bundle / "sources/runtime-source_1.0.dsc").is_file() and not (bundle / "sources/ignore.txt").exists(), "Optional source archives") with tarfile.open(str(bundle) + ".tar.gz") as tar: diff --git a/UFI003/package/release-common.sh b/UFI003/package/release-common.sh index 41476ce..a5271f9 100644 --- a/UFI003/package/release-common.sh +++ b/UFI003/package/release-common.sh @@ -218,3 +218,33 @@ phicomm_n1_fetch_debs() ( mv -f "$part" "$debs/${pkg}_${version#*:}_${arch}.deb" done < "$pins" ) + +# Keep the firmware and its redistribution licence pinned to unmodified linux-firmware files. +phicomm_n1_fetch_firmware() ( + set -eu + pins=$1 + firmware=$2 + mkdir -p "$firmware" + work=$(mktemp -d) + trap 'rm -rf "$work"' 0 + trap 'exit 1' HUP INT TERM + seen=' ' + while read -r commit path digest extra || [ -n "$commit" ]; do + case "$commit" in ''|'#'*) continue ;; esac + [ -z "$extra" ] && printf '%s\n' "$commit" | LC_ALL=C grep -Eq '^[0-9a-fA-F]{40}$' && + printf '%s\n' "$path" | LC_ALL=C grep -Eq '^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*$' && + printf '%s\n' "$digest" | LC_ALL=C grep -Eq '^[0-9a-fA-F]{64}$' || + ufi003_release_fail "Invalid firmware.txt row: $commit" + case "/$path/" in *..*|*/./*) ufi003_release_fail "Invalid firmware path: $path" ;; esac + base=${path##*/} + case "$seen" in *" $base "*) ufi003_release_fail "Duplicate firmware basename: $base" ;; esac + seen="$seen$base " + part=$work/firmware + ufi003_release_curl --output "$part" \ + "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/$path?id=$commit" || + ufi003_release_fail "Cannot download firmware: $path" + printf '%s %s\n' "$digest" "$part" | sha256sum -c - || + ufi003_release_fail "SHA-256 mismatch: $path" + mv -f "$part" "$firmware/$base" + done < "$pins" +) diff --git a/UFI003/package/tests/release-test.py b/UFI003/package/tests/release-test.py index 73e1712..3163844 100644 --- a/UFI003/package/tests/release-test.py +++ b/UFI003/package/tests/release-test.py @@ -164,6 +164,10 @@ def archive(changed_manifest=None, corrupt=False, extra=(), raw_manifest=None): {"architecture": os.environ.get("FETCH_ARCH", "arm64"), "hash": "b" * 40}]})) elif url == "https://snapshot.debian.org/file/" + "b" * 40: out.write_bytes(data) +elif url.startswith("https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/"): + if mode == "firmware-fail": + sys.exit(22) + out.write_bytes(data) else: sys.exit(99) ''') @@ -297,6 +301,48 @@ def archive(changed_manifest=None, corrupt=False, extra=(), raw_manifest=None): pins.write_text("bad 1 placeholder\n") run('phicomm_n1_fetch_debs "$@"', pins, debs, env=env, ok=False, error="Invalid debs.txt row") + firmware_pins = root / "firmware.txt" + firmware = root / "firmware" + fetch_firmware = 'phicomm_n1_fetch_firmware "$@"' + firmware_env = {**env, "FETCH_MODE": "firmware", "FETCH_DATA": "test-only firmware bytes"} + digest = hashlib.sha256(firmware_env["FETCH_DATA"].encode()).hexdigest() + commit = "a137a09be163c5e3fc6e96ba3bfb9eb328394c34" + paths = ("cypress/cyfmac43455-sdio.bin", "cypress/cyfmac43455-sdio.clm_blob", "LICENSES/LICENCE.cypress") + firmware_pins.write_text("# linux-firmware commit path sha256\n\n" + "\n".join( + f"{commit} {path} {digest}" for path in paths)) + log.unlink() + run(fetch_firmware, firmware_pins, firmware, env=firmware_env) + assert log.read_text().splitlines() == [ + f"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/{path}?id={commit}" + for path in paths] + assert {p.name for p in firmware.iterdir()} == {Path(path).name for path in paths} + assert all(p.read_text() == firmware_env["FETCH_DATA"] for p in firmware.iterdir()) + # Hex is case-insensitive; the URL retains the supplied commit spelling. + firmware_pins.write_text(f"{commit.upper()} {paths[0]} {digest.upper()}\n") + run(fetch_firmware, firmware_pins, firmware, env=firmware_env) + for bad_commit, bad_path, bad_digest, extra in ( + ("a" * 39, paths[0], digest, ""), ("a" * 41, paths[0], digest, ""), + ("g" * 40, paths[0], digest, ""), (commit, paths[0], "f" * 63, ""), + (commit, paths[0], "f" * 65, ""), (commit, paths[0], "g" * 64, ""), + (commit, paths[0], digest, "unexpected"), (commit, paths[0], "", ""), + *((commit, path, digest, "") for path in ( + "/absolute.bin", "../escape.bin", "cypress/../escape.bin", "cypress/name..bin", + "cypress/./file", "cypress/.", ".", "cypress/", "cypress//file", "bad+name.bin", + "bad?query", "bad\\name", "bad name.bin")), + ): + firmware_pins.write_text(f"{bad_commit} {bad_path} {bad_digest} {extra}\n") + log.unlink(missing_ok=True) + run(fetch_firmware, firmware_pins, firmware, env=firmware_env, ok=False, error="Invalid firmware") + assert not log.exists(), "Bad rows must be rejected before curl" + firmware_pins.write_text(f"{commit} cypress/same.bin {digest}\n{commit} other/same.bin {digest}\n") + run(fetch_firmware, firmware_pins, firmware, env=firmware_env, ok=False, error="Duplicate firmware basename") + firmware_pins.write_text(f"{commit} {paths[0]} {digest}\n") + run(fetch_firmware, firmware_pins, firmware, env={**firmware_env, "FETCH_CORRUPT": "1"}, + ok=False, error="SHA-256 mismatch") + assert (firmware / Path(paths[0]).name).read_text() == firmware_env["FETCH_DATA"], "Bad download cannot replace verified file" + run(fetch_firmware, firmware_pins, firmware, env={**firmware_env, "FETCH_MODE": "firmware-fail"}, + ok=False, error="Cannot download firmware") + # Inspect both workflows offline, including all shell blocks and prerelease asset naming. for device, build_dir, version_fn, fetch_fn, check_fn in ( ("ufi003", "UFI003", "ufi003_release_version", "ufi003_fetch_debs", "ufi003_check_bundle"), @@ -315,5 +361,11 @@ def archive(changed_manifest=None, corrupt=False, extra=(), raw_manifest=None): for block in re.findall(r" run: \|\n((?: .*\n|\n)+)", workflow): subprocess.run(["bash", "-n"], input=textwrap.dedent(block), text=True, check=True) checks += 1 + if device == "phicomm-n1": + assert 'phicomm_n1_fetch_firmware PhicommN1/install/firmware.txt "$RUNNER_TEMP/firmware"' in workflow + assert '--firmware "$RUNNER_TEMP/firmware"' in workflow + assert workflow.index("- name: Fetch and verify pinned firmware") < workflow.index("- name: Build bundle") + assert 'unmodified Cypress Wi-Fi firmware from linux-firmware under LICENCE.cypress' in workflow + checks += 4 print(f"PASS {checks} offline release cases")