arduino-uno-q: install USB gadget scripts unconditionally in BSP#9649
Conversation
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.
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ This PR has been reviewed and approved — all set for merge! |
Summary
Fix Ubuntu builds failing with `Failed to enable unit, unit usbgadget-rndis.service does not exist` on CI.
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 in the cached BSP.
This is why no other board uses `DISTRIBUTION` checks in `post_family_tweaks_bsp__` — they only use them in `pre_customize_image__` which runs per-distro.
Fix
Install the USB gadget files unconditionally in the BSP (they're harmless if unused) and keep the service enablement conditional in `post_family_tweaks__` where `DISTRIBUTION` can be reliably checked per-image.
Test plan
Summary by CodeRabbit