From 4cd04e666085d71fd97a76f285dd0283da1bb0ee Mon Sep 17 00:00:00 2001 From: SuperKali Date: Fri, 10 Apr 2026 09:46:29 +0200 Subject: [PATCH] arduino-uno-q: install USB gadget scripts unconditionally in BSP The BSP package is built once per board+branch and cached across all distributions. Conditioning the installation on DISTRIBUTION inside a post_family_tweaks_bsp__ hook causes the CI to cache a BSP built for Debian (without gadget files), then reuse it for Ubuntu builds where systemctl enable usbgadget-rndis.service fails because the service file is missing. Install the files unconditionally in the BSP and keep the service enablement conditional in post_family_tweaks__ where DISTRIBUTION can be reliably checked per-image. --- config/boards/arduino-uno-q.csc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/boards/arduino-uno-q.csc b/config/boards/arduino-uno-q.csc index d2c85e1b03..a152402726 100644 --- a/config/boards/arduino-uno-q.csc +++ b/config/boards/arduino-uno-q.csc @@ -41,7 +41,8 @@ function post_family_tweaks__arduino-uno-q() { } function post_family_tweaks_bsp__arduino-uno-q_usb_gadget() { - [[ "${DISTRIBUTION}" != "Ubuntu" ]] && return 0 + # BSP is built once and cached across distros, so install files unconditionally. + # The usbgadget-rndis service is enabled in post_family_tweaks__ only when adbd is unavailable. display_alert "Installing USB gadget network scripts" "${BOARD}" "info" install -Dm755 "$SRC/packages/bsp/usb-gadget-network/setup-usbgadget-network.sh" "$destination/usr/local/bin/setup-usbgadget-network.sh" install -Dm755 "$SRC/packages/bsp/usb-gadget-network/remove-usbgadget-network.sh" "$destination/usr/local/bin/remove-usbgadget-network.sh"