|
发表于 2017-3-31 15:50:49
只看该作者
沙发
SYSTEM=${OUT}/system.img
rm -rf ${SYSTEM}
echo "Generate System image : ${SYSTEM} !"
dd if=/dev/zero of=${SYSTEM} bs=1M count=0 seek=$SIZE
parted -s ${SYSTEM} mklabel gpt
parted -s ${SYSTEM} unit s mkpart loader1 ${LOADER1_START} `expr ${RESERVED1_START} - 1`
parted -s ${SYSTEM} unit s mkpart reserved1 ${RESERVED1_START} `expr ${RESERVED2_START} - 1`
parted -s ${SYSTEM} unit s mkpart reserved2 ${RESERVED2_START} `expr ${LOADER2_START} - 1`
parted -s ${SYSTEM} unit s mkpart loader2 ${LOADER2_START} `expr ${ATF_START} - 1`
parted -s ${SYSTEM} unit s mkpart atf ${ATF_START} `expr ${BOOT_START} - 1`
parted -s ${SYSTEM} unit s mkpart boot ${BOOT_START} `expr ${ROOTFS_START} - 1`
parted -s ${SYSTEM} set 6 boot on
parted -s ${SYSTEM} unit s mkpart root ${ROOTFS_START} 100%
# burn u-boot
if [ "$CHIP" == "rk3288" ] || [ "$CHIP" == "rk3036" ]; then
dd if=${OUT}/u-boot/u-boot.out of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
elif [ "$CHIP" == "rk3399" ]; then
dd if=${LOCALPATH}/rkbin/rk33/RK3399MiniLoaderAll_V1.05.bin of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
dd if=${OUT}/u-boot/uboot.img of=${SYSTEM} seek=${LOADER2_START} conv=notrunc
dd if=${OUT}/u-boot/trust.img of=${SYSTEM} seek=${ATF_START} conv=notrunc
elif [ "$CHIP" == "rk3328" ]; then
dd if=${LOCALPATH}/rkbin/rk33/RK3328MiniLoaderAll_V1.05.bin of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
dd if=${OUT}/u-boot/uboot.img of=${SYSTEM} seek=${LOADER2_START} conv=notrunc
dd if=${OUT}/u-boot/trust.img of=${SYSTEM} seek=${ATF_START} conv=notrunc
fi
# burn boot image
if [ ! -e ${OUT}/boot.img ] ; then
echo -e "\e[31m CAN'T FIND BOOT IMAGE \e[0m"
exit
fi
dd if=${OUT}/boot.img of=${SYSTEM} conv=notrunc seek=${BOOT_START}
# burn rootfs image
if [ ! -e ${ROOTFS_PATH} ] ; then
echo -e "\e[31m CAN'T FIND ROOTFS IMAGE \e[0m"
exit
fi
dd if=${ROOTFS_PATH} of=${SYSTEM} seek=${ROOTFS_START}
}
通过这种方式来烧写的sd卡,
loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img
cd ../
$TOOLPATH/trust_merger $TOOLPATH/RK3399TRUST.ini
cd ${LOCALPATH}/u-boot
cp uboot.img ${OUT}/u-boot/
mv ../trust.img ${OUT}/u-boot/
通过这种方式来制作的uboot
这个过程有什么问题吗?有没有人指导一下呀
|
|