Skip to content

fix(ci): point LG_ENV at -dual-tftp target when staging kernel + ramdisk - #17

Closed
francoriba wants to merge 1 commit into
masterfrom
fix/librerouter-dual-tftp-env-override
Closed

francoriba wants to merge 1 commit into
masterfrom
fix/librerouter-dual-tftp-env-override

Conversation

@francoriba

Copy link
Copy Markdown
Collaborator

Context

Follow-up to libremesh/libremesh-tests#5 which splits the LibreRouter v1 target YAML into two variants:

  • targets/librerouter_librerouter-v1.yaml - single-image (default)
  • targets/librerouter_librerouter-v1-dual-tftp.yaml - kernel + rootfs uImage

Reason for the split: the single-image variant is what mesh tests, LibreMesh releases and openwrt-tests healthcheck actually use (initramfs-kernel.bin, only LG_IMAGE set). The previous librerouter YAML required both LG_IMAGE and LG_IMAGE_INITRD unconditionally, breaking every non-dual flow.

Problem in this CI

build-firmware.yml pre-sets LG_ENV=targets/${{ matrix.device }}.yaml in the labgrid lock step. After the split, that points at the single-image variant.

When lab_stage_firmware.sh then detects the dual-tftp payload (bin + uimage pair produced by build_image.sh for devices like the LibreRouter v1 on ath79), it exports LG_IMAGE_INITRD — but the single-image YAML does not reference that variable, so labgrid loads only the kernel and boot fails without a rootfs.

Fix

When lab_stage_firmware.sh enters the dual-TFTP branch, override LG_ENV with the -dual-tftp sibling target file so labgrid resolves LG_IMAGE_INITRD and issues both TFTP loads.

DUAL_ENV="targets/${DEVICE}-dual-tftp.yaml"
echo "LG_ENV=$DUAL_ENV" >> "$GITHUB_ENV"

No change for single-image devices (openwrt_one, linksys_e8450, bananapi_bpi-r4, qemu_*): the else branch keeps the pre-set LG_ENV.

Depends on

libremesh-tests split the LibreRouter target YAML into two variants:
  - librerouter_librerouter-v1.yaml           (single-image, default)
  - librerouter_librerouter-v1-dual-tftp.yaml (kernel + rootfs uImage)

The build-firmware workflow pre-sets LG_ENV to targets/<device>.yaml
in the labgrid lock step, which points at the single-image variant.
When lab_stage_firmware.sh detects the dual-tftp payload (bin + uimage
pair produced by build_image.sh for devices that need it, e.g.
LibreRouter v1 on ath79), override LG_ENV with the -dual-tftp variant
so labgrid can resolve LG_IMAGE_INITRD.

Without this override, staging the dual payload sets LG_IMAGE_INITRD
but the single-image YAML doesn't reference it, so the strategy
loads only the kernel and boot fails without a rootfs.

Refs: libremesh/libremesh-tests#5
@francoriba

Copy link
Copy Markdown
Collaborator Author

Redirigido al repo upstream libremesh/lime-packages en el PR nuevo.

@francoriba francoriba closed this Sep 8, 2026
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