1
0
mirror of https://github.com/paolosabatino/multitool.git synced 2024-11-25 02:56:13 +00:00
multitool/sources/rk322x/boot_install
Paolo Sabatino b337dec818 Added full support for rk3288 boxes that use a legacy non-open boot
Modified multitool.sh to better support compressed archives
2020-06-06 16:15:53 +02:00

49 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
echo "Creating and installing u-boot.img for rockchip rk322x platform"
"$TOOLS_PATH/loaderimage" --pack --uboot "${TS_SOURCES_PATH}/${UBOOT_IMAGE}" "${DIST_PATH}/uboot.img" $UBOOT_ADDR >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not create uboot.img"
exit 18
fi
dd if="${DIST_PATH}/uboot.img" of="$LOOP_DEVICE" seek=$((0x4000)) conv=sync,fsync >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not install uboot.img"
exit 19
fi
echo "Creating and installing trustos.img for rockchip platform"
"$TOOLS_PATH/loaderimage" --pack --trustos "${TS_SOURCES_PATH}/${TRUST_OS}" "${DIST_PATH}/trustos.img" $TRUST_ADDR >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not create trustos.img"
exit 20
fi
echo "Creating legacy u-boot for rockchip platform"
"$TOOLS_PATH/loaderimage" --pack --uboot "${TS_SOURCES_PATH}/${LEGACY_UBOOT_IMAGE}" "${DIST_PATH}/legacy-uboot.img" $LEGACY_UBOOT_ADDR >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not pack legacy rockchip u-boot"
exit 32
fi
dd if="${DIST_PATH}/trustos.img" of="$LOOP_DEVICE" seek=$((0x6000)) conv=sync,fsync >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not install trustos.img"
exit 21
fi
echo "Installing idbloader.img"
dd if="${TS_SOURCES_PATH}/${IDBLOADER}" of="$LOOP_DEVICE" seek=$((0x40)) conv=sync,fsync >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Could not install idbloader.img"
exit 22
fi