Commit Graph

6346 Commits

Author SHA1 Message Date
Tao Bao 22c5aed89e Merge "applypatch: Fix the return type of FreeSpaceForFile()." am: 90c9e4f55c
am: c9f676bc64

Change-Id: I669d213a9c2351183ebf28e2d7861d8e85daf649
2018-07-12 17:14:44 -07:00
Tao Bao c9f676bc64 Merge "applypatch: Fix the return type of FreeSpaceForFile()."
am: 90c9e4f55c

Change-Id: Ia14468f77220b5e98a0d228b097bbf61401fbe30
2018-07-12 16:52:53 -07:00
Tao Bao 90c9e4f55c Merge "applypatch: Fix the return type of FreeSpaceForFile()." 2018-07-12 23:07:31 +00:00
Tao Bao 50b99abc6d Merge "applypatch: Switch freecache.cpp to libbase logging." am: a0b2aad0f8
am: cea180895c

Change-Id: I3043937d6688ec6c178a8f10166bb5994048ca1f
2018-07-12 11:01:08 -07:00
Tao Bao cea180895c Merge "applypatch: Switch freecache.cpp to libbase logging."
am: a0b2aad0f8

Change-Id: If1944fc2488864e77025551ed6c9d29d9e33a425
2018-07-12 10:55:19 -07:00
Tao Bao 49750f15ed applypatch: Fix the return type of FreeSpaceForFile().
Prior to this CL, FreeSpaceForFile() was returning `size_t`, which may
overflow on ILP32 when called on a partition with 4GiB+ free space.
Additionally, it was returning static_cast<size_t>(-1) on error, but the
caller in freecache.cpp didn't check for that.

This CL changes its return type to `int64_t`, and moves the function
into freecache.cpp since there's no external caller.

Test: Run recovery_unit_test on marlin.
Test: Code search shows no external user of FreeSpaceForFile().
Change-Id: I00f501a057726e1f1ab69f367c46c77b30f2d774
2018-07-12 10:42:00 -07:00
Tao Bao a0b2aad0f8 Merge "applypatch: Switch freecache.cpp to libbase logging." 2018-07-12 17:33:53 +00:00
Tao Bao bd0fb2309b applypatch: Switch freecache.cpp to libbase logging.
Test: mmma -j bootable/recovery
Test: Run recovery_unit_test on marlin.
Change-Id: Iaa326cd26211d527071cc64a928e59a96271b111
2018-07-11 23:39:27 -07:00
Tao Bao 8997247a5e Merge "Remove the debug code for bspatch flakiness" am: a9f9acca91
am: 04a6af06fb

Change-Id: Ia350bfeca1b8d32a4d30efcae78eaac5ea8c93a1
2018-07-11 15:39:23 -07:00
Tao Bao 04a6af06fb Merge "Remove the debug code for bspatch flakiness"
am: a9f9acca91

Change-Id: Ie87a889077d7ce7ec43b45422617f8f8bab6c367
2018-07-11 15:30:20 -07:00
Tao Bao a9f9acca91 Merge "Remove the debug code for bspatch flakiness" 2018-07-11 22:13:35 +00:00
Tianjie Xu 7326892c7d Remove the debug code for bspatch flakiness
We already know the flakiness happens in bspatch, and the issue is
tracked in b/80193170.

Bug: 67849209
Test: unit tests pass
Change-Id: Ib4772b8f2f0225125096fe7407d083b5bb542cfb
2018-07-11 11:51:43 -07:00
Tao Bao ee1246e2bf Merge "updater: Let read_file() return Value::Type::STRING." am: ac234b4493
am: e089c1a149

Change-Id: I88b14c9abc0e9fdcd357811261156b97fb09890b
2018-07-10 12:41:24 -07:00
Tao Bao e089c1a149 Merge "updater: Let read_file() return Value::Type::STRING."
am: ac234b4493

Change-Id: Ia5cc991c7b1d8800aa211349eeb3f8676a056191
2018-07-10 12:38:22 -07:00
Tao Bao ac234b4493 Merge "updater: Let read_file() return Value::Type::STRING." 2018-07-10 19:25:46 +00:00
Tao Bao bafd6c7afb updater: Let read_file() return Value::Type::STRING.
It used to return a Value blob to be consumed by sha1_check() (which has
been deprecated). Currently there's no other generic updater function
that works with BLOB Values. This CL changes read_file() to return a
string Value to make it more useful (e.g. allowing equality check).

Test: Run recovery_component_test and recovery_unit_test on marlin.
Change-Id: Iba986ba649030112babefe898f26aa9ffe69eeb7
2018-07-10 10:38:47 -07:00
Tao Bao edaf0dad55 Merge "edify: Rename parse_string to ParseString and let it take std::string." am: 6b18eb706e
am: 17cda674f3

Change-Id: Ifc341348415c461cdb76e67900bb097520158551
2018-07-10 09:56:44 -07:00
Tao Bao 676b939680 Merge "edify: Remove VAL_INVALID and move ValueType into Value class." am: 503ff38043
am: d8a2c2682a

Change-Id: I4501ecddfad05ac9ab06c3c6d3bf0fe3c230f7f2
2018-07-10 09:55:31 -07:00
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 9f404742d4 Merge "applypatch: Restrict applypatch_check to eMMC targets." am: e02cbaaa62
am: 254d43a3b9

Change-Id: Ic036ffe5fafa8ed07db6d0ce5cb56a40eb6e7f51
2018-07-09 23:32:38 -07: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 b5c13bc7eb Merge "applypatch: Fix a potential nullptr dereferencing." am: b9b50cd58c
am: 471053ba87

Change-Id: I5a0558926bdfae52bb867e3b6d3321fbc4e3b61b
2018-07-09 22:56:13 -07: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 e9de7c4435 Merge "updater: Remove the support for sha1_check()." am: fbc0f6062c
am: e2136c46cb

Change-Id: Ic5e41781e6c584b9b23ea22c91914e4747751b94
2018-07-09 17:30:45 -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 7c9549471b Merge "updater: Add ABORT command." am: c059b6c1c6
am: b450952d6a

Change-Id: I908878675f1a3d3f70f20c8b0d7ef1e7c3b52c5e
2018-07-09 10:53:56 -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 399cd1f884 Merge "tests: Split unit tests out of component/applypatch_test.cpp." am: cf1f9bdb12
am: cac6932cf4

Change-Id: Ifc97a0a4eec9d5c34823704975600df9cb3b38b3
2018-07-06 14:31:33 -07: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 cb482213b4 Merge "minui/drm: wait for page flip completion" am: d419966730
am: d3e023c265

Change-Id: I8e67ffc5dca20bf238d79cd66fc2a0eac144baf3
2018-07-03 19:10:03 -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 db33eeeacc Merge "No longer print hash for stashed blocks during verification of retry" am: 0a84d7260b
am: 65419746cb

Change-Id: I179a877d89ffff210a87df26a589dd403d77ad4f
2018-07-03 13:41:22 -07: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