#991141 debian-cd: arm64 device trees not included in ESP

#991141#5
Date:
2021-07-15 15:03:55 UTC
From:
To:
It is useful to have the device trees available on the ESP. If we have these,
(vanilla) u-boot should be able to boot any board which has a dtb in the kernel
out-of-the box using EFI.

The (arm64) mini.iso already includes the DTBs in /dtb (which is the path
u-boot searches for).

Unfortunatly, these files are missing from ESP in the debian netinst.iso.
Please include them there, too.

#991141#10
Date:
2021-07-22 14:10:56 UTC
From:
To:
It seems that debian-cd (re)builds its own efi.img and doesn't
add the dtbs but only the EFI/ subdirectory from the d-i
efi.img.

This might fix the problem, please take it with a grain of salt
because I was unable to actually test it. I've tried the
commands by hand though.

diff --git a/tools/boot/bullseye/boot-arm64
b/tools/boot/bullseye/boot-arm64
index d954dff3..7c55d408 100755
--- a/tools/boot/bullseye/boot-arm64
+++ b/tools/boot/bullseye/boot-arm64
@@ -84,9 +84,11 @@ cat cdrom/debian-cd_info.tar.gz | (cd boot$N/; tar
zx)
  if [ -d boot$N/grub ] ; then
      echo "  Adding EFI boot code for $ARCH on CD$N"

-    # Move GRUB files to the right place.
+    # Move GRUB and DTB files to the right place.
      mkdir -p $CDDIR/EFI/boot
      mcopy -n -s -i boot$N/grub/efi.img '::efi/*' $CDDIR/EFI
+    mkdir -p $CDDIR/dtb
+    mcopy -n -s -i boot$N/grub/efi.img '::dtb/*' $CDDIR/dtb
      mkdir -p $CDDIR/boot/grub
      mv boot$N/grub/* $CDDIR/boot/grub/
      rmdir boot$N/grub