Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 44fd7f61 authored by Yifan Hong's avatar Yifan Hong
Browse files

libsnapshot: bootloader rejects wipe in proper time.

Calls into HAL first to reject wipes early. Otherwise, there may
be a small window where wipes needs to be rejected but bootloader
doesn't know about it.

Consider the following flow in existing code:
1. sets file to merging
2. devices crashes / shuts down before calling into HAL
3. first-stage init maps dm-snapshot-merge
4. reboot into fastbootd / bootloader
5. wipe

At this point, bootloader / fastbootd won't know that merge
has already taken place.

Reorder so that snapshotctl notifies bootloader before writing
the file.

When switching from merging back to none:

0. merge has completed
1. sets file to none
2. devices crashes / shuts down before calling into HAL
3. first-stage init maps dm-linear
4. reboot into fastbootd / bootloader and wipe (fail)
5. reboot, snapshotctl resets state to none (calls into HAL)
6. reboot into fastbootd / bootloader and wipe (successful)

Test: libsnapshot_test
Change-Id: I2b430049c79bf1a751167db7fce74502ac26490a
parent a487793f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment