mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-30 06:49:43 +01:00
Merge pull request #543 from ipetkov/fix-device-tree-overlays
raspberry-pi/4/dtmerge: fix application of overlays
This commit is contained in:
commit
4cff4f40b9
1 changed files with 14 additions and 16 deletions
|
@ -24,26 +24,24 @@ with lib; (base: overlays': stdenvNoCC.mkDerivation {
|
||||||
# skip incompatible and non-matching overlays
|
# skip incompatible and non-matching overlays
|
||||||
if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then
|
if [[ ! "$dtbCompat" =~ "$overlayCompat" ]]; then
|
||||||
echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")"
|
echo "Skipping overlay ${o.name}: incompatible with $(basename "$dtb")"
|
||||||
continue
|
elif ${if ((o.filter or null) == null) then "false" else ''
|
||||||
fi
|
[[ "''${dtb//${o.filter}/}" == "$dtb" ]]
|
||||||
${optionalString ((o.filter or null) != null) ''
|
|
||||||
if [[ "''${dtb//${o.filter}/}" == "$dtb" ]]; then
|
|
||||||
echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
''}
|
''}
|
||||||
|
then
|
||||||
|
echo "Skipping overlay ${o.name}: filter does not match $(basename "$dtb")"
|
||||||
|
else
|
||||||
|
echo -n "Applying overlay ${o.name} to $(basename "$dtb")... "
|
||||||
|
mv "$dtb"{,.in}
|
||||||
|
|
||||||
echo -n "Applying overlay ${o.name} to $(basename "$dtb")... "
|
# dtmerge requires a .dtbo ext for dtbo files, otherwise it adds it to the given file implicitly
|
||||||
mv "$dtb"{,.in}
|
dtboWithExt="$TMPDIR/$(basename "${o.dtboFile}").dtbo"
|
||||||
|
cp -r ${o.dtboFile} "$dtboWithExt"
|
||||||
|
|
||||||
# dtmerge requires a .dtbo ext for dtbo files, otherwise it adds it to the given file implicitly
|
dtmerge "$dtb.in" "$dtb" "$dtboWithExt"
|
||||||
dtboWithExt="$TMPDIR/$(basename "${o.dtboFile}").dtbo"
|
|
||||||
cp -r ${o.dtboFile} "$dtboWithExt"
|
|
||||||
|
|
||||||
dtmerge "$dtb.in" "$dtb" "$dtboWithExt"
|
echo "ok"
|
||||||
|
rm "$dtb.in" "$dtboWithExt"
|
||||||
echo "ok"
|
fi
|
||||||
rm "$dtb.in" "$dtboWithExt"
|
|
||||||
'')}
|
'')}
|
||||||
|
|
||||||
done'';
|
done'';
|
||||||
|
|
Loading…
Reference in a new issue