mirror of
https://github.com/paolosabatino/multitool.git
synced 2024-11-22 09:36:17 +00:00
51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "Creating and installing u-boot.img for rockchip rk3318 platform"
|
|
#cp "${TS_SOURCES_PATH}/${UBOOT_IMAGE}" "${DIST_PATH}/uboot.img"
|
|
"$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"
|
|
cp "${TS_SOURCES_PATH}/${TRUST_OS}" "${DIST_PATH}/trustos.img"
|
|
#"$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
|