Files
LibreELEC.tv/projects/Rockchip/bootloader/mkimage
2025-09-12 09:30:58 +00:00

30 lines
1.0 KiB
Plaintext

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
if [ -z "${DTB}" ]; then
echo "image: copying device tree blobs..."
mmd rockchip >"${SAVE_ERROR}" 2>&1 || show_error
mcopy "${RELEASE_DIR}/3rdparty/bootloader/"*.dtb ::/rockchip >"${SAVE_ERROR}" 2>&1 || show_error
echo "image: copying extlinux.conf..."
mkdir -p "${IMG_TMP}/extlinux"
cat <<EOF >"${IMG_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s "${IMG_TMP}/extlinux" :: >"${SAVE_ERROR}" 2>&1 || show_error
fi
if [ -n "${UBOOT_SYSTEM}" ]; then
BOOTLOADER_PATH="${RELEASE_DIR}/3rdparty/bootloader/u-boot-rockchip.bin"
if [ -f "${BOOTLOADER_PATH}" ]; then
echo "image: burn bootloader to image..."
dd if="${BOOTLOADER_PATH}" of="${DISK}" bs=32k seek=1 conv=fsync,notrunc >"${SAVE_ERROR}" 2>&1 || show_error
else
echo "image: bootloader ${BOOTLOADER_PATH} does not exist.";
exit 1
fi
fi