diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2023-02-21 03:39:19 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2023-02-21 03:40:09 +0100 |
commit | f8b77a4b120b167982c0c22a8803647f786fc805 (patch) | |
tree | 41dc092c217fc1d0e654cd28fff14f507a0b723d | |
parent | e69eb3d8121b9843a31c94be1961d75b1b8ff5bf (diff) | |
download | u-boot-midas-recovery-2018.07.tar.gz u-boot-midas-recovery-2018.07.tar.bz2 u-boot-midas-recovery-2018.07.zip |
create_4412_*_image.sh: improve error reportingHEADrecovery-2018.07
Without that fix, it would fail silently if the required
images were not found.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-x | create_4412_emmc_image.sh | 19 | ||||
-rwxr-xr-x | create_4412_sd_image.sh | 19 |
2 files changed, 28 insertions, 10 deletions
diff --git a/create_4412_emmc_image.sh b/create_4412_emmc_image.sh index 5187d6bc85..f821d181f8 100755 --- a/create_4412_emmc_image.sh +++ b/create_4412_emmc_image.sh @@ -7,6 +7,15 @@ # published by the Free Software Foundation. # #################################### +check_for_file() +{ + file="$1" + if [ ! -f "${file}" ] ; then + echo "Error: ${file} not found" + exit 66 # EX_NOINPUT + fi +} + if [ -z $1 ] then echo "usage: ./create_4412_emmc_image.sh <output file>" @@ -27,14 +36,14 @@ bl2_pos=$(($fwbl1_pos + $fwbl1_size)) uboot_pos=$(($bl2_pos + $bl2_size)) #################################### -echo "Exynos4412 FWBL1 fusing" -dd if=./p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos +check_for_file p4412_s_fwbl1.bin +dd if=p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos #################################### -echo "Exynos4412 BL2 fusing" +check_for_file spl/midas-spl.bin dd if=spl/midas-spl.bin of=$1 bs=$block_size seek=$bl2_pos #################################### -echo "Exynos4412 bootloader fusing" -dd if=./u-boot.bin of=$1 bs=$block_size seek=$uboot_pos +check_for_file u-boot.bin +dd if=u-boot.bin of=$1 bs=$block_size seek=$uboot_pos #################################### sync diff --git a/create_4412_sd_image.sh b/create_4412_sd_image.sh index 226d612a1e..7a1cef4a09 100755 --- a/create_4412_sd_image.sh +++ b/create_4412_sd_image.sh @@ -7,6 +7,15 @@ # published by the Free Software Foundation. # #################################### +check_for_file() +{ + file="$1" + if [ ! -f "${file}" ] ; then + echo "Error: ${file} not found" + exit 66 # EX_NOINPUT + fi +} + if [ -z $1 ] then echo "usage: ./create_4412_sd_image.sh <output file>" @@ -30,14 +39,14 @@ bl2_pos=$(($fwbl1_pos + $fwbl1_size)) uboot_pos=$(($bl2_pos + $bl2_size)) #################################### -echo "Exynos4412 FWBL1 fusing" -dd if=./p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos +check_for_file p4412_s_fwbl1.bin +dd if=p4412_s_fwbl1.bin of=$1 bs=$block_size seek=$fwbl1_pos #################################### -echo "Exynos4412 BL2 fusing" +check_for_file spl/midas-spl.bin dd if=spl/midas-spl.bin of=$1 bs=$block_size seek=$bl2_pos #################################### -echo "Exynos4412 bootloader fusing" -dd if=./u-boot.bin of=$1 bs=$block_size seek=$uboot_pos +check_for_file u-boot.bin +dd if=u-boot.bin of=$1 bs=$block_size seek=$uboot_pos #################################### sync |