scripts: sd_fusing: Fix to write both a/b partition
authorSangYoun Kwak <sy.kwak@samsung.com>
Thu, 11 Jul 2024 11:46:50 +0000 (20:46 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Wed, 4 Dec 2024 11:00:01 +0000 (12:00 +0100)
commit821b312f6758a8037adf6b71dccc5ba073a2aec5
tree832037383b13c2c972227ca0a67280efed9b5d2a
parent3a3bd39d7c2369d170ecbe4ac48025293f51d372
scripts: sd_fusing: Fix to write both a/b partition

If sd_fusing script is executed with '--update ab' option, it should
write images to both a/b partitions.

When writing images, first, script reads image and writes to the
partition a until the image reaches the end.
Next, script reads image and writes to the partition b but it uses same
file object so there is nothing left to read. Thus, script writes
nothing to the partition b.

To fix this issue, a method call of the file object ".seek(0)" is added
before writing to the partitions. This will set cursor to the initial
position and the the image can be written to the partition b.

Change-Id: I78c1b3c77b6666a133527ba544911de8c4de44d4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
sd_fusing.py