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/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" 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