build: fix generation of large .vdi images
authorAdones Pitogo <pitogo.adones@gmail.com>
Tue, 11 Jul 2023 05:31:50 +0000 (13:31 +0800)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 15 Jul 2023 20:24:50 +0000 (22:24 +0200)
commit4ab8abfbf7b1e4aa006507e220a4f2db17421845
tree84ea2ad39d0c83637f22eaa1fe28c30c25f54493
parent62496e9a1a0470ee7a4a7719073824defa81cb8c
build: fix generation of large .vdi images

Instead of loading the whole image into the memory when generating the
sha256 sum, we load the file in chunks and update the hash incrementally
to avoid MemoryError in python. Also remove a stray empty line.

Fixes: #13056
Signed-off-by: Adones Pitogo <pitogo.adones@gmail.com>
(mention empty line removal, adds Fixes from PR)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit bdb4b78210cfb6bc8a6cda62fc990dd45ec3054c)
scripts/json_add_image_info.py