Commit Graph

4895 Commits

Author SHA1 Message Date
Tao Bao d544fd8405 tests: Add a test to cover legacy care_map.txt handling. am: 5cee24f4f1
am: ce51dfca9e

Change-Id: I2bce692879c455b37d20413bd0c3adaf87da7eae
2017-07-24 23:13:50 +00:00
Tao Bao ce51dfca9e tests: Add a test to cover legacy care_map.txt handling.
am: 5cee24f4f1

Change-Id: I4d4583936ddfe3d53c2e78d3ceb20125ffcfef6c
2017-07-24 23:11:20 +00:00
Tao Bao fb66a43c98 Merge "update_verifier: Handle legacy care_map.txt gracefully." into oc-mr1-dev am: 71b8103bf1
am: 25a05fc938

Change-Id: I8b39471b35d10a6a597eb3a276ea892803c24a09
2017-07-24 19:56:35 +00:00
Tao Bao 25a05fc938 Merge "update_verifier: Handle legacy care_map.txt gracefully." into oc-mr1-dev
am: 71b8103bf1

Change-Id: I2fd922b746db80fed5b4212c70b04de9d54eb0cc
2017-07-24 19:53:35 +00:00
Tao Bao 5cee24f4f1 tests: Add a test to cover legacy care_map.txt handling.
This is to cover the code added by commit
5a1dee01df, where an O update_verifier
should not reject N care_map.txt.

Bug: 63544345
Test: recovery_component_test passes on marlin.
Change-Id: Ia944e16cba3cc635098b3ffd92842d725b570fec
(cherry picked from commit c319613e06)
2017-07-24 12:51:19 -07:00
TreeHugger Robot 71b8103bf1 Merge "update_verifier: Handle legacy care_map.txt gracefully." into oc-mr1-dev 2017-07-24 19:50:18 +00:00
Tianjie Xu 9c9c579239 Merge "Fix a case when brotli writer fails to write last few blocks of data" into oc-mr1-dev am: 92aef7fa88
am: d9c4ad1086

Change-Id: I425fd42c7ee4e1a2c37e5b8c1ce97df735d4f9ee
2017-07-24 18:39:29 +00:00
Tao Bao 030230ea38 Merge "tests: Add a test to cover legacy care_map.txt handling." am: 6eb23c594c am: dbe9da5331 am: 0148a6f9ab am: 2357b0c745
am: 4574ca1dff

Change-Id: I3ee97953dc4e53354568924fb0b7baf67f119280
2017-07-24 18:37:32 +00:00
Tianjie Xu d9c4ad1086 Merge "Fix a case when brotli writer fails to write last few blocks of data" into oc-mr1-dev
am: 92aef7fa88

Change-Id: Ib9b832f6474c0404167d46ec7cda7c9ef1507efd
2017-07-24 18:37:31 +00:00
Tao Bao 4574ca1dff Merge "tests: Add a test to cover legacy care_map.txt handling." am: 6eb23c594c am: dbe9da5331 am: 0148a6f9ab
am: 2357b0c745

Change-Id: Ic8dfcde80f8dff11c33fac6a911ed278810590aa
2017-07-24 18:34:01 +00:00
Tao Bao 2357b0c745 Merge "tests: Add a test to cover legacy care_map.txt handling." am: 6eb23c594c am: dbe9da5331
am: 0148a6f9ab

Change-Id: Id568b7cb5043c444f88032368be57a6f128a44c7
2017-07-24 18:32:01 +00:00
Tianjie Xu 92aef7fa88 Merge "Fix a case when brotli writer fails to write last few blocks of data" into oc-mr1-dev 2017-07-24 18:31:54 +00:00
Tao Bao 0148a6f9ab Merge "tests: Add a test to cover legacy care_map.txt handling." am: 6eb23c594c
am: dbe9da5331

Change-Id: I87bb6d92a00b97e05b35736e5b9f247101bbac11
2017-07-24 18:29:30 +00:00
Tao Bao dbe9da5331 Merge "tests: Add a test to cover legacy care_map.txt handling."
am: 6eb23c594c

Change-Id: Iaad43cb44f4c406e4c07c9399e70e96cbaa4db7b
2017-07-24 18:27:00 +00:00
Tao Bao 6eb23c594c Merge "tests: Add a test to cover legacy care_map.txt handling." 2017-07-24 18:23:52 +00:00
Tao Bao ad79ed2f72 Merge "update_verifier: Handle legacy care_map.txt gracefully." am: 15ae0f01c3 am: fdb5d1cd8c am: 1d923f5e54 am: c580e491ca
am: 7b1d9ad4a9

Change-Id: Ic3079fbd5da210c514fcdfe0cb2e09c37ad5d889
2017-07-24 16:43:04 +00:00
Tao Bao 7b1d9ad4a9 Merge "update_verifier: Handle legacy care_map.txt gracefully." am: 15ae0f01c3 am: fdb5d1cd8c am: 1d923f5e54
am: c580e491ca

Change-Id: I7c479ca76006f5402c4bfbedb8d4fc570b722754
2017-07-24 16:39:01 +00:00
Tao Bao c319613e06 tests: Add a test to cover legacy care_map.txt handling.
This is to cover the code added by commit
5a1dee01df, where an O update_verifier
should not reject N care_map.txt.

Bug: 63544345
Test: recovery_component_test passes on marlin.
Change-Id: Ia944e16cba3cc635098b3ffd92842d725b570fec
2017-07-24 09:34:06 -07:00
Tao Bao c580e491ca Merge "update_verifier: Handle legacy care_map.txt gracefully." am: 15ae0f01c3 am: fdb5d1cd8c
am: 1d923f5e54

Change-Id: I61ebcbb04c989342f48bd53927fafc5e634fdfa8
2017-07-24 16:33:02 +00:00
Tao Bao 1d923f5e54 Merge "update_verifier: Handle legacy care_map.txt gracefully." am: 15ae0f01c3
am: fdb5d1cd8c

Change-Id: Ia75dbbe4ebf2f4e595f5a50937d831d36c81fe2c
2017-07-24 16:27:32 +00:00
Tao Bao fdb5d1cd8c Merge "update_verifier: Handle legacy care_map.txt gracefully."
am: 15ae0f01c3

Change-Id: I7a175533cd3710d978b20245817a01a73a3f575d
2017-07-24 16:22:32 +00:00
Tao Bao 5fb9f532f0 update_verifier: Handle legacy care_map.txt gracefully.
update_verifier should be backward compatible to not reject legacy
care_map.txt from old releases, which could otherwise fail to boot into
the new release.

For example, we've changed the care_map format between N and O. An O
update_verifier would fail to work with an N care_map.txt - a) we have
switched update_verifier to read from device mapper in O; b) the last
few blocks that contain metadata can't be read via device mapper. This
could be a result of sideloading an O OTA while the device having a
pending N update.

Bug: 63544345
Test: As follows on sailfish:
 1. Flash the device with this CL;
 2. Put a copy of N care_map.txt at /data/ota_package/. Restore the
    permissions properly ('cache' group);
 3. `adb reboot bootloader`;
 4. `fastboot set_active <current_slot>`
 5. Device boots up into home screen, with a warning in logcat that says
    it has skipped legacy care_map.txt.
Change-Id: I6acc88c9e655a9245e6531f176fef7953953935f
(cherry picked from commit 5a1dee01df)
2017-07-24 09:14:15 -07:00
Tao Bao 15ae0f01c3 Merge "update_verifier: Handle legacy care_map.txt gracefully." 2017-07-24 16:13:14 +00:00
Tao Bao 50f5e37d45 Merge "Remove the obsolete reference to /file_contexts." am: 6b09b895be am: 248b4f9dca am: fd63239621 am: 0be4c0e261
am: 98e02adb75

Change-Id: Iad83b4b701c9a382510b936df94a65911939a919
2017-07-23 04:19:05 +00:00
Tao Bao 98e02adb75 Merge "Remove the obsolete reference to /file_contexts." am: 6b09b895be am: 248b4f9dca am: fd63239621
am: 0be4c0e261

Change-Id: I854cd279927c60f7d8a726775788c75ef1b0b6b3
2017-07-23 04:14:34 +00:00
Tao Bao 0be4c0e261 Merge "Remove the obsolete reference to /file_contexts." am: 6b09b895be am: 248b4f9dca
am: fd63239621

Change-Id: Ie1721fb7264b3c7277770f5bb44781880ce32f12
2017-07-23 04:11:05 +00:00
Tao Bao fd63239621 Merge "Remove the obsolete reference to /file_contexts." am: 6b09b895be
am: 248b4f9dca

Change-Id: Idd17e7d036ef7f92c687441e56f1e5c98c6f6b0c
2017-07-23 04:07:34 +00:00
Tao Bao 248b4f9dca Merge "Remove the obsolete reference to /file_contexts."
am: 6b09b895be

Change-Id: I2b26ced9ffeb278ce01ff2ca7be4057b0ab6c61c
2017-07-23 04:03:34 +00:00
Treehugger Robot 6b09b895be Merge "Remove the obsolete reference to /file_contexts." 2017-07-23 03:56:42 +00:00
Tao Bao 338be53ed3 Remove the obsolete reference to /file_contexts.
This file no longer exists:
- /file_contexts has been split into plat_file_contexts and
  nonplat_file_contexts since commit
  b236eb6ca204cefcb926e19bd5682f9dcad4021d (system/sepolicy).
- It was named /file_contexts.bin prior to the split.

'-S file_contexts' is also no longer required by e2fsdroid, since commit
2fff6fb036cbbb6dedd7da3d208b312a9038a5ce (external/e2fsprogs). It will
load the file contexts via libselinux.

Test: Trigger the path by performing a data wipe for converting to FBE.
Change-Id: I179939da409e5c0415ae0ea0bf5ddb23f9e6331e
(cherry picked from commit 7af933b6a6)
2017-07-22 16:16:21 -07:00
Tao Bao b94ba1a5e4 Avoid crashing recovery with unwritable /cache. am: 329fe83509
am: 07a5750f1e

Change-Id: I4d73128ba0a754d333350d1987daf512dae09eba
2017-07-22 21:57:42 +00:00
Tao Bao 07a5750f1e Avoid crashing recovery with unwritable /cache.
am: 329fe83509

Change-Id: I88a3da48716c8a7021466fbdefb07cd5776389a7
2017-07-22 21:54:42 +00:00
Tao Bao 329fe83509 Avoid crashing recovery with unwritable /cache.
When /cache is unwritable, recovery hits a crash loop. Because it
passes nullptr to fileno(3) when writing back the locale file. This
prevents user from recovering a device - it cannot boot far enough to
recovery menu which allows wiping /cache.

Bug: 63927337
Test: Corrupt /cache and boot into recovery on bullhead:
 1. m -j recoveryimage
 2. fastboot erase cache
 3. fastboot boot $OUT/recovery.img
 4. recovery menu shows up.
Change-Id: I1407743f802049eb48add56a36298b665cb86139
(cherry picked from commit ec57903a7e)
2017-07-21 19:12:02 -07:00
Tao Bao 5a1dee01df update_verifier: Handle legacy care_map.txt gracefully.
update_verifier should be backward compatible to not reject legacy
care_map.txt from old releases, which could otherwise fail to boot into
the new release.

For example, we've changed the care_map format between N and O. An O
update_verifier would fail to work with an N care_map.txt - a) we have
switched update_verifier to read from device mapper in O; b) the last
few blocks that contain metadata can't be read via device mapper. This
could be a result of sideloading an O OTA while the device having a
pending N update.

Bug: 63544345
Test: As follows on sailfish:
 1. Flash the device with this CL;
 2. Put a copy of N care_map.txt at /data/ota_package/. Restore the
    permissions properly ('cache' group);
 3. `adb reboot bootloader`;
 4. `fastboot set_active <current_slot>`
 5. Device boots up into home screen, with a warning in logcat that says
    it has skipped legacy care_map.txt.
Change-Id: I6acc88c9e655a9245e6531f176fef7953953935f
2017-07-21 17:17:03 -07:00
Jiyong Park 1ea0ca934a Build libminui with BOARD_VNDK_VERSION am: d774ff247e
am: 8e59e23d14  -s ours

Change-Id: I1a01f19c2421c02be9dceb85925b4e784144548b
2017-07-21 23:57:08 +00:00
Jiyong Park 8e59e23d14 Build libminui with BOARD_VNDK_VERSION
am: d774ff247e

Change-Id: I282db7cb9da4a5612323c7fcb182760534384229
2017-07-21 23:54:28 +00:00
Tao Bao 92844caa81 Merge "Avoid crashing recovery with unwritable /cache." am: 9187f1cc51 am: 4fb2825dc2 am: e62f06246a am: 7d03b8d495
am: 2076da2014

Change-Id: I6b3df2ee56d77b13cd35ba208245d3e8004861c0
2017-07-21 23:39:06 +00:00
Tao Bao 2076da2014 Merge "Avoid crashing recovery with unwritable /cache." am: 9187f1cc51 am: 4fb2825dc2 am: e62f06246a
am: 7d03b8d495

Change-Id: I99fcd7c1af967df6b71430dbcf317355ea19368f
2017-07-21 23:34:09 +00:00
Tao Bao 7d03b8d495 Merge "Avoid crashing recovery with unwritable /cache." am: 9187f1cc51 am: 4fb2825dc2
am: e62f06246a

Change-Id: Ifb7776e0a6946833bd46e00206412082ce053eba
2017-07-21 23:29:45 +00:00
Tao Bao e62f06246a Merge "Avoid crashing recovery with unwritable /cache." am: 9187f1cc51
am: 4fb2825dc2

Change-Id: I7ad113d2e73b9944b999a7c2a53ce1e7c9670c8c
2017-07-21 23:25:21 +00:00
Tao Bao 4fb2825dc2 Merge "Avoid crashing recovery with unwritable /cache."
am: 9187f1cc51

Change-Id: Ie5708c2f703aefbfcad85ad0d2d24ae36b725c78
2017-07-21 23:22:31 +00:00
Treehugger Robot 9187f1cc51 Merge "Avoid crashing recovery with unwritable /cache." 2017-07-21 23:14:08 +00:00
Tianjie Xu 417f504fa6 Merge "Fix a case when brotli writer fails to write last few blocks of data" am: e45c8f0057 am: 80acaab52f am: 75ff0107c8 am: 512283a751
am: 12c6a01e8f

Change-Id: I87f690196f6fde0c79af4837a49bdb7f1d46e443
2017-07-21 22:57:01 +00:00
Jin Qian cd11f924e7 Merge "recovery: replace make_ext4 with e2fsprogs" am: f7c00ddaf6 am: 9203641742 am: 7cdc58497b am: 6fc893ebca
am: ac58c9f87b

Change-Id: If23d3ad9082ffddb75a052c7cca79b0f902756c1
2017-07-21 22:50:06 +00:00
Tianjie Xu 12c6a01e8f Merge "Fix a case when brotli writer fails to write last few blocks of data" am: e45c8f0057 am: 80acaab52f am: 75ff0107c8
am: 512283a751

Change-Id: I035725ce64b45b168100a39d594d95876ee7922b
2017-07-21 22:49:54 +00:00
Jin Qian ac58c9f87b Merge "recovery: replace make_ext4 with e2fsprogs" am: f7c00ddaf6 am: 9203641742 am: 7cdc58497b
am: 6fc893ebca

Change-Id: Id765b0a58fad55f940cc6899d3a8c1d4fbf3995c
2017-07-21 22:47:13 +00:00
Tianjie Xu 512283a751 Merge "Fix a case when brotli writer fails to write last few blocks of data" am: e45c8f0057 am: 80acaab52f
am: 75ff0107c8

Change-Id: Ieab5e6e412704599e873c7497d1c0de42453e642
2017-07-21 22:46:00 +00:00
Jin Qian 6fc893ebca Merge "recovery: replace make_ext4 with e2fsprogs" am: f7c00ddaf6 am: 9203641742
am: 7cdc58497b

Change-Id: Ib2e1ffa2f8620d51c7693130e0d51ed2da9b207f
2017-07-21 22:44:41 +00:00
Tianjie Xu d9759e8a7b Fix a case when brotli writer fails to write last few blocks of data
receive_new_data may exit too early if the zip processor has sent all
the raw data. As a result, the last few 'new' commands will fail even
though the brotli decoder has more output in its buffer.

Restruct the code so that 'NewThreadInfo' owns the decoder state solely;
and receive_brotli_new_data is responsible for the decompression.

Also reduce the test data size to 100 blocks to avoid the test timeout.

Bug: 63802629
Test: recovery_component_test. on bullhead, apply full updates with and
w/o brotli compressed entries, apply an incremental update.

Change-Id: Id429b2c2f31951897961525609fa12c3657216b7
(cherry picked from commit 6ed175d541)
2017-07-21 22:18:34 +00:00
Tianjie Xu 75ff0107c8 Merge "Fix a case when brotli writer fails to write last few blocks of data" am: e45c8f0057
am: 80acaab52f

Change-Id: Id429b2c2f31951897961525609fa12c3657216b7
2017-07-21 21:06:52 +00:00