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)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 28 Oct 2024 11:28:46 +0000 (20:28 +0900)
commite2745d5c3dc8c0a559a2ee3d6001d1c4b56e7c56
tree22311a9ee2bb42e17d7d15da2b60fe37a7b28413
parente6b7659cdb47c2a6e8e54199c930b4259e791e18
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>
scripts/tizen/sd_fusing.py