summaryrefslogtreecommitdiff
path: root/recipes-images/images/files/library/imx6
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2017-07-12 16:34:48 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-10-03 18:22:40 +0200
commit49ccf02a0a04607045f560d682df97a341e1170b (patch)
tree02521cf597426e5e62e643d5848030097237608a /recipes-images/images/files/library/imx6
parent3ea215d6215bb3250fb4d810c8f78feaffb106d7 (diff)
flash_blk/eth.scr: fix exit condition in the emmc rootfs flashing loop
If an image creates a rootfs which is exactly a multiple of 64 MByte then the scripts never detects that the last chunk has been read and 'run update' never completes. Fix that by explicitely setting filesize to 0 when a file read fails. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'recipes-images/images/files/library/imx6')
-rw-r--r--recipes-images/images/files/library/imx6/flash_blk.scr2
-rw-r--r--recipes-images/images/files/library/imx6/flash_eth.scr2
2 files changed, 2 insertions, 2 deletions
diff --git a/recipes-images/images/files/library/imx6/flash_blk.scr b/recipes-images/images/files/library/imx6/flash_blk.scr
index ec3e00b..2a905ac 100644
--- a/recipes-images/images/files/library/imx6/flash_blk.scr
+++ b/recipes-images/images/files/library/imx6/flash_blk.scr
@@ -17,7 +17,7 @@ setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loa
setenv migrate_uboot_old 'setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1'
setenv migrate_uboot 'run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} ${filesize} ${filepos}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_spl 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}'
setenv update_uboot_bin 'load ${interface} ${drive}:1 ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}'
diff --git a/recipes-images/images/files/library/imx6/flash_eth.scr b/recipes-images/images/files/library/imx6/flash_eth.scr
index 77e2ac9..4866e5c 100644
--- a/recipes-images/images/files/library/imx6/flash_eth.scr
+++ b/recipes-images/images/files/library/imx6/flash_eth.scr
@@ -15,7 +15,7 @@ setenv migrate_configblock 'run check_configblock; mmc dev 0 0 && mmc read ${loa
setenv migrate_uboot_old 'setenv uboot_hwpart 0; run update_spl && run update_uboot_bin; setenv uboot_hwpart 1'
setenv migrate_uboot 'run update_spl && run update_uboot_bin && mmc bootbus 0 2 1 2 && mmc partconf 0 1 1 0'
-setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum}; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
+setenv cp_file_chunk 'tftpboot ${loadaddr} ${board_name}/root.ext3-${filenum} || setenv filesize 0; run set_blkcnt; mmc dev 0 0 && mmc write ${loadaddr} ${blkstart} ${blkcnt}'
setenv update_spl 'tftpboot ${loadaddr} ${board_name}/SPL && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 2 ${blkcnt}'
setenv update_uboot_bin 'tftpboot ${loadaddr} ${board_name}/u-boot.imx-spl && run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} 8a ${blkcnt}'