Browse Source

Make sure that DTB files are included on boot partition.

This is important so that the bootloader (U-Boot) can use the DTB
files when chainloading GRUB via UEFI. The logic for doing this is
already present in `distro_bootcmd`, but because we were not placing
the DTB files in the correct folder, this part was skipped.

Changelog: Fix certain kernels hanging on boot. In particular, recent
versions of Debian for Beaglebone was affected, but several other
boards using UEFI may also have been affected.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
2.0.x
Kristian Amlie 5 years ago
parent
commit
c321684a03
No known key found for this signature in database GPG Key ID: F464407C996AF03F
  1. 12
      mender-convert-modify

12
mender-convert-modify

@ -164,6 +164,18 @@ EOF
run_and_log_cmd "sudo mkdir -p work/boot/EFI/BOOT"
run_and_log_cmd "sudo cp work/${efi_name} -P work/boot/EFI/BOOT/${efi_target_name}"
# Copy dtb directory to the boot partition for use by the bootloader.
if [ -d work/rootfs/boot/dtbs ]; then
# Look for the first directory that has dtb files. First check the base
# folder, then any subfolders in versioned order.
for candidate in work/rootfs/boot/dtbs $(find work/rootfs/boot/dtbs/ -maxdepth 1 -type d | sort -V -r); do
if [ $(find $candidate -maxdepth 1 -name '*.dtb' | wc -l) -gt 0 ]; then
run_and_log_cmd "cp -r $candidate work/boot/dtb"
break
fi
done
fi
fi
run_and_log_cmd "sudo mkdir -p work/rootfs/data/mender"

Loading…
Cancel
Save