Commit graph

6299 commits

Author SHA1 Message Date
Tao Bao
17cda674f3 Merge "edify: Rename parse_string to ParseString and let it take std::string."
am: 6b18eb706e

Change-Id: I39aad0a1b39cb89adc405bcd8abd9ccc305ee855
2018-07-10 09:52:45 -07:00
Tao Bao
d8a2c2682a Merge "edify: Remove VAL_INVALID and move ValueType into Value class."
am: 503ff38043

Change-Id: I0a99b445b643892f147cde48ae312e87674ba96d
2018-07-10 09:50:33 -07:00
Tao Bao
6b18eb706e Merge "edify: Rename parse_string to ParseString and let it take std::string." 2018-07-10 16:38:08 +00:00
Tao Bao
503ff38043 Merge "edify: Remove VAL_INVALID and move ValueType into Value class." 2018-07-10 16:34:56 +00:00
Tao Bao
254d43a3b9 Merge "applypatch: Restrict applypatch_check to eMMC targets."
am: e02cbaaa62

Change-Id: I931bee4ccdf675cc5c7ead82cae011e0c53555de
2018-07-09 23:28:35 -07:00
Tao Bao
d8d514fa33 edify: Rename parse_string to ParseString and let it take std::string.
Also simplify the helper function expect() in {edify,updater}_test.cpp.

Test: Run recovery_component_test on marlin.
Change-Id: If54febba4b5013f6d71546318a1ca6b635204ac8
2018-07-10 06:27:50 +00:00
Tao Bao
511d759627 edify: Remove VAL_INVALID and move ValueType into Value class.
Test: mmma -j bootable/recovery
Test: Run recovery_component_test and recovery_unit_test on marlin.
Change-Id: I4b240e3e771c387b9694be9c0f2f74e0265ab4cb
2018-07-09 23:20:30 -07:00
Tao Bao
e02cbaaa62 Merge "applypatch: Restrict applypatch_check to eMMC targets." 2018-07-10 06:19:19 +00:00
Tao Bao
471053ba87 Merge "applypatch: Fix a potential nullptr dereferencing."
am: b9b50cd58c

Change-Id: I69b6aedc536ec5391ba3e175b312b8c04453993e
2018-07-09 22:51:10 -07:00
Tao Bao
b9b50cd58c Merge "applypatch: Fix a potential nullptr dereferencing." 2018-07-10 05:42:29 +00:00
Tao Bao
7c1d426dbc applypatch: Restrict applypatch_check to eMMC targets.
Also fix an error-pone behavior in previous code when verifying an eMMC
target. As long as it loads the partition content successfully according
to the SHAs embedded in the filename, it shouldn't further check against
the SHAs given in the second argument. Because the loaded contents
relate to a specific partition size.

For example:

  apply_patch_check(
      "EMMC:/boot.img:src_size:src_hash:tgt_size:tgt_hash",
      "src_hash");

Assume "/boot.img" already has the desired hash of "tgt_hash", the
previous code would give wrong verification result. The issue can be
addressed by additionally listing "tgt_hash" as one of the desired SHAs
(or by applying this CL).

Bug: 110106408
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: I8daafdbecd083f687e24d563ab089caa25667633
2018-07-09 21:13:56 -07:00
Tao Bao
e2136c46cb Merge "updater: Remove the support for sha1_check()."
am: fbc0f6062c

Change-Id: I487b1f9bd35335f39c1dd3ab7a4e5dfe722b1863
2018-07-09 17:17:36 -07:00
Tao Bao
fbc0f6062c Merge "updater: Remove the support for sha1_check()." 2018-07-09 23:56:45 +00:00
Tao Bao
7ea515e6fc applypatch: Fix a potential nullptr dereferencing.
Note that the code exists in debugging path only, and won't be hit
unless device has flaky flash.

Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: I0c71adc271f08f00e3eabd9d14cd8af3186c5bae
2018-07-09 15:22:35 -07:00
Tao Bao
0b58e9a011 updater: Remove the support for sha1_check().
The matching edify function has been removed from EdifyGenerator [1]. In
theory device-specific releasetools script may still use this function,
but it no longer looks useful. Because a) we should use range_sha1()
when asserting the SHA-1 hash of a block device; b) we should look into
the contents when asserting a text file.

[1] https://android-review.googlesource.com/c/platform/build/+/714104

Test: Run recovery_component_test on marlin.
Test: Code search shows no active user.
Change-Id: Id39439101534fb89cf8c5cea80a4b758c8a1a60d
2018-07-09 12:38:19 -07:00
Tao Bao
b450952d6a Merge "updater: Add ABORT command."
am: c059b6c1c6

Change-Id: Ib469e055e7a02fb870158a2ae38a83ea6c80ad7d
2018-07-09 10:49:07 -07:00
Tao Bao
c059b6c1c6 Merge "updater: Add ABORT command." 2018-07-09 17:38:40 +00:00
Tao Bao
91a649ab62 updater: Add ABORT command.
This will be used for testing purpose only, replacing the previously
used "fail", to intentionally abort an update.

As we're separating the logic between commands parsing and execution,
"abort" needs to be considered as a valid command during the parsing.

Test: recovery_unit_test and recovery_component_test on marlin.
Change-Id: I47c41c423e62c41cc8515fd92f3c5959be08da02
2018-07-07 04:12:19 +00:00
Tao Bao
cac6932cf4 Merge "tests: Split unit tests out of component/applypatch_test.cpp."
am: cf1f9bdb12

Change-Id: I757522af647cef17e7e240fc0b22258788e4c634
2018-07-06 14:27:30 -07:00
Tao Bao
cf1f9bdb12 Merge "tests: Split unit tests out of component/applypatch_test.cpp." 2018-07-06 21:18:32 +00:00
Tao Bao
b8cb2e6322 tests: Split unit tests out of component/applypatch_test.cpp.
... into unit/applypatch_test.cpp. And rename the file to
component/applypatch_modes_test.cpp.

Bug: 110106408
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: Ic23c4f054baa2fa0d5e8ea2fcffd22572f1f112e
2018-07-06 12:21:41 -07:00
Jeremy Compostella
d3e023c265 Merge "minui/drm: wait for page flip completion"
am: d419966730

Change-Id: Ibbf3dbbcf89a1757ac305b31cbf29667d8cd26e0
2018-07-03 19:06:01 -07:00
Treehugger Robot
d419966730 Merge "minui/drm: wait for page flip completion" 2018-07-04 01:57:44 +00:00
Tianjie Xu
65419746cb Merge "No longer print hash for stashed blocks during verification of retry"
am: 0a84d7260b

Change-Id: I567bb581faa27a6ba1a4834a8cbe82f8c4052a31
2018-07-03 13:36:21 -07:00
Tianjie Xu
0a84d7260b Merge "No longer print hash for stashed blocks during verification of retry" 2018-07-03 20:22:40 +00:00
Jeremy Compostella
955da1e26d minui/drm: wait for page flip completion
If two consecutive call are made to drmModePageFlip, the second call
may fail with -EBUSY because the first flip is not completed yet.

This patch adds a wait for completion mechanism based on
drmHandleEvent.

Change-Id: Ied13ebefc7523003431b1b307bae70d1a70cb24b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Benoit Fradin <benoit.fradin@intel.com>
2018-07-03 17:43:06 +00:00
Tianjie Xu
3c5958f62d No longer print hash for stashed blocks during verification of retry
During block verification, load stash reads from the source blocks on
the device instead of the stashed files. And for interrupted update,
it's pretty common that the source blocks has already been overwritten
by subsequent commands.

In that case the hash printing is mostly useless. Moreover we should have
already printed the hash when the first update failed.

Bug: 80241799
Test: Unit tests pass. No longer prints mismatching stashed source blocks on retry.
Change-Id: I4effe684280b0325199f6cc4b2cc26e91295c2d7
2018-07-02 16:42:09 -07:00
Tao Bao
42f96e5516 Merge "updater: Check the number of args in Command::Parse."
am: 95b8d2b064

Change-Id: Ic78e44cdca8a1c394f63b99efdcfecea8a3fdd71
2018-06-25 20:42:01 -07:00
Tao Bao
95b8d2b064 Merge "updater: Check the number of args in Command::Parse." 2018-06-26 03:37:03 +00:00
Tao Bao
e6604307f6 Merge "updater: Add Command parsing codes."
am: afc2962e60

Change-Id: I24cc3beca7c75786cbfad37ab273139fd2d1ca2f
2018-06-25 20:36:08 -07:00
Tao Bao
afc2962e60 Merge "updater: Add Command parsing codes." 2018-06-26 03:30:52 +00:00
Tao Bao
92f339372c updater: Check the number of args in Command::Parse.
Additionally checks for excess args when parsing ERASE, FREE, NEW, STASH
and ZERO. Note that the check for MOVE, BSDIFF, IMGDIFF has been covered
in Command::ParseTargetInfoAndSourceInfo.

Test: Run recovery_unit_test on marlin.
Change-Id: Ic8bc9b7a8dcf98f1f8db2e259607564508726857
2018-06-25 13:39:33 -07:00
Tao Bao
6a7e4af7c6 updater: Add Command parsing codes.
The added codes are not used in the updater yet. The switch will happen
in subsequent CLs.

Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: I1ae8a233280f02c2171b43ef028bdccdacb39c59
2018-06-25 13:39:29 -07:00
Tao Bao
839c40513a Merge "applypatch: {Load,Save}FileContents and ParseSha1 take std::string."
am: b4181566f9

Change-Id: I9fb25b58eaa23443d24c3d6ed75d52ac96c7788f
2018-06-25 07:44:17 -07:00
Tao Bao
b4181566f9 Merge "applypatch: {Load,Save}FileContents and ParseSha1 take std::string." 2018-06-25 14:35:03 +00:00
Tao Bao
513c7fb9e0 Merge "applypatch: Move to libbase logging."
am: bd76709827

Change-Id: I64fb20c45acf418040d65176c7c3c478e6c716f1
2018-06-24 10:56:16 -07:00
Treehugger Robot
bd76709827 Merge "applypatch: Move to libbase logging." 2018-06-24 17:47:21 +00:00
Jiyong Park
681ae40d41 Merge "e2fsdroid and mke2fs are dynamic executable in recovery partition"
am: 9b5d4ea20f

Change-Id: I017a76c320f29baff3183b0156c1fdf2deed66bf
2018-06-20 15:24:29 -07:00
Treehugger Robot
9b5d4ea20f Merge "e2fsdroid and mke2fs are dynamic executable in recovery partition" 2018-06-20 22:16:21 +00:00
Tao Bao
8dc704930b applypatch: {Load,Save}FileContents and ParseSha1 take std::string.
Test: mmma -j bootable/recovery
Test: Run recovery_component_test on marlin.
Change-Id: Ifcf244346a88dac833d91b169a4c2aee1fe677f1
2018-06-20 13:21:16 -07:00
Tao Bao
859bfc5659 applypatch: Move to libbase logging.
Test: mmma -j bootable/recovery
Test: Run recovery_component_test on marlin.
Change-Id: I3a4e32eb2c1e231c6690a50571edc66341b8d50a
2018-06-20 13:19:25 -07:00
Tao Bao
d4c1045d4e Merge "applypatch: Clean up the function comments."
am: 24e1321bc3

Change-Id: I5115b9450bc7c40009c3bbf2dd6fbffc9cbfd82c
2018-06-20 09:28:39 -07:00
Tao Bao
ae3e472a43 Merge "updater: Defer the creation of the new data writer."
am: ddc81680e6

Change-Id: Ibfcc5b765103b41316549ee45636ebf4c377cf84
2018-06-20 09:28:19 -07:00
Tao Bao
24e1321bc3 Merge "applypatch: Clean up the function comments." 2018-06-20 16:26:02 +00:00
Tao Bao
ddc81680e6 Merge "updater: Defer the creation of the new data writer." 2018-06-20 16:20:46 +00:00
Jiyong Park
69364fe553 e2fsdroid and mke2fs are dynamic executable in recovery partition
The two utilities are now converted to dynamic executables as shared
libraries are supported in recovery mode.

As part of the conversion, their location has moved from /sbin to
/system/bin. Reflect the change in the program 'recovery'

Bug: 79146551
Test: adb reboot recovery, and select 'Wipe data/factory reset'. The
data partition is formatted and there is no selinux denial.

Change-Id: Ie7cfc4c50ab1e6767e4a5170533ccf826ec7d7f3
2018-06-20 14:24:05 +09:00
Zhomart Mukhamejanov
9b4d364409 Merge "updater_sample: add privileged system app docs"
am: 4a2c2d8102

Change-Id: If55faff049dccc585b0dc1db6c4b795d7b93ea9e
2018-06-19 19:14:52 -07:00
Zhomart Mukhamejanov
4a2c2d8102 Merge "updater_sample: add privileged system app docs" 2018-06-20 02:05:50 +00:00
Tao Bao
155771bafa applypatch: Clean up the function comments.
Also two minor changes (other than renaming some parameters):
 - Added constness to the first parameter of FindMatchingPatch();
 - Declared WriteToPartition() as static.

Bug: 110106408
Test: mmma -j bootable/recovery
Change-Id: I388958c944a23ce4a38a757ce2249f6a89dd4f03
2018-06-19 16:33:50 -07:00
Tao Bao
a855c33880 Merge "Drop the dependency on AB_OTA_UPDATER flag."
am: 9fb0d89583

Change-Id: Id57bbf9ba9d8e4fe905dc183f0655f1b24db89fd
2018-06-19 13:05:24 -07:00