embeddedTS / buildroot-ts

BR_EXTERNAL support for Technologic Systems SBCs
4 stars 2 forks source link

Only decompress source .dd once when writing image to disk #23

Closed ts-kris closed 2 years ago

ts-kris commented 2 years ago

When a .dd.md5 file is provided, the process would decompress the image once to write to disk, and again to get the total byte count of the .dd source. Instead, implement a FIFO and some clever redirects to pipe decompressed data to disk and to wc to get byte count at the same time. If a .dd.md5 file is present, this byte count is used.

One less decompress has a time savings of about 30% though this is heavily dependent on CPU, disk speed, compression algorithm, etc.