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>
Wed, 19 Jul 2023 19:55:18 +0000 (21:55 +0200)
commitcc54e19b2052d1f003637132d834bb4a2f2562d5
tree087785a3bd2d6153338f7cc6e225509e38bfbbd3
parenta7867e0cb74c887ac6f3e0af4c97447114d382bc
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