Commit a9ded39b authored by Anton Midyukov's avatar Anton Midyukov

stage2: add copy devicetree in 95-copy-kernel, if $GLOBAL_COPY_DTB is set

dtb on an ESP partition can be loaded by u-boot. devicetree directory contain symlinks to enable booting on systems, where use path of directory by vendor (modern u-boot) and flat path (older u-boot). In the case of iso, there is no need to support old u-boot given the price of 15 MB image increase on aarch64.
parent 8dec2e9b
......@@ -33,3 +33,20 @@ case "$GLOBAL_EFI_BOOTLOADER" in
cp -lpLf boot/initrd.img EFI/BOOT/full.cz
;;
esac
# copy dtb for default kernel
if [ -n "$GLOBAL_COPY_DTB" ]; then
dtb_dir=
[ -d /boot/devicetree/$kverdef ] && dtb_dir=/boot/devicetree/$kverdef
[ -z "$dtb_dir" ] && [ -d /lib/devicetree/$kverdef ] &&
dtb_dir=/lib/devicetree/$kverdef
if [ -n "$dtb_dir" ]; then
cp -r "$dtb_dir/" dtb
# cleanup symlinks which are duplicated for compatibility
find dtb/ -type l -delete
# fix permissions for copy-tree
chmod -R 755 dtb
else
echo "dtb directory for $kverdef not found"
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment