mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 07:17:18 +00:00
fix(writer): Emit checksum event when verifying bmaps (#1859)
Due to the Blockmap.FilterStream not emitting a "checksum" event (as it individually verifies specified ranges), the flashing process would get stuck on finish. This emits a "checksum" event on "finish" when blockmapping, averting this issue. Change-Type: patch
This commit is contained in:
parent
b3b52fce62
commit
6779e15872
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user