mirror of
https://github.com/LibreELEC/LibreELEC.tv
synced 2025-09-24 19:46:01 +07:00
Rockchip: bootloader: cosmetic update
This commit is contained in:
committed by
Christian Hewitt
parent
decfbdad4c
commit
269a3b511e
@@ -16,7 +16,7 @@ if [ "${ROCKCHIP_LEGACY_BOOT}" = "1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PKG_BOOT_INI="${PKG_RKBIN}"/RKBOOT/"${DEVICE}"MINIALL.ini
|
||||
PKG_BOOT_INI="${PKG_RKBIN}/RKBOOT/${DEVICE}MINIALL.ini"
|
||||
if [ ! -f "${PKG_BOOT_INI}" ]; then
|
||||
echo "install: ${PKG_BOOT_INI} does not exist"
|
||||
exit 1
|
||||
@@ -32,26 +32,26 @@ if [ "${ROCKCHIP_LEGACY_BOOT}" = "1" ]; then
|
||||
sed -s 's/\x90\x1\x90\x1\x90\x1\x90\x1\x90\x1\x90\x1/\x20\x3\x20\x3\x20\x3\x20\x3\x20\x3\x20\x3/g' -i "${PKG_DDR_BIN}"
|
||||
fi
|
||||
|
||||
${QEMU} ${PKG_RKBIN}/tools/mkimage -n "${PKG_SOC}" -T rksd -d "${PKG_DDR_BIN}":"${PKG_MINILOADER}" idbloader.img.rk || exit 1
|
||||
${QEMU} ${PKG_RKBIN}/tools/mkimage -n "${PKG_SOC}" -T rksd -d "${PKG_DDR_BIN}:${PKG_MINILOADER}" idbloader.img.rk || exit 1
|
||||
${QEMU} ${PKG_RKBIN}/tools/loaderimage --pack --uboot u-boot-dtb.bin uboot.img.rk "${PKG_LOAD_ADDR}" || exit 1
|
||||
|
||||
dd if=idbloader.img.rk of="${UBOOT_FIT_IMAGE}" seek=0 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||
dd if=uboot.img.rk of="${UBOOT_FIT_IMAGE}" seek=16320 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||
|
||||
if [ "${TARGET_ARCH}" = "aarch64" -o "${TARGET_KERNEL_ARCH}" = "arm64" ]; then
|
||||
PKG_ATF_INI="${PKG_RKBIN}"/RKTRUST/"${DEVICE}"TRUST.ini
|
||||
PKG_ATF_INI="${PKG_RKBIN}/RKTRUST/${DEVICE}TRUST.ini"
|
||||
if [ ! -f "${PKG_ATF_INI}" ]; then
|
||||
echo "install: ${PKG_ATF_INI} does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${QEMU} "${PKG_RKBIN}"/tools/trust_merger --ignore-bl32 --prepath "${PKG_RKBIN}"/ "${PKG_ATF_INI}" || exit 1
|
||||
${QEMU} "${PKG_RKBIN}/tools/trust_merger" --ignore-bl32 --prepath "${PKG_RKBIN}/" "${PKG_ATF_INI}" || exit 1
|
||||
dd if=trust.img of="${UBOOT_FIT_IMAGE}" seek=24512 conv=fsync,notrunc > /dev/null 2>&1 || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "${UBOOT_FIT_IMAGE}" ]; then
|
||||
cp -av "${UBOOT_FIT_IMAGE}" "${INSTALL}"/usr/share/bootloader
|
||||
cp -av "${UBOOT_FIT_IMAGE}" "${INSTALL}/usr/share/bootloader"
|
||||
else
|
||||
echo "install: bootloader ${UBOOT_FIT_IMAGE} was not built."
|
||||
exit 1
|
||||
|
||||
@@ -39,7 +39,7 @@ fi
|
||||
esac
|
||||
|
||||
if [ "${dtb}" != "${new_dtb}" -a -f ${SYSTEM_ROOT}/usr/share/bootloader/${new_dtb} ]; then
|
||||
echo -n "Replacing ${dtb} with ${new_dtb} ... "
|
||||
echo -n "Replacing ${dtb} with ${new_dtb}... "
|
||||
cp -p ${SYSTEM_ROOT}/usr/share/bootloader/${new_dtb} ${BOOT_ROOT} && \
|
||||
sed -e "s/FDT \/${dtb}/FDT \/${new_dtb}/g" \
|
||||
-i ${BOOT_ROOT}/extlinux/extlinux.conf && \
|
||||
@@ -51,15 +51,15 @@ fi
|
||||
cp -p ${SYSTEM_ROOT}/usr/share/bootloader/${dtb} ${BOOT_ROOT}
|
||||
echo "done"
|
||||
elif [ "$(grep -c "FDT /${dtb}" ${BOOT_ROOT}/extlinux/extlinux.conf)" -ne 0 ]; then
|
||||
non_existent_dtb="${dtb}"
|
||||
non_existent_dtb="${dtb}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# update bootloader
|
||||
if [ -f ${SYSTEM_ROOT}/usr/share/bootloader/u-boot-rockchip.bin ]; then
|
||||
echo -n "Updating fit image u-boot-rockchip.bin ... "
|
||||
dd if=${SYSTEM_ROOT}/usr/share/bootloader/u-boot-rockchip.bin of=${BOOT_DISK} bs=32k seek=1 conv=fsync,notrunc &>/dev/null
|
||||
echo -n "Updating U-Boot... "
|
||||
dd if=${SYSTEM_ROOT}/usr/share/bootloader/u-boot-rockchip.bin of=${BOOT_DISK} bs=32k seek=1 conv=fsync &>/dev/null
|
||||
echo "done"
|
||||
fi
|
||||
|
||||
@@ -67,11 +67,9 @@ fi
|
||||
sync
|
||||
mount -o remount,ro ${BOOT_ROOT}
|
||||
|
||||
# warning if device tree was not updated
|
||||
# warn if device tree was not updated
|
||||
if [ -n "${non_existent_dtb}" ]; then
|
||||
echo "The device tree ${non_existent_dtb} your installation uses does not exist in this update package."
|
||||
echo "The updated system will continue to use the device tree from the previous system and your installation might be broken."
|
||||
echo "Please check documentation to find out which boards are supported by this package."
|
||||
echo "WARNING: The device-tree file ${non_existent_dtb} was not found in the update"
|
||||
echo "package and has not been updated. Your device may not boot or work correctly!"
|
||||
sleep 10
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user