Jerry Zhang and android-build-merger
84dc7c8d68
[automerger skipped] Make recovery libraries shared / recovery_available am: c936a69619 am: 3e8262d633
...
am: c11cd3ccb8 -s ours
Change-Id: I97b51ee4a8962814c52f65d0c6bd16947193f191
2018-07-20 13:24:37 -07:00
Jerry Zhang and android-build-merger
c11cd3ccb8
Make recovery libraries shared / recovery_available am: c936a69619
...
am: 3e8262d633
Change-Id: Ieed70605eaec3b703de9ae1112091cd559cf9103
2018-07-20 13:19:48 -07:00
Jerry Zhang and android-build-merger
3e8262d633
Make recovery libraries shared / recovery_available
...
am: c936a69619
Change-Id: Ida8931378dab85f77b43cddee74c3faffa1e6f02
2018-07-20 13:14:52 -07:00
Jerry Zhang and Hridya Valsaraju
c936a69619
Make recovery libraries shared / recovery_available
...
Test: compiles
Bug: 78793464
Change-Id: Iff64bc1a597e70f749a9d825f7d386baa427be3d
Merged-In: Iff64bc1a597e70f749a9d825f7d386baa427be3d
(cherry picked from commit 92969c49dc )
2018-07-20 17:54:03 +00:00
Jerry Zhang and Hridya Valsaraju
92969c49dc
Make recovery libraries shared / recovery_available
...
Test: compiles
Bug: 78793464
Change-Id: Iff64bc1a597e70f749a9d825f7d386baa427be3d
2018-07-19 22:40:23 -07:00
Tao Bao and android-build-merger
6e46cff9b2
Merge "Fix the arguments passed to getopt_long(3)." am: 29932e7bcc am: 2f9d61ad25
...
am: af80f51151
Change-Id: I77c4ab2fe08a293edf94004747e8b82f21d383ac
2018-07-17 15:14:50 -07:00
Tao Bao and android-build-merger
af80f51151
Merge "Fix the arguments passed to getopt_long(3)." am: 29932e7bcc
...
am: 2f9d61ad25
Change-Id: I679130a021dd11f3ec5a5ff450b1fa06d2527e66
2018-07-17 15:05:29 -07:00
Tao Bao and android-build-merger
2f9d61ad25
Merge "Fix the arguments passed to getopt_long(3)."
...
am: 29932e7bcc
Change-Id: I985c5598ad9d9e4222849aff6177fa7e4f0e8820
2018-07-17 14:57:38 -07:00
Tao Bao and Gerrit Code Review
29932e7bcc
Merge "Fix the arguments passed to getopt_long(3)."
2018-07-17 21:09:03 +00:00
Tao Bao
1700cc46b5
Fix the arguments passed to getopt_long(3).
...
The getopt_long(3) implementation in Android (upstream freebsd) expects
a null-terminated array while parsing long options with required args.
if (long_options[match].has_arg == required_argument) {
optarg = nargv[optind++];
}
...
if (long_options[match].has_arg == required_argument && optarg == NULL) {
return (BADARG);
}
This seems to make sense in practice, as getopt(3) takes the first two
arguments of argc and argv that are "as passed to the main() function on
program invocation", and both of C and C++ spec say "the value of
argv[argc] shall be 0".
Prior to the CL, we may run into undefined behavior on malformed input
command line (e.g. missing arg for an option that requires one). This CL
fixes the issue by always appending a nullptr to the argument list (but
without counting that into argc).
Test: Build and boot into recovery with commands.
Change-Id: Ic6c37548f4db2f30aeabd40f387ca916eeca5392
2018-07-17 12:16:53 -07:00
Tao Bao and android-build-merger
399efe5806
Merge "applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache()." am: 624b6b6cd5 am: 603b7ed470
...
am: efe9100fb1
Change-Id: I9db9b5bcd72078909fd775b11ddd93352855bbe7
2018-07-13 13:05:21 -07:00
Tao Bao and android-build-merger
efe9100fb1
Merge "applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache()." am: 624b6b6cd5
...
am: 603b7ed470
Change-Id: I437b19505ba82d5c4cc3cc9849bd2514ad6d846d
2018-07-13 12:52:54 -07:00
Tao Bao and android-build-merger
603b7ed470
Merge "applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache()."
...
am: 624b6b6cd5
Change-Id: I16278b00abcdcc532928b534462ff0762c64c1a2
2018-07-13 12:48:45 -07:00
Tao Bao and Gerrit Code Review
624b6b6cd5
Merge "applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache()."
2018-07-13 19:29:27 +00:00
Tao Bao and android-build-merger
c63af4f9b2
Merge "tests: Clean up the temporary dirs post-run." am: b46e565fd8 am: d8e96f4b4d
...
am: 0d8323c4c8
Change-Id: I7ff12d00a9fe10a0aa1edd985e758e69010178fc
2018-07-13 10:57:05 -07:00
Tao Bao and android-build-merger
0d8323c4c8
Merge "tests: Clean up the temporary dirs post-run." am: b46e565fd8
...
am: d8e96f4b4d
Change-Id: I2ea09f37b88a9eb9740b0185c54f841b6fd0e8fe
2018-07-13 10:39:54 -07:00
Tao Bao and android-build-merger
d8e96f4b4d
Merge "tests: Clean up the temporary dirs post-run."
...
am: b46e565fd8
Change-Id: I949ea123cd789f68411de97a9b73581dc916b409
2018-07-13 10:16:43 -07:00
Tao Bao
5ee25666cc
applypatch: Consolidate CacheSizeCheck() and MakeFreeSpaceOnCache().
...
They are doing exactly the same thing, except for the slightly different
error return value (1 vs -1).
int CacheSizeCheck(size_t bytes);
int MakeFreeSpaceOnCache(size_t bytes_needed);
This CL consolidates the two functions and uses bool as its return type.
// Checks whether /cache partition has at least 'bytes'-byte free space. Returns true immediately
// if so. Otherwise, it will try to free some space by removing older logs, checks again and
// returns the checking result.
bool CheckAndFreeSpaceOnCache(size_t bytes);
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: I94a96934d2b18713f8f39ad5aa96a02c98d87963
2018-07-13 09:42:19 -07:00
Tao Bao and Gerrit Code Review
b46e565fd8
Merge "tests: Clean up the temporary dirs post-run."
2018-07-13 16:40:39 +00:00
Tao Bao and android-build-merger
97612458a1
Merge "applypatch: Fix the return type of FreeSpaceForFile()." am: 90c9e4f55c am: c9f676bc64
...
am: 22c5aed89e
Change-Id: Ibdf05b7f50a5a04b5a6994fded638d0d39414a5d
2018-07-12 21:07:18 -07:00
Tao Bao and android-build-merger
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 and android-build-merger
c9f676bc64
Merge "applypatch: Fix the return type of FreeSpaceForFile()."
...
am: 90c9e4f55c
Change-Id: Ia14468f77220b5e98a0d228b097bbf61401fbe30
2018-07-12 16:52:53 -07:00
Tao Bao and Gerrit Code Review
90c9e4f55c
Merge "applypatch: Fix the return type of FreeSpaceForFile()."
2018-07-12 23:07:31 +00:00
Tao Bao
b1c5b62557
tests: Clean up the temporary dirs post-run.
...
TemporaryDir only deletes empty dirs (not done by its dtor because it
tries to keep the temporary files available on error exit).
Also change FreeCacheTest::MockFreeSpaceChecker to be static.
Test: Run recovery_unit_test on marlin. Check /data/local/tmp post-run.
Change-Id: I1bd54eb840e3094b4f22ee84c059eec2998773bf
2018-07-12 12:54:15 -07:00
Tao Bao and android-build-merger
45adeb07d0
Merge "applypatch: Switch freecache.cpp to libbase logging." am: a0b2aad0f8 am: cea180895c
...
am: 50b99abc6d
Change-Id: Icf9bd29b2f2473b5eaa5c4b4bd7008746ad3f91d
2018-07-12 11:10:19 -07:00
Tao Bao and android-build-merger
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 and android-build-merger
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 and Gerrit Code Review
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 and android-build-merger
ad7beb410d
Merge "Remove the debug code for bspatch flakiness" am: a9f9acca91 am: 04a6af06fb
...
am: 8997247a5e
Change-Id: I9ad7a6a204dc7b416369bdb08a06370164e3aae8
2018-07-11 16:39:49 -07:00
Tao Bao and android-build-merger
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 and android-build-merger
04a6af06fb
Merge "Remove the debug code for bspatch flakiness"
...
am: a9f9acca91
Change-Id: Ie87a889077d7ce7ec43b45422617f8f8bab6c367
2018-07-11 15:30:20 -07:00
Tao Bao and Gerrit Code Review
a9f9acca91
Merge "Remove the debug code for bspatch flakiness"
2018-07-11 22:13:35 +00:00
Tianjie Xu and Tao Bao
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 and android-build-merger
76b289022d
Merge "updater: Let read_file() return Value::Type::STRING." am: ac234b4493 am: e089c1a149
...
am: ee1246e2bf
Change-Id: Ibbb6f028fedefcc95e2f8f633baf5825a23b69d5
2018-07-10 12:45:26 -07:00
Tao Bao and android-build-merger
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 and android-build-merger
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 and Gerrit Code Review
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 and android-build-merger
0a2916b96a
Merge "edify: Rename parse_string to ParseString and let it take std::string." am: 6b18eb706e am: 17cda674f3
...
am: edaf0dad55
Change-Id: If78f707596f24de6f6de622ebd1d7434e19b5822
2018-07-10 10:12:09 -07:00
Tao Bao and android-build-merger
6f60263d5e
Merge "edify: Remove VAL_INVALID and move ValueType into Value class." am: 503ff38043 am: d8a2c2682a
...
am: 676b939680
Change-Id: I66ba4eb1ec3d634e378aaad081f4d690a625e356
2018-07-10 10:05:39 -07:00
Tao Bao and android-build-merger
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 and android-build-merger
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 and android-build-merger
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 and android-build-merger
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 and Gerrit Code Review
6b18eb706e
Merge "edify: Rename parse_string to ParseString and let it take std::string."
2018-07-10 16:38:08 +00:00
Tao Bao and Gerrit Code Review
503ff38043
Merge "edify: Remove VAL_INVALID and move ValueType into Value class."
2018-07-10 16:34:56 +00:00
Tao Bao and android-build-merger
ca16ae1b04
Merge "applypatch: Restrict applypatch_check to eMMC targets." am: e02cbaaa62 am: 254d43a3b9
...
am: 9f404742d4
Change-Id: I6cbc6cdcb66ddb5f6d0558119e751b63701e52d3
2018-07-09 23:35:39 -07:00
Tao Bao and android-build-merger
9f404742d4
Merge "applypatch: Restrict applypatch_check to eMMC targets." am: e02cbaaa62
...
am: 254d43a3b9
Change-Id: Ic036ffe5fafa8ed07db6d0ce5cb56a40eb6e7f51
2018-07-09 23:32:38 -07:00