Merge pull request #2044 from hatch01/fix-vendor-overlays

raspberry-pi/firmware: stage vendor overlays independent of dtbSrc
This commit is contained in:
Doron Behar authored and GitHub committed 2026-10-04 15:36:41 +00:00
commit 31cc5f4d9b
1 file changed
+20 -2
+20 -2
View File
@@ -70,14 +70,32 @@ let
kept[$dst]=1
done
if [ -d "$dtbSrc/overlays" ]; then
for ovr in "$dtbSrc"/overlays/*; do
# hardware.raspberry-pi.configtxt.deviceTreeOverlays entries are
# matched by filename against the vendor .dtbo set the Raspberry Pi
# firmware ships, regardless of whether the *base* dtb above came
# from the generation or from firmwareBoot. Stage those
# unconditionally so config.txt's "dtoverlay=" lines have a target
# to apply, even when useGenerationDeviceTree = true.
if [ -d "$firmwareBoot/overlays" ]; then
for ovr in "$firmwareBoot"/overlays/*; do
dst="$target/overlays/$(basename "$ovr")"
copyForced "$ovr" "$dst"
kept[$dst]=1
done
fi
# When useGenerationDeviceTree also produced its own overlays
# (built via hardware.deviceTree.overlays), stage those too,
# letting them take precedence over same-named vendor overlays.
if [ "$dtbSrc" != "$firmwareBoot" ] && [ -d "$dtbSrc/overlays" ]; then
for ovr in "$dtbSrc"/overlays/*; do
dst="$target/overlays/$(basename "$ovr")"
copyForced "$ovr" "$dst"
kept[$dst]=1
done
fi
# Prune stale device trees / overlays.
for fn in "$target"/*.dtb "$target"/overlays/*; do
if [ "''${kept[$fn]:-}" != 1 ]; then