Skip to content

Add unique mac for each AP-UP interface asociated with batman #1200

Open
javierbrk wants to merge 3519 commits into
libremesh:masterfrom
javierbrk:fix/ap-up_batman_mac
Open

Add unique mac for each AP-UP interface asociated with batman #1200
javierbrk wants to merge 3519 commits into
libremesh:masterfrom
javierbrk:fix/ap-up_batman_mac

Conversation

@javierbrk

Copy link
Copy Markdown
Member

APuP creates an interface for each radio named "wlanX-apup" then for each peer Y in that radio creates a new interface called wlanX-peerY. This interface is then associated to a new device called wlanX-peerY_WZ were WZ are numbers associated with protocols. In my particular case 29 is associated with batman and derived from the network name.

Each time a new peer appears the device linked with the peer WiFi interface has the same mac address and batman requires that all the interfaces have different macs. So this pull request adds the new mac feature to the each interface.

ilario and others added 30 commits May 20, 2025 20:56
…alization

Easing libremesh virtualization
Follow-up to libremesh#938: Fix README link and improve clusterssh command
…ages

packages: drop abandoned luci-mod-status and luci-lib-jquery-flot
links to new generic kernel and rootfs for QEMU testing.
tools/qemu_dev_stop [NODE_ID] will stop the node-id vm
The -N option is not supported by the netcat version shipped by default with debian.
Use nc -w 1 instead, this will cause the connection to timeout after 1 second.
system_powerdown command can take some time to finish, this prevents the terminal idling from the user perspective.
Previous link led to a 404 page, new one to the official documentation of busted
…hcat

Replacing deferrable reboot with watchcat
javierbrk/openwrt-packages net/vwifi is missing PKG_MIRROR_HASH,
which OpenWrt 24.10 SDK requires (Package HASH check failed).
Our fork already has the hash; Javier needs to add it before his
package can be used as a direct replacement.
…ly belkin

Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
…collision

Reverts f87e112. Pairing two identical-model belkins exercises a
LibreMesh identity collision (primary_mac() reads eth0, and same-model
devices in initramfs share the DTS default eth0 MAC) that cannot be
fixed in test glue. Restore the original walking-chain layout used by
the May 5 schedule run (25364365026) where bananapi_bpi-r4 (wired) is
paired with belkin_rt3200_3 (wifi mesh via VLAN 200).

The same-model MAC collision should be addressed in lime-packages
itself (e.g. a uci-defaults seed before lime-config) when a stable
identity source is available on the device.
…e is skipped

test-mesh and test-mesh-pairs keep test-firmware in `needs` only to
serialise lab access on the labgrid lock; they do not consume any
artifact or result from it. Default GitHub Actions behaviour, however,
skips a dependent job whenever any `needs` job is in `skipped` state,
which made `workflow_dispatch` with `physical_mesh_pairs=true` (but
`physical_single=false`) skip the mesh-pairs run that the user
explicitly asked for.

Wrap the existing `if:` with `!cancelled()` and add explicit
`needs.<job>.result` checks so the mesh jobs run when test-firmware is
either `success` or `skipped`, and skip only when test-firmware truly
failed.
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
@ilario ilario added this to Releases Jun 15, 2026
@ilario ilario moved this to In Progress in Releases Jun 15, 2026
@ilario

ilario commented Jun 15, 2026

Copy link
Copy Markdown
Member

@javierbrk @G10h4ck what's the status of this? It would be nice to have working APuP for the next release!

@ilario ilario added this to the 2026.1 milestone Jun 15, 2026
@javierbrk

javierbrk commented Jun 15, 2026 via email

Copy link
Copy Markdown
Member Author

francoriba and others added 6 commits June 18, 2026 12:06
Add IMAGE_FORMAT=dual-tftp to build_image.sh that emits kernel.bin and
rootfs.cpio as separate artifacts. U-Boot TFTP-loads each to a distinct
RAM address and passes rd_start/rd_size via bootargs so the MIPS kernel
mounts the external CPIO as rootfs.

- build_image.sh: new dual-tftp format (kernel + CPIO, no FIT repacking)
- targets.yml: librerouter_v1 entry (mips_24kc, ath79-generic)
- lab_stage_firmware.sh: detect and stage dual-file artifacts
- build-firmware.yml: forward LG_IMAGE_INITRD to test step
The Atheros U-Boot 1.1.x on the LibreRouter does not pass
rd_start/rd_size bootargs to the kernel (${var} expansion
not supported, and the kernel may have CONFIG_CMDLINE_OVERRIDE).

Wrap the rootfs CPIO as a uImage ramdisk (mkimage -T ramdisk)
so `bootm <kernel> <ramdisk>` makes U-Boot pass initrd info
natively through the MIPS boot params mechanism.
base-files creates these but verify and create if missing to
prevent mount_root / preinit failures when /proc is not available.
…boot

The OpenWrt preinit hook 80_mount_root gates do_mount_root behind
[ "$INITRAMFS" = "1" ]. Without this variable set, mount_root runs
on initramfs-booted devices, finds rootfs_data on flash, attempts a
jffs2 overlay pivot_root which fails (rootfs doesn't support it),
and the ramoverlay fallback loses /proc - cascading into lime-config
never running and the device booting as root@(none).

The upstream OpenWrt build system places a proper /init script at
target/linux/generic/other-files/init that exports INITRAMFS=1
before exec'ing /sbin/init. Our build_image.sh was creating a bare
symlink /init -> /sbin/init instead, so procd started without
INITRAMFS in the environment.

Replace the symlink with the equivalent 3-line script that sets
INITRAMFS=1 and execs /sbin/init. This ensures mount_root is
skipped on all initramfs targets (dual-tftp, FIT, multi-uimage).
feat(ci): add LibreRouter v1 support via dual-TFTP boot
Signed-off-by: Franco <franco.riba@mi.unc.edu.ar>
@Fede654

Fede654 commented Jun 19, 2026

Copy link
Copy Markdown

Picked this up per @javierbrk's note above. I've opened javierbrk#16 against the fix/ap-up_batman_mac branch (so it folds back into this PR on merge), addressing the pending review changes:

  • utils.split now fails on an empty separator instead of defaulting (an empty separator is a caller bug);
  • network.get_mac fails fast on a non-existent interface instead of returning nil, with the test updated accordingly;
  • network.device_exists uses fs.lstat on /sys/class/net (same idiom as assert_interface_exists) instead of shelling out;
  • in limed, the existence guard now runs before createStatic (which was the source of the No such device errors), with the transient documented as expected during a wifi down/wifi up cycle;
  • lime-proto-batadv scopes the per-peer MAC to a local (it was leaking a global) and drops the dead batctl if add code.

Full unit suite passes (305/305). Happy to fold/squash however suits the maintainers — main goal is to get APuP + batman-adv ready for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.