# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)

SRCDIR="$BUILD/image/system/usr/share/bootloader"
DSTDIR="$RELEASE_DIR/3rdparty/bootloader"

mkdir -p "$DSTDIR/overlays"
  if [ -n "$UBOOT_SYSTEM" ]; then
    cp -a "$SRCDIR/u-boot-sunxi-with-spl.bin" "$DSTDIR"
  fi

  cp -a "$SRCDIR"/sun*-${DEVICE,,}-*.dtb "$DSTDIR"

  cp -a "$SRCDIR"/overlays/sun*-${DEVICE,,}-*.dtbo "$DSTDIR"/overlays > /dev/null 2>&1 || true
