update_engine: Unify disk access for SOURCE_BSDIFF through update_engine
Switch bspatch to use ExtentReader and ExtentWriter. This allows to:
- Cache the writes.
- Unify all the reads through ExtentReader object.
- Unify all the writes through ExtentWrite object.
This patch allows running bspatch without being dependent on how bspatch reads
and writes from disk. The disk access can be controlled through update_engine
itself. Currently, SOURCE_BSDIFF operation can still cause bugs such as
b/31709028. But through this mechanism, those kind of problems can be
alleviated.
BUG=chromium:762815
TEST=unittests pass; brillo_update_payload verify passes;
Change-Id: I3f8e29366743d0383d41bf3700e9db3135fbd82a
Reviewed-on: https://chromium-review.googlesource.com/683357
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
1 file changed