# SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv) mkdir -p $RELEASE_DIR/3rdparty/bootloader if [ -n "$UBOOT_SYSTEM" ]; then BOOTLOADER_DIR=$(get_build_dir $BOOTLOADER) if [ -f $BOOTLOADER_DIR/idbloader.img ]; then cp -a $BOOTLOADER_DIR/idbloader.img $RELEASE_DIR/3rdparty/bootloader fi 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 fi if [ -f $INSTALL/usr/share/bootloader/logo.bmp ]; then cp -a $INSTALL/usr/share/bootloader/logo.bmp $RELEASE_DIR/3rdparty/bootloader 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 UBOOT_DTS_DIR=$(get_build_dir u-boot)/arch/arm/dts/ if [ "$DEVICE" == "RG351P" ]; then cp -f $UBOOT_DTS_DIR/rg351p-uboot.dtb $RELEASE_DIR/3rdparty/bootloader elif [ "$DEVICE" == "RG351V" ]; then cp -f $UBOOT_DTS_DIR/rg351v-uboot.dtb $RELEASE_DIR/3rdparty/bootloader elif [ "$DEVICE" == "RG351MP" ]; then cp -f $UBOOT_DTS_DIR/rg351mp-uboot.dtb $RELEASE_DIR/3rdparty/bootloader fi LE_TMP=$(mktemp -d) mkdir -p "${LE_TMP}/extlinux" mkdir -p $RELEASE_DIR/3rdparty/bootloader LINUX_DTS_DIR=$(get_build_dir linux)/.install_pkg/usr/share/bootloader for dtb in $(find $LINUX_DTS_DIR -name "*.dtb") do cat << EOF > "${LE_TMP}/extlinux/$(basename ${dtb}).conf" LABEL ${DISTRO} LINUX /${KERNEL_NAME} FDT /$(basename ${dtb}) APPEND boot=UUID=@BOOT_UUID@ disk=UUID=@DISK_UUID@ quiet ${EXTRA_CMDLINE} EOF cp -a "${LE_TMP}/extlinux/$(basename ${dtb}).conf" $RELEASE_DIR/3rdparty/bootloader done