Skip to content

Commit

Permalink
signimage: circumvent 'short read' images
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPawn committed Jul 13, 2019
1 parent 6348c08 commit f2a2f3a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions signimage/sign_image
Expand Up @@ -385,6 +385,15 @@ if [ $(( ( copy_blocks + 2 ) % 20 )) -eq 0 ]; then
echo -ne "Repeating first entry as filler ... " 1>&2
"$YF_SIGNIMAGE_DD" if="$image_file" of="$tmp/filler.bin" bs=512 count=1 status=none 2>/dev/null
show_ok
elif [ $(( copy_blocks % 8 )) -eq 5 ] || [ $(( copy_blocks % 8 )) -eq 6 ]; then
# Our signature would nearly fill the last 4K block and another error would get triggered
# (a tar file without proper EoA blocks is used by AVM, if in last 4K block only 1 or 0
# 512-byte blocks are free at the end - it results usually in a "short read" from tar).
echo -ne "Repeating first entry as filler ... " 1>&2
( "$YF_SIGNIMAGE_DD" if="$image_file" bs=512 count=1 status=none 2>/dev/null; \
"$YF_SIGNIMAGE_DD" if="$image_file" bs=512 count=1 status=none 2>/dev/null; ) \
> "$tmp/filler.bin"
show_ok
else
touch "$tmp/filler.bin"
fi
Expand Down

0 comments on commit f2a2f3a

Please sign in to comment.