OSHW-DEIMOS/SOFTWARE/A64-TERES/scripts/flash_u-boot_only.sh
Dimitar Gamishev 90795bdcf0 Added scripts to help flashing boot0/uboot only Author : Simon Eisenmann longsleep
U-Boot config modified to speed up boot process
2018-12-05 11:31:15 +02:00

29 lines
443 B
Bash
Executable File

#!/bin/sh
#
# Simple script to replace u-boot-with-dtb.bin in an existing image.
#
set -e
out="$1"
uboot="$2"
if [ -z "$out" ]; then
echo "Usage: $0 /dev/sdX [<u-boot-with-dtb.bin>]"
exit 1
fi
if [ -z "$uboot" ]; then
uboot="../build/u-boot-with-dtb.bin"
fi
uboot_position=19096 # KiB
if [ ! -e "$out" ]; then
echo "Error: $out not found"
exit 1
fi
pv "$uboot" | dd conv=notrunc bs=1k seek=$uboot_position of="$out"
sync