Commit Graph

2874 Commits

Author SHA1 Message Date
Tao Bao
cb3cbaffac Merge "Revert "Revert "Some cleanups to recovery."""
am: a7a8262944

Change-Id: Iab6de4788c4dbecd33d076144f8324fde53b4024
2016-11-04 16:08:26 +00:00
Tao Bao
a7a8262944 Merge "Revert "Revert "Some cleanups to recovery.""" 2016-11-04 16:04:20 +00:00
Tao Bao
917be35f0f Merge "updater: Fix an off-by-1 bug in file_getprop()."
am: da2b34b5d0

Change-Id: Ib5d4f50a42465648bb6a5213f6676b11427b4278
2016-11-04 04:36:14 +00:00
Tao Bao
da2b34b5d0 Merge "updater: Fix an off-by-1 bug in file_getprop()." 2016-11-04 04:30:24 +00:00
Tao Bao
51d516e913 updater: Fix an off-by-1 bug in file_getprop().
Also add a testcase for file_getprop().

Test: recovery_component_test passes.

Change-Id: I8eb2f9a5702b43997ac9f4b29665eea087b1c146
2016-11-03 14:58:54 -07:00
Tao Bao
ac9d94d19c Revert "Revert "Some cleanups to recovery.""
This reverts commit 8584fcf677.

This CL re-lands commit c0319b60f5.
The "stage" and "reason" variables are now declared as global by
dropping the static qualifier, because they may be used by vendor
recovery libraries.

Test: lunch aosp_angler-userdebug; mmma bootable/recovery
Test: lunch aosp_dragon-userdebug; mmma bootable/recovery

Change-Id: I252c346f450079478cff22bbff01590b8ab2e2b3
2016-11-03 11:57:46 -07:00
Tao Bao
a98b4e4bef Merge "tests: Set up testdata path for continuous native tests."
am: 4011bb161a

Change-Id: I9ca5ab5081cc1f08fe1caa0d0d9baac4f2447efb
2016-11-03 18:21:55 +00:00
Tao Bao
4011bb161a Merge "tests: Set up testdata path for continuous native tests." 2016-11-03 18:15:07 +00:00
Tao Bao
4102b28132 tests: Set up testdata path for continuous native tests.
continuous_native_tests expects the testdata under DATA/ in
continuous_native_tests.zip. This CL packs a copy of the testdata into
continuous_native_tests.zip as DATA/nativetest/recovery/testdata (via
LOCAL_PICKUP_FILES).

This CL also removes the extra copy for nativetest64. Testdata will
always stay at /data/nativetest/recovery/testdata, even for 64-bit
version. Otherwise we will unnecessarily get four copies (two for data/
and another two for DATA/).

Bug: 32123241
Test: mmma bootable/recovery && adb sync data. On bullhead,
    /data/nativetest/recovery_component_test/recovery_component_test works;
    /data/nativetest64/recovery_component_test/recovery_component_test works.
Test: m continuous_native_test; DATA/nativetest/recovery/testdata exists.

Change-Id: Ifefa0309de7af23c77654e8e450848ca2da218c2
2016-11-02 23:18:01 -07:00
Tao Bao
4fc42365ac Merge "applypatch: Add testcases for applypatch executable."
am: 5696526ba4

Change-Id: I923ed0311335a798965cd83f0ba070223a0963b2
2016-11-02 17:22:01 +00:00
Treehugger Robot
5696526ba4 Merge "applypatch: Add testcases for applypatch executable." 2016-11-02 17:19:45 +00:00
Tianjie Xu
88fc75ee54 Merge "Cleanup ReadArgs & ReadValueArgs usage"
am: a9b252887c

Change-Id: I2bf575fbb14165e7904d01b01b71ec6e3f24f068
2016-11-02 00:01:05 +00:00
Tianjie Xu
a9b252887c Merge "Cleanup ReadArgs & ReadValueArgs usage" 2016-11-01 23:53:02 +00:00
Tianjie Xu
5fe280ac96 Cleanup ReadArgs & ReadValueArgs usage
ReadArgs will switch to using std::string and std::unique_ptr. Also
cleanup the callers.

Test: mma & component test passed.
Change-Id: I4724406ae6c0c134a27bbd1cdd24ad5d343b2a3b
2016-11-01 15:03:06 -07:00
Tao Bao
36c3511952 applypatch: Add testcases for applypatch executable.
Refactor applypatch/main.cpp into libapplypatch_modes so that we can add
testcases.

Some changes to applypatch/main.cpp:
 - Replace char** argv with const char**;
 - Use android::base::Split() to split ":";
 - Use android::base::ParseUInt().

Bug: 32383590
Test: Unit tests pass, install-recovery.sh works.

Change-Id: I44e7bfa5ab717d439ea1d0ee9ddb7b2c40bb95a4
2016-11-01 14:40:14 -07:00
Tao Bao
bc48de6bf0 Merge "applypatch: Switch the parameter of Value** to std::vector."
am: 3f4030e0ef

Change-Id: I741638c51e9c3fe57cc874e6af86ea6a65d5aa71
2016-11-01 21:30:20 +00:00
Tao Bao
3f4030e0ef Merge "applypatch: Switch the parameter of Value** to std::vector." 2016-11-01 21:25:12 +00:00
Tao Bao
fada91ccf2 applypatch: Switch the parameter of Value** to std::vector.
Test: Unit tests and install-recovery.sh pass on angler and dragon.

Change-Id: I328e6554edca667cf850f5584ebf1ac211e3d4d1
2016-10-28 16:46:12 -07:00
Dan Albert
0c571e5923 Merge "Revert "Some cleanups to recovery.""
am: 9514eb1934

Change-Id: Id96135ffde5adaebd45811b9c3d319a99fe28ecd
2016-10-27 04:53:48 +00:00
Treehugger Robot
9514eb1934 Merge "Revert "Some cleanups to recovery."" 2016-10-27 04:49:49 +00:00
Dan Albert
8584fcf677 Revert "Some cleanups to recovery."
This reverts commit c0319b60f5.

Reason for revert: Broke builds.

Change-Id: I82aa880b83de5ae6c36fd7567cb001920559a972
2016-10-27 03:08:08 +00:00
Tao Bao
00f893fe23 Merge "Some cleanups to recovery."
am: 46fb0a6a6f

Change-Id: Ic247a408b1bd3e2eab1db34eb4b14423d9fd16d6
2016-10-26 23:32:30 +00:00
Treehugger Robot
46fb0a6a6f Merge "Some cleanups to recovery." 2016-10-26 23:26:04 +00:00
Tao Bao
c0319b60f5 Some cleanups to recovery.
- Remove the duplicate gCurrentUI variable in recovery.cpp;
- Refactor the load/save of locale functions;
- Clean up ui_print() to get rid of 256-byte buffer limit;
- Declare ui in common.h;
- Move the typedef of Volume into roots.h.

Test: Build and boot into recovery image.

Change-Id: Ia28c116858ca754133127a5ff9c722af67ad55b7
2016-10-26 14:36:42 -07:00
Tao Bao
750bb46305 Merge "Skip update-on-boot for bootreason in blacklist"
am: ebc141dff2

Change-Id: Ia87fd539f6e18cea47fb3aeec6434f5b25da0eb0
2016-10-26 16:16:04 +00:00
Tao Bao
ebc141dff2 Merge "Skip update-on-boot for bootreason in blacklist" 2016-10-26 16:08:40 +00:00
Tianjie Xu
06e57acf35 Skip update-on-boot for bootreason in blacklist
Skip the OTA installation when bootreason is 'kernel_panic',
'Panic' etc.

Change-Id: Ic1202492bffefa1a9d8d0e691b5af979285e552c
Test: On angler, ota installation skips for one bootreason in the blacklist.
Bug: 29978689
(cherry picked from commit 27b9fc8a36)
2016-10-25 22:32:19 -07:00
Tao Bao
8f9672c0db Merge "tests: Generate testdata for 2nd arch."
am: 16e88679dc

Change-Id: I9804a4fe55aa9eb1002d279bb2dc286a0409782d
2016-10-25 23:54:07 +00:00
Tao Bao
16e88679dc Merge "tests: Generate testdata for 2nd arch." 2016-10-25 23:48:45 +00:00
Tao Bao
f1338fbf41 tests: Generate testdata for 2nd arch.
We currently only copy the testdata to
$(TARGET_OUT_DATA_NATIVE_TESTS)/recovery, which fails the tests
generated for 2nd arch (TARGET_2ND_ARCH). For example, on angler
/data/nativetest/recovery_component_test/recovery_component_test fails
due to missing testdata.

Bug: 32123241
Test: Both of /data/nativetest/recovery... and /data/nativetest64/recovery...
work on angler.

Change-Id: Ib76264b4408d01c08b2619c8ac84b2476ea5a8bc
2016-10-25 15:12:13 -07:00
Tao Bao
565273839e Merge "applypatch: Fix the bug when constructing VAL_BLOB."
am: e1991428ba

Change-Id: I354b9535077cf4dfbda78c731ac41cba015e8805
2016-10-25 02:48:54 +00:00
Tao Bao
e1991428ba Merge "applypatch: Fix the bug when constructing VAL_BLOB." 2016-10-25 02:44:10 +00:00
Tao Bao
edf1b15fef applypatch: Fix the bug when constructing VAL_BLOB.
When constructing std::string from C-string, the string may be truncated
at null char. Use range constructor instead.

Bug: 32380016
Test: Use applypatch to install a previously failed recovery image.
Change-Id: Id3e2afb4a810594243cd21db526933d1fea5044b
2016-10-24 16:08:28 -07:00
Yabin Cui
a866b12c2d Merge "Verify wipe package when wiping A/B device in recovery."
am: fd796317c3

Change-Id: Iac90d4e641c171e5134ebba5e33556713c7aa4d7
2016-10-19 19:23:07 +00:00
Treehugger Robot
fd796317c3 Merge "Verify wipe package when wiping A/B device in recovery." 2016-10-19 19:15:06 +00:00
Yabin Cui
fd99a318fe Verify wipe package when wiping A/B device in recovery.
To increase the security of wiping A/B devices, let uncrypt write
wipe package in misc partition. Then recovery verifies the wipe
package before wiping the device.

Based on the original cherrypick, this CL also has additional changes to
address the LOG statements and libziparchive changes.

Bug: 29159185
Test: Build and boot into recovery.

Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168
(cherry picked from commit 6faf0265c9)
2016-10-19 11:19:15 -07:00
Tianjie Xu
d7d7f3c792 Merge "Add a unit test for applypatch_check"
am: 06603c76c5

Change-Id: Ieb8dd72e88d01d2067ba35369791d038260a4d49
2016-10-19 03:19:12 +00:00
Treehugger Robot
06603c76c5 Merge "Add a unit test for applypatch_check" 2016-10-19 03:09:25 +00:00
Tianjie Xu
7691800c2e Merge "Clean up bootloader_message usage in recovery"
am: 94f4494613

Change-Id: Idda16fe41dc644ef12fe12706e5d61b8c3a9fa62
2016-10-19 02:55:10 +00:00
Treehugger Robot
94f4494613 Merge "Clean up bootloader_message usage in recovery" 2016-10-19 02:48:02 +00:00
Tianjie Xu
bd56f1590c Clean up bootloader_message usage in recovery
Switch to using vector and string.

Test: bootloader message writes correctly on angler.
Change-Id: I95d5a1e584630db326bb4400f3a149b59ad30a9e
2016-10-19 00:50:56 +00:00
Tianjie Xu
ece0b68ca6 Merge "Fix applypatch_check failure when applying update on angler"
am: 7df1850d37

Change-Id: I5d5509d15df4ec42077b68bac7977b56cfab9097
2016-10-19 00:42:01 +00:00
Tianjie Xu
a5fd5abe80 Add a unit test for applypatch_check
If no sha1 is specified, applypatch_check should pass as long as
the file content loads successfully. Add a unit case acccordingly.

Test: Unit tests passed
Bug: 32243751
Change-Id: I8c013be67c197d2935e11cf6acc59fb9b943cfd9
2016-10-18 17:30:38 -07:00
Tianjie Xu
7df1850d37 Merge "Fix applypatch_check failure when applying update on angler" 2016-10-19 00:29:23 +00:00
Yabin Cui
83e4e6d35c Merge "Fix bootloader_message."
am: 7c95fe10de

Change-Id: I102d5b27dcb295e82b7ec094a641a43efca793dc
2016-10-18 23:36:28 +00:00
Treehugger Robot
7c95fe10de Merge "Fix bootloader_message." 2016-10-18 23:23:09 +00:00
Yabin Cui
0d5b85944c Fix bootloader_message.
Bug: 29945717
Change-Id: I934fd6c52b0111937fa75455de2fa4157fb30f6f
(cherry picked from commit 9da04d595f)
2016-10-18 15:10:59 -07:00
Tao Bao
69c117c2ff resolve merge conflicts of e89bf25 to stage-aosp-master
Change-Id: I3b0ddb23daf264d407370cd8ace31eceb230a11a
2016-10-18 15:08:07 -07:00
Tao Bao
e89bf257a1 Merge "Create bootloader_message static library." 2016-10-18 21:48:23 +00:00
Tianjie Xu
8176cf232e resolve merge conflicts of 6fba98c to stage-aosp-master
Change-Id: I2fa8b85109309ec88c1f8d8def593aa65ab885d7
2016-10-18 21:31:04 +00:00