History log of /system/update_engine/payload_consumer/delta_performer.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8371c1c852eae461043d8a3d911394a0ec0db909 01-Feb-2018 Sen Jiang <senj@google.com> Implement VerifyPayloadApplicable.

Parse the payload metadata and validate the source hash of all operations.
Return false if any error occur or hash mismatch.

Bug: 65283633
Test: mma

Change-Id: I6f5ae3cb69f4de973cecd0e3d7b733a48b2462f1
/system/update_engine/payload_consumer/delta_performer.h
9c89e8499abeac3894718120d12b41301ffa3fc1 02-Feb-2018 Sen Jiang <senj@google.com> Split payload metadata logic from DeltaPerformer into its own class.

DeltaPerformer have code for both parsing payload and performing
operations. This change moves parsing payload header and validating
metadata signature to a new class PayloadMetadata so that
DeltaPerformer can focus on performing.

We will also have new code in another class that will use the new
PayloadMetadata class to parse payload metadata.

Bug: 65283633
Test: update_engine_unittests
Change-Id: Ie20b84713a0c66867a1de9d3d0cc29d0189b3c97
/system/update_engine/payload_consumer/delta_performer.h
b379d19c05c5128a7fa45b72dbe74a764d143b98 07-Dec-2017 Amin Hassani <ahassani@google.com> Restructure hash calculation in delta_performer

This patch moves DeltaPerformer::CalculateAndValidateHash to
fd_utils::ReadAndHashExtents and cleans up the code. It also adds
unittests for ReadAndHashExtents.

Bug: None
Test: unittest pass

Change-Id: I297cf79ef38a7495d5bcc0e6516a1ca783e505ea
Signed-off-by: Amin Hassani <ahassani@google.com>
/system/update_engine/payload_consumer/delta_performer.h
1841408827c93f8ba7bb44ba95a8fb3438762b9d 11-Jan-2018 Sen Jiang <senj@google.com> Merge remote-tracking branch 'goog/upstream-master'.

The following commits were reverted:
840703a Fix update over cellular network on guest account
eaad5d0 Do not merge to AOSP: Fixes the link to brillo-clang-format in CrOS
740efad Reboot even if a system update is not available.

Fixed a few sign compare warnings.
Had to ifdef out 2 SquashfsFilesystemTest because it depends on unsquashfs -m.

Test: update_engine_unittests
Change-Id: I6f4ca5003e78c76064ec60d0797505d8c18d00bf
Merged-In: I6f4ca5003e78c76064ec60d0797505d8c18d00bf
02855c25944b8d64e569e9e8051be514acf40438 07-Sep-2017 Amin Hassani <ahassani@google.com> update_engine: Apply PUFFDIFF operation

This patch adds operation for applying PUFFDIFF operation. As long as
the minor version is not increased, this patch will not be directly
used.

This patch sets the cache requirement for PUFFDIFF operation to 5MB as it has
been selected for now from sample data below:

Update from ToT(R64) to veyron-minnie-R63-9928.0.0
Cache Size (MB) - Time to Update (minutes)
no-puffdiff 0:04:20
50 0:05:30
20 0:06:40
10 0:09:10
5 0:11:00
3 0:13:40
2 0:15:45
1 0:19:30

BUG=chromium:717785
TEST=brillo_update_payload verify passes; unittests pass;
CQ-DEPEND=CL:722452

Change-Id: I481481d40ef9df6412782198e3c97deb3997cc2e
Reviewed-on: https://chromium-review.googlesource.com/658297
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
/system/update_engine/payload_consumer/delta_performer.h
db56be971d5c1adb405858e24ca772b5f3290099 06-Sep-2017 Amin Hassani <ahassani@google.com> update_engine: Use ExtentReader

Updates CopyAndHashExtents to use the new ExtentReader.

Adds CalculateAndValidatffeSourceHash() to DeltaPerformer to be used in both
SOURCE_BSDIFF and PUFFDIFF.

BUG=chromium:761138
TEST=FEATURES="test" emerge-amd64-generic update_engine; brillo_update_payload verify

Change-Id: I2e0c10fe0078c5a1ab4cd646a91d42893b6b691b
Reviewed-on: https://chromium-review.googlesource.com/653478
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
/system/update_engine/payload_consumer/delta_performer.h
7ecda265a87236e83cf820364947a1618872b6be 12-Jul-2017 Amin Hassani <ahassani@google.com> Open partitions with O_DSYNC flag only if the update is periodic.

Currently when updating we always open the target partition with flag O_DSYNC
(CL:562552), but this makes all infrastructure operations like 'cros flash',
provisioning, force update, paygen, etc much slower. This changes the update
engine to only add O_DSYNC flag if an update is triggered by periodic checks
(not interactively forced). This means if the user clicks on 'check for update'
it will be an interactive update and O_DSYNC will not be used. This change keeps
the AOSP partitions open without O_DSYNC flag. This CL uses non-interactive mode
for all unit tests but currently there are no integration test like provisioning
for triggering periodic updates.

Currently 'parrot' board canaries (only board with rotating HDD) is failing due
to timeouts related to slow updates. This CL potentially will clear that problem.

TEST=cros_workon_make --test, installed an image with/out the O_DSYCN flag and
measured the 'cros flash' time.
BUG=chromium:738027

Change-Id: If45fcf5e798b9c9353e09021ad812c859d983a65
Reviewed-on: https://chromium-review.googlesource.com/567360
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
/system/update_engine/payload_consumer/delta_performer.h
0affc2c099fac47b999ba39f8f1bacb418e65a97 11-Feb-2017 Sen Jiang <senj@google.com> Parse multiple packages from Omaha response.

The multi-payload info are stored in OmahaResponse and InstallPlan, but
we still can only apply the first payload for now.

Bug: 36252799
Test: mma -j
Test: update_engine_unittests

Change-Id: I5ca63944ae9082670d0e67888409374f140d4245
(cherry picked from commit 2aba8a87d4fac245a2e2d238b3159f8eabce630f)
/system/update_engine/payload_consumer/delta_performer.h
2703ef4466066d64d8021904e233b120f38c0272 16-Mar-2017 Sen Jiang <senj@google.com> Store raw payload hash blob in install plan.

We were using a custom sha256 pair in Omaha response, now that Omaha
has a standard hash_sha256 field in package, we should use that instead.

The difference is that hash_sha256 is encoded in hex instead of base64,
but the android payload property is still using base64, to be backward
compatible, we have to keep accepting base64 there, to avoid decoding
and then re-encoding to another encoding, we store the decoded raw hash.

Also removed the hash() related functions in HashCalculator, since it's
rarely used and the caller should encode it in whatever encoding they
want.
Also make use of RawHashOfBytes to simply code in a few places.

Bug: 36252799
Test: update_engine_unittests
Change-Id: Iaa02611b4c9cda3ead5de51e777e8caba6d99d93
(cherry picked from commit f14d51b6823522f6b2eb834f9e14d72c8363a3ad)
/system/update_engine/payload_consumer/delta_performer.h
eecb0a5b696c830e3db5019654141dc58fbef825 20-May-2017 Alex Deymo <deymo@google.com> Remove IMGDIFF operation application support.

Remove support for applying IMGDIFF operations as this will be replaced
with PUFFIN.

Bug: None
Test: Unittests still build.
Change-Id: Idd8151a4fc772c70359afdd2da8d4a2f05bbd293
/system/update_engine/payload_consumer/delta_performer.h
5c6bb1d8f89b87e782e26fe74789b6f510704394 27-Jul-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy performance warnings in update_engine.

* Use const reference type for parameters, local variables,
and for-loop index variables to avoid unnecessary copy.
* Convert some for-loops to for-rang loops.

Bug: 30407689
Bug: 30413223
Bug: 30413862
Change-Id: I78996b3f799639fc57ced45e110807625be7dcce
Test: build with WITH_TIDY=1
/system/update_engine/payload_consumer/delta_performer.h
be2c47bad96b46985bdcedceabbe6baa1f8a23f5 15-Jun-2016 Sen Jiang <senj@google.com> Return correct error code when source operation hash mismatch.

Now it returns kDownloadStateInitializationError.

Test: delta update on a modified system.
Bug: 28769126

Change-Id: Iedfe938d6a0db8ae5ac137d073e61f550e3d71a9
/system/update_engine/payload_consumer/delta_performer.h
fef85fd9ece49941db274559a938fe8b2c5157bf 25-Mar-2016 Sen Jiang <senj@google.com> Remove ComputeSourceHash mode in FileSystemVerification action.

This mode was used to calculate the source partition hash before download
the payload, and we will verify it against the hash in the payload.
Now that we are using per-operation source hash, this mode is no longer
needed.

Test: ./update_engine_unittests
Test: cros_workon_make update_engine --test
Bug: 26972259

Change-Id: Ie30a38cfd9f94e4efe02dfc8664e6785018261f6
/system/update_engine/payload_consumer/delta_performer.h
bc3e6b00d2ed50d5fd77f2a74348608e52935e6d 19-Jan-2016 Sen Jiang <senj@google.com> Implement IMGDIFF operation in the client.

This operation is used to apply update on gzipped data with much smaller
diff data than bsdiff.

update_engine only calls ApplyImagePatch() with all the data, the actuall
implementation of the imgdiff format is in bootable/recovery/applypatch.

Test: mma & added unittest
Bug: 26628339

Change-Id: I2b8a097aa68727b06be101cc06a3a896b835a815
/system/update_engine/payload_consumer/delta_performer.h
0103c36caa2e38e034e0d22185736b9ccfb35c58 20-Jan-2016 Alex Vakulenko <avakulenko@google.com> update_engine: Update libchrome APIs to r369476

The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

Change-Id: I42e65bda7f1dbdf6f6e0ebf356d2cfea6b729193
/system/update_engine/payload_consumer/delta_performer.h
542c19bf271011913a9f352f58e140224c936736 03-Dec-2015 Alex Deymo <deymo@google.com> Remove SystemState references from DeltaPerformer.

DeltaPerformer is used as part of the DownloadAction and had
references to the global SystemState. The common references to
BootControlInterface (to query the partitions based on the names
from the payload) and the HardwareInterface (for dev-mode bits) are
now referenced directly from the DeltaPerformer. The calls to
UpdateAttempter and PayloadState were moved to the
DownloadActionDelegate since these calls are received by classes
outside the payload_consumer.

Bug: 25773375
TEST=FEATURES=test emerge-link update_engine

Change-Id: Id2e81d5ccf835cad22f03b069c681dcce104c456
/system/update_engine/payload_consumer/delta_performer.h
39910dcd1d68987ccee7c3031dc269233a8490bb 10-Nov-2015 Alex Deymo <deymo@google.com> Split payload application code into a subdirectory.

This patch splits from the main libupdate_engine code the part that
is strictly used to download and apply a payload into a new static
library, moving the code to subdirectories. The new library is divided
in two subdirectories: common/ and payload_consumer/, and should not
depend on other update_engine files outside those two subdirectories.
The main difference between those two is that the common/ tools are more
generic and not tied to the payload consumer process, but otherwise they
are both compiled together.

There are still dependencies from the new libpayload_consumer library
into the main directory files and DBus generated files. Those will be
addressed in follow up CLs.

Bug: 25197634
Test: FEATURES=test emerge-link update_engine; `mm` on Brillo.

Change-Id: Id8d0204ea573627e6e26ca9ea17b9592ca95bc23
/system/update_engine/payload_consumer/delta_performer.h