Skip to content

Commit 4fe40ac

Browse files
committed
flash one system
1 parent ff00b7d commit 4fe40ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/manager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,17 @@ export class FlashManager {
392392

393393
try {
394394
for await (const image of systemImages) {
395-
const [onDownload, onFlash] = createSteps([1, image.hasAB ? 2 : 1], this.#setProgress.bind(this))
395+
// Flash system to slot A only (large, slow), other A/B partitions to both slots
396+
const flashBothSlots = image.hasAB && image.name !== 'system'
397+
const [onDownload, onFlash] = createSteps([1, flashBothSlots ? 2 : 1], this.#setProgress.bind(this))
396398

397399
this.#setMessage(`Downloading ${image.name}`)
398400
await this.imageManager.downloadImage(image, onDownload)
399401
const blob = await this.imageManager.getImage(image)
400402
onDownload(1.0)
401403

402-
// Flash image to each slot
403-
const slots = image.hasAB ? ['_a', '_b'] : ['']
404+
const slots = flashBothSlots ? ['_a', '_b'] : (image.hasAB ? ['_a'] : [''])
404405
for (const [slot, onSlotProgress] of withProgress(slots, onFlash)) {
405-
// NOTE: userdata image name does not match partition name
406406
const partitionName = `${image.name.startsWith('userdata_') ? 'userdata' : image.name}${slot}`
407407

408408
this.#setMessage(`Flashing ${partitionName}`)

0 commit comments

Comments
 (0)