diff --git a/lib/writer/index.js b/lib/writer/index.js index 9f7680e2..26f2200f 100644 --- a/lib/writer/index.js +++ b/lib/writer/index.js @@ -272,7 +272,15 @@ class ImageWriter extends EventEmitter { if (options.image.bmap) { debug('verify:bmap') const blockMap = BlockMap.parse(options.image.bmap) - pipeline.append(new BlockMap.FilterStream(blockMap)) + const blockMapStream = new BlockMap.FilterStream(blockMap) + pipeline.append(blockMapStream) + + // NOTE: Because the blockMapStream checksums each range, + // and doesn't emit a final "checksum" event, we artificially + // raise one once the stream finishes + blockMapStream.once('finish', () => { + pipeline.emit('checksum', {}) + }) } else { const checksumStream = new ChecksumStream({ algorithms: options.checksumAlgorithms