From 319c95b5aebe27e26e3c5d7b0eb8250ab1640155 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 3 Nov 2015 01:23:54 +0100 Subject: update.sh: source update script only if loaded successfully Source the update script only if loading succeeded. This avoids loops if board_name is not set. Also add a test if board_name is really set since this variable is/was not available in older U-Boots. --- recipes/images/files/library/fwd_blk.scr | 4 ++-- recipes/images/files/library/fwd_eth.scr | 4 ++-- recipes/images/files/library/fwd_mmc.scr | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'recipes') diff --git a/recipes/images/files/library/fwd_blk.scr b/recipes/images/files/library/fwd_blk.scr index 9db3744..f694caa 100644 --- a/recipes/images/files/library/fwd_blk.scr +++ b/recipes/images/files/library/fwd_blk.scr @@ -4,5 +4,5 @@ test -n ${drive} || setenv drive 1 test "${board_name}" = "colibri_t20" && setenv drive 0 test "${board_name}" = "colibri_vf" && setenv drive 0 -fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img -source ${loadaddr} +test -n ${board_name} || echo "board_name env not set!" && exit +fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img && source ${loadaddr} diff --git a/recipes/images/files/library/fwd_eth.scr b/recipes/images/files/library/fwd_eth.scr index 18ae3ad..8b35af0 100644 --- a/recipes/images/files/library/fwd_eth.scr +++ b/recipes/images/files/library/fwd_eth.scr @@ -1,3 +1,3 @@ #the update.sh script renames this. fwd_eth.scr -> ../flash_eth.img -tftpboot ${loadaddr} "${board_name}/flash_eth.img" -source ${loadaddr} +test -n ${board_name} || echo "board_name env not set!" && exit +tftpboot ${loadaddr} "${board_name}/flash_eth.img" && source ${loadaddr} diff --git a/recipes/images/files/library/fwd_mmc.scr b/recipes/images/files/library/fwd_mmc.scr index 561a861..4731435 100644 --- a/recipes/images/files/library/fwd_mmc.scr +++ b/recipes/images/files/library/fwd_mmc.scr @@ -5,5 +5,5 @@ test -n ${drive} || setenv drive 1 test "${board_name}" = "colibri_t20" && setenv drive 0 test "${board_name}" = "colibri_vf" && setenv drive 0 -fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img -source ${loadaddr} +test -n ${board_name} || echo "board_name env not set!" && exit +fatload ${interface} ${drive}:1 ${loadaddr} ${board_name}/flash_blk.img && source ${loadaddr} -- cgit v1.2.3