# Pastebin 8lDBTVlM diff --git a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi-builder.sh b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi-builder.sh index 0541ca1ba62..71fd5609a88 100644 --- a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi-builder.sh +++ b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi-builder.sh @@ -95,6 +95,12 @@ addEntry() { copyForced $dtb "$dst" filesCopied[$dst]=1 done + mkdir -p $target/overlays + for dtbo in $dtb_path/overlays/*.dtbo; do + dst="$target/overlays/$(basename $dtbo)" + copyForced $dtbo "$dst" + filesCopied[$dst]=1 + done cp "$(readlink -f "$path/init")" $target/nixos-init echo "`cat $path/kernel-params` init=$path/init" >$target/cmdline.txt fi @@ -136,7 +142,7 @@ copyForced $fwdir/start_x.elf $target/start_x.elf copyForced @configTxt@ $target/config.txt # Remove obsolete files from $target and $target/old. -for fn in $target/old/*linux* $target/old/*initrd-initrd* $target/bcm*.dtb; do +for fn in $target/old/*linux* $target/old/*initrd-initrd* $target/bcm*.dtb $target/overlays/*.dtbo; do if ! test "${filesCopied[$fn]}" = 1; then rm -vf -- "$fn" fi