2023-01-08 22:49:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Copyright (C) 2017-2021 Team LibreELEC (https://libreelec.tv)
|
2023-10-24 16:00:57 +00:00
|
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
2023-01-08 22:49:32 +00:00
|
|
|
|
|
|
|
mkdir -p ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
if [ -n "${UBOOT_CONFIG}" ]; then
|
|
|
|
BOOTLOADER_DIR=$(get_build_dir ${BOOTLOADER})
|
2023-02-16 22:40:39 +00:00
|
|
|
KERNEL_DIR=$(get_build_dir linux)
|
2023-01-08 22:49:32 +00:00
|
|
|
if [ -f ${BOOTLOADER_DIR}/idbloader.img ]; then
|
|
|
|
cp -a ${BOOTLOADER_DIR}/idbloader.img ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
2023-02-16 22:40:39 +00:00
|
|
|
case "${PKG_SOC}" in
|
|
|
|
rk35*)
|
|
|
|
if [ -f ${BOOTLOADER_DIR}/u-boot.itb ]; then
|
|
|
|
cp -a ${BOOTLOADER_DIR}/u-boot.itb ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
if [ -f ${KERNEL_DIR}/resource.img ]; then
|
|
|
|
cp -a ${KERNEL_DIR}/resource.img ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
;;
|
2023-05-04 18:06:54 +00:00
|
|
|
*)
|
|
|
|
if [ -f ${BOOTLOADER_DIR}/uboot.img ]; then
|
|
|
|
cp -a ${BOOTLOADER_DIR}/uboot.img ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
if [ -f ${BOOTLOADER_DIR}/trust.img ]; then
|
|
|
|
cp -a ${BOOTLOADER_DIR}/trust.img ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
2023-02-16 22:40:39 +00:00
|
|
|
esac
|
2023-01-08 22:49:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f ${INSTALL}/usr/share/bootloader/boot.ini ]; then
|
|
|
|
cp -a ${INSTALL}/usr/share/bootloader/boot.ini ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
|
|
|
|
LINUX_DTS_DIR=$(get_build_dir linux)/arch/${TARGET_KERNEL_ARCH}/boot/dts/
|
|
|
|
for dtb in $(find ${LINUX_DTS_DIR} -name "*.dtb") ; do
|
|
|
|
if [ -f $dtb ]; then
|
|
|
|
cp -a $dtb ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "${SD_DTB}" ]; then
|
|
|
|
SD_UBOOT_DTB=$(get_build_dir u-boot)/arch/arm/dts/${SD_DTB}.dtb
|
|
|
|
if [ -f $SD_UBOOT_DTB ]; then
|
|
|
|
cp -a $SD_UBOOT_DTB ${RELEASE_DIR}/3rdparty/bootloader
|
|
|
|
fi
|
|
|
|
fi
|