From 381915f15208a95ab6ab7e674b6de9147d2a555e Mon Sep 17 00:00:00 2001 From: Franco Date: Tue, 8 Sep 2026 15:07:39 -0300 Subject: [PATCH 1/2] fix(targets): restore librerouter naming and split into single-image + dual-tftp variants Two bugs made the LibreRouter unusable in the remote mesh flow: 1. **Naming mismatch**: commit 29a35a03 renamed `targets/librerouter_librerouter-v1.yaml` to `targets/librerouter_v1.yaml`, breaking the lookup done by `resolve_target_yaml` in mesh_boot_node.py which reads the base_device name from openwrt-tests' labnet.yaml (`librerouter_librerouter-v1`, renamed with hyphen in openwrt-tests commit f3a08dc3 to match the OpenWrt firmware naming convention). 2. **Dual-TFTP hard-coded**: the librerouter YAML required both LG_IMAGE and LG_IMAGE_INITRD, breaking any flow that ships a self-contained `*-initramfs-kernel.bin` (LibreMesh releases, source builds, mesh tests, openwrt-tests healthcheck). Fix: - Rename `librerouter_v1.yaml` back to `librerouter_librerouter-v1.yaml` and rewrite it as the **single-image default** (loads and boots one self-contained initramfs kernel). Matches openwrt-tests' variant and the reference in README.md / firmware-catalog.yaml. - Preserve the previous dual-TFTP flow as `librerouter_librerouter-v1-dual-tftp.yaml` for pi-lime-packages / lime-packages CI, which uses ImageBuilder (cannot rebuild the kernel with CONFIG_INITRAMFS_SOURCE and therefore ships kernel.bin + rootfs.uimage separately). - Update README.md and docs/target-quirks.md with the two-variant table and "when to use which" guidance. The lime-packages CI needs a follow-up to point LG_ENV at the `-dual-tftp` variant when `lab_stage_firmware.sh` runs in dual-TFTP mode. --- README.md | 3 +- docs/target-quirks.md | 7 ++- ...librerouter_librerouter-v1-dual-tftp.yaml} | 18 ++++++- targets/librerouter_librerouter-v1.yaml | 53 +++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) rename targets/{librerouter_v1.yaml => librerouter_librerouter-v1-dual-tftp.yaml} (61%) create mode 100644 targets/librerouter_librerouter-v1.yaml diff --git a/README.md b/README.md index c2f8909..64edd7a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ Only DUTs used for LibreMesh / FCEFyN workflows: | `targets/openwrt_one.yaml` | OpenWrt One | | `targets/bananapi_bpi-r4.yaml` | Banana Pi R4 | | `targets/linksys_e8450.yaml` | Belkin RT3200 / Linksys E8450 | -| `targets/librerouter_librerouter-v1.yaml` | LibreRouter v1 | +| `targets/librerouter_librerouter-v1.yaml` | LibreRouter v1 (single-image, default) | +| `targets/librerouter_librerouter-v1-dual-tftp.yaml` | LibreRouter v1 (kernel + rootfs.uimage, for lime-packages CI) | | `targets/qemu_x86-64_libremesh.yaml` | QEMU x86-64 LibreMesh | ## Running tests diff --git a/docs/target-quirks.md b/docs/target-quirks.md index db833d7..a12c043 100644 --- a/docs/target-quirks.md +++ b/docs/target-quirks.md @@ -31,7 +31,12 @@ Even though `pi-lime-packages` embeds `bootargs` in the FIT configuration node, ## LibreRouter v1 (ath79) -**Target file:** `targets/librerouter_v1.yaml` +**Target files (two variants):** + +| File | When to use | Required env vars | +|---|---|---| +| `targets/librerouter_librerouter-v1.yaml` | Default. Boots a self-contained `*-initramfs-kernel.bin` (LibreMesh releases, source builds, mesh tests, `openwrt-tests` healthcheck via `labnet.yaml`). | `LG_IMAGE` | +| `targets/librerouter_librerouter-v1-dual-tftp.yaml` | `pi-lime-packages` / `lime-packages` CI when ImageBuilder emits `kernel.bin` + `rootfs.uimage` separately. | `LG_IMAGE` + `LG_IMAGE_INITRD` | ### Dual-TFTP Boot diff --git a/targets/librerouter_v1.yaml b/targets/librerouter_librerouter-v1-dual-tftp.yaml similarity index 61% rename from targets/librerouter_v1.yaml rename to targets/librerouter_librerouter-v1-dual-tftp.yaml index c239903..747b8ef 100644 --- a/targets/librerouter_v1.yaml +++ b/targets/librerouter_librerouter-v1-dual-tftp.yaml @@ -1,4 +1,20 @@ -# LibreRouter v1 (ath79) - See docs/target-quirks.md for details +# LibreRouter v1 (ath79) - dual-TFTP variant (kernel + rootfs ramdisk). +# +# Use this variant only when the boot artifact is split into two files: +# - kernel.bin (uImage with lzma kernel + appended DTB) +# - rootfs.uimage (newc CPIO with LibreMesh rootfs, uImage-wrapped) +# +# Required env vars: LG_IMAGE (kernel) and LG_IMAGE_INITRD (rootfs). +# +# This is used by pi-lime-packages / lime-packages CI because ImageBuilder +# cannot rebuild the kernel with CONFIG_INITRAMFS_SOURCE, so the ath79 +# artifact is delivered as two separate blobs. +# +# For self-contained *-initramfs-kernel.bin (LibreMesh releases, source +# builds, mesh tests) use the single-image default: +# targets/librerouter_librerouter-v1.yaml +# +# See docs/target-quirks.md for details on the ath79 dual-image rationale. targets: main: features: diff --git a/targets/librerouter_librerouter-v1.yaml b/targets/librerouter_librerouter-v1.yaml new file mode 100644 index 0000000..6a0e220 --- /dev/null +++ b/targets/librerouter_librerouter-v1.yaml @@ -0,0 +1,53 @@ +# LibreRouter v1 (ath79) - single-image variant +# +# This target boots from a self-contained `*-initramfs-kernel.bin` image +# (kernel with LibreMesh CPIO embedded via CONFIG_INITRAMFS_SOURCE). It is +# the default for: +# - Mesh tests (mesh_boot_node.py sets only LG_IMAGE per node). +# - Local single-node runs with a LibreMesh release image. +# - openwrt-tests healthcheck (labnet.yaml maps here). +# +# For pi-lime-packages CI (ImageBuilder cannot build initramfs kernels; +# ships kernel.bin + rootfs.uimage separately) use the dual-TFTP variant: +# targets/librerouter_librerouter-v1-dual-tftp.yaml +targets: + main: + features: + - wan_port + - wifi + resources: + RemotePlace: + name: !template "$LG_PLACE" + drivers: + - PDUDaemonDriver: {} + - TFTPProviderDriver: {} + - SerialDriver: + txdelay: 0.01 + - UBootDriver: + login_timeout: 30 + # A single newline aborts autoboot within the 2s bootdelay window; + # tftpstrategy._spam_uboot_interrupt blasts these for ~12s to be + # robust against serial-console jitter on the ath79 U-Boot 1.1.x. + interrupt: "\n" + autoboot: "Hit any key to stop autoboot" + prompt: "ath>" + init_commands: + - "tftp 0x82000000" + boot_command: "bootm 0x82000000" + - ShellDriver: + prompt: "(?:\\x1b\\][^\\x07]*\\x07)?(?:\\x1b\\[[\\d;]*m)*root@LiMe-[0-9A-Fa-f]{6}:[^ ]*[#$] " + login_prompt: Please press Enter to activate this console. + await_login_timeout: 15 + login_timeout: 180 + post_login_settle_time: 5 + username: root + - UBootTFTPStrategy: {} + - SSHDriver: + connection_timeout: 120.0 + explicit_scp_mode: True + +images: + root: !template $LG_IMAGE + +imports: + - ../strategies/tftpstrategy.py From 26ce4718c0d1cbf37e70b5e2ead4d6e7c8ac53a5 Mon Sep 17 00:00:00 2001 From: Franco Date: Tue, 8 Sep 2026 15:24:11 -0300 Subject: [PATCH 2/2] chore(ci): cap ruff below 0.16 for reproducible lint Ruff 0.16 enables additional default lint rules (RUF059, PIE810, ...) that flag pre-existing patterns in the codebase, causing every new PR to fail lint without any related code change. Cap the dev dependency at <0.16 so CI runs are reproducible; bump this cap deliberately when we opt into the new rules and fix the flagged patterns in a dedicated cleanup pass. --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dc24f92..e24e407 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,11 @@ dependencies = [ labgrid = { git = "https://github.com/aparcar/labgrid.git", branch = "aparcar/staging" } [dependency-groups] -dev = ["isort>=6.0.1", "ruff>=0.12.0"] +# Ruff is capped below 0.16: newer releases enable additional default lint +# rules (RUF059, PIE810, ...) that flag pre-existing patterns in the +# codebase, breaking CI on every new PR without any related code change. +# Bump this cap deliberately when we opt into the new rules. +dev = ["isort>=6.0.1", "ruff>=0.12.0,<0.16"] [tool.isort] profile = "black"