Commit graph

6912 commits

Author SHA1 Message Date
Tianjie Xu
ff29eb7f12 Merge "Refactor update_verifier into a class" 2018-09-21 00:03:59 +00:00
Tianjie Xu
446b64b659 Refactor update_verifier into a class
The refactor separates out the parsing of care_map and the actual
verification of the partitions. Moreover, it skips the verification in case
of a format error in the care map.

Also, the parsing of care_map now uses the suffix of the file to
tell if it has the protobuf format or the plain text format.

Bug: 115740187
Test: unit test pass
Change-Id: I7aa32004db02af1deb7bfdc6f5bd7921eb7883e5
2018-09-20 15:10:52 -07:00
Tianjie Xu
6c8c7c1975 Merge "Move the parse of last_install to recovery-persist" 2018-09-20 17:39:36 +00:00
Hridya Valsaraju
7f41a2cc4d Enter into userspace fastboot only if the device supports it
Test: For devices not supporting logical partitions, 'adb reboot
fastboot' command reboots into  Android.
Bug: 78793464

Change-Id: Ie6c6ccdebfee9302a9996ac5bc66069dbd817987
2018-09-19 21:35:47 -07:00
Hridya Valsaraju
1c0e985407 Merge "Show 'Enter Fastboot' menu item only if device supports fastbootd"
am: 9c675b0964

Change-Id: Ia5eae15ea7de7cc822e18ecd3f1fee55132c4f4c
2018-09-18 21:42:34 -07:00
Treehugger Robot
9c675b0964 Merge "Show 'Enter Fastboot' menu item only if device supports fastbootd" 2018-09-19 04:26:31 +00:00
Hridya Valsaraju
daa301e3bd Show 'Enter Fastboot' menu item only if device supports fastbootd
Bug: 112664456
Test: Manual, 'Enter Fastboot' option not visible.
Change-Id: I2642391a69a11cd0496c1287130b3b0291c93232
2018-09-18 14:53:31 -07:00
Tao Bao
cda59a70f2 Merge "Trigger the logging when prompting for wipe."
am: 49dc0fed26

Change-Id: Icdd186331061e68b9c06222b6dafd25e2487dd77
2018-09-17 16:27:58 -07:00
Treehugger Robot
49dc0fed26 Merge "Trigger the logging when prompting for wipe." 2018-09-17 23:18:16 +00:00
Tao Bao
a5bbcb9596 Trigger the logging when prompting for wipe.
This allows recording the reason string that prompts user for a data
wipe, even if user selects 'Try again'.

Test: Inject an error into framework to trigger RescueParty. Select
      'Try again' and check the recovery log post-boot.
Change-Id: I0d7d5afcf38cae5019e2ce0a46d3cd1ac3e83a03
2018-09-17 14:37:27 -07:00
Tao Bao
a89c21c9e5 Start charger at /system/bin/charger.
Bug: 114042635
Test: Boot into recovery mode on walleye. Check that charger keeps
      working.
Change-Id: I818536a6d261c860dd6f6c08774c2355e14f4236
2018-09-14 15:52:29 -07:00
Tianjie Xu
2b1a464a70 Move the parse of last_install to recovery-persist
The recovery-persist used to look for the related recovery logs in
persist storage, and copy them under /data/misc/recovery during the
normal boot process.

As we also want to find out the sideload information from last_install,
it makes more sense to move the parse & report of non-a/b metrics to
recovery-persist. Thus we can avoid the race condition of the file
system between the native code and RecoverySystem.

Bug: 114278989
Test: unit test pass, check the event buffer for metrics report
Change-Id: I32d7b2b831bc74a61a70af9a2f0b8a7e9b3e36ee
2018-09-13 13:27:55 -07:00
Hridya Valsaraju
20b29bbbbd Merge "Allow switch to fastbootd when userdata wipe is required"
am: 16147d1bd6

Change-Id: I475f0f48b4deab9c858fb7e5bd699e94d9a1b89e
2018-09-12 18:00:58 -07:00
Treehugger Robot
16147d1bd6 Merge "Allow switch to fastbootd when userdata wipe is required" 2018-09-13 00:48:42 +00:00
Hridya Valsaraju
eb6f13aeb6 Allow switch to fastbootd when userdata wipe is required
Bug: 114065789
Test: Able to use 'adb reboot fastboot' to switch to fastboot
from recovery when a userdata wipe is required to boot.

Change-Id: Ice6950444656f8d8857808531af030078f544b88
2018-09-12 14:16:07 -07:00
Devin Kim
29472c7566 uncrypt: fix ioctl direction for F2FS_IOC_GET_PIN_FILE
The direction should be set as READ, not WRITE

Change-Id: Id695276f25c1d75bca3a02d87e4a59623e95cb00
2018-09-12 09:55:33 -07:00
Tao Bao
3d95692b5e Merge "minui: Track the name change to minui related properties."
am: da46f9067a

Change-Id: I967f2b14dcfe10dfa7d09492758bfe2e907374e5
2018-09-11 14:47:35 -07:00
Tao Bao
da46f9067a Merge "minui: Track the name change to minui related properties." 2018-09-11 21:33:01 +00:00
Hridya Valsaraju
94e5553f4e Merge "Fix sideload for user devices by adding a new sideload config"
am: 1254e15e50

Change-Id: Ib17a58895763d6440dc0e8f7390e9048345aa10b
2018-09-09 15:38:01 -07:00
Treehugger Robot
1254e15e50 Merge "Fix sideload for user devices by adding a new sideload config" 2018-09-09 22:23:25 +00:00
Android Build Merger (Role)
62497b2c80 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439 skipped: 4a53559e98
Change-Id: I4299e6a86c1006f2545f925da4552be7fda75f32
2018-09-07 23:15:41 +00:00
Android Build Merger (Role)
4a53559e98 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439
Change-Id: I7e60856514769442397e0055e2edae73e9b92cee
2018-09-07 23:15:39 +00:00
Android Build Merger (Role)
cce521e439 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103
Change-Id: Ibe1a269dbc52c6106161ccd757434a131fb5c4a2
2018-09-07 23:15:38 +00:00
Tianjie Xu
f39f139103 DO NOT MERGE: Initialize the ZipArchive to zero before parsing
The fields of the ZipArchive on the stack are not initialized before we
call libminzip to parse the zip file. As a result, some random memory
location is freed unintentionally when we close the ZipArchive upon
parsing failures.

Bug: 35385357
Test: recompile and run the poc with asan.
Change-Id: I7e7f8ab4816c84a158af7389e1a889f8fc65f079
2018-09-07 16:14:57 -07:00
Android Build Merger (Role)
35332d7c62 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce skipped: bc42a6b0eb
Change-Id: I2239a4b3dea1a167ed7cd7ceaeaf42a3caa2189f
2018-09-07 23:13:14 +00:00
Android Build Merger (Role)
bc42a6b0eb [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16 skipped: 98acdb9fce
Change-Id: I3f11a59a38c2604970d2a2a2d5795a15b0f07100
2018-09-07 23:13:13 +00:00
Android Build Merger (Role)
98acdb9fce [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412 skipped: 9216bccd16
Change-Id: Ieb67174f2b98361f82ebc6c76b18bb904d44ea99
2018-09-07 23:13:11 +00:00
Android Build Merger (Role)
9216bccd16 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351 skipped: 244aba4412
Change-Id: I7efba2ee6798c5fb71679bee7861d98f3643f414
2018-09-07 23:13:10 +00:00
Android Build Merger (Role)
244aba4412 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: e830a51351
Change-Id: I7e1da775a32b1f5ef72a2d95b94c0bf494251781
2018-09-07 23:13:09 +00:00
Tianjie Xu
e830a51351 DO NOT MERGE: Initialize the ZipArchive to zero before parsing
The fields of the ZipArchive on the stack are not initialized before we
call libminzip to parse the zip file. As a result, some random memory
location is freed unintentionally when we close the ZipArchive upon
parsing failures.

Bug: 35385357
Test: recompile and run the poc with asan.
Change-Id: I7e7f8ab4816c84a158af7389e1a889f8fc65f079
2018-09-07 16:09:28 -07:00
Hridya Valsaraju
e4ef453914 Fix sideload for user devices by adding a new sideload config
Bug: 113563995
Test: Tested the 'adb sideload' command on marlin user/userdebug builds
and walleye user/userdebug builds

Change-Id: I00d565547b85f2db87012e4a08316609e03395ac
2018-09-07 15:02:43 -07:00
Tao Bao
75dd6f652d Merge "Remove res-560dpi symlink."
am: 02986d381e

Change-Id: I4342fb3dcb5e50be1996b06d1eaf6aa50afc3a00
2018-09-06 12:58:09 -07:00
Tao Bao
02986d381e Merge "Remove res-560dpi symlink." 2018-09-06 19:29:37 +00:00
Tao Bao
52b6ecab37 Remove res-560dpi symlink.
The change to platform/build in [1] added support for mapping numeric
DPIs to a proper density bucket. As a result, 560dpi gets mapped to
xxxhdpi automatically. This CL removes the previous workaround.

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

Bug: 111559919
Test: Build recovery image for marlin. Verify that it picks up xxxhdpi
      recovery resources.
Test: Boot into recovery. Run graphics test.
Change-Id: I65fefc7e2ba90b347e0ad283139429266d77c3b4
2018-09-05 21:55:25 -07:00
Tao Bao
050feb0153 minui: Track the name change to minui related properties.
These properties need to be exposed to both of charger and recovery.
This CL tracks the name change.

Bug: 113567255
Test: Build along with other CLs in the topic (for Makefile and
      sepolicy changes). Boot into charger mode.
Test: Boot into recovery. Run graphics test.
Change-Id: I4d90778c1767c9bd7e00830a34ee2d4875ce0b83
2018-09-05 21:47:19 -07:00
Tao Bao
15e957d3f6 Merge "support mounting f2fs in recovery mode"
am: a062fae9d7

Change-Id: I5f9798c1d901e98240831297aadadf39158cf2fc
2018-09-04 10:19:35 -07:00
Tao Bao
a062fae9d7 Merge "support mounting f2fs in recovery mode" 2018-09-04 16:59:39 +00:00
Lianjun Huang
5d7be6b4a5 support mounting f2fs in recovery mode
Change-Id: Ic03b3e95c4b5cd49b92cb3ec697e327a59421549
Signed-off-by: Lianjun Huang <huanglianjun@vivo.com>
2018-09-03 15:37:00 +00:00
Tao Bao
baa841ed04 Merge "applypatch: {Load,Save}FileContents return bool values."
am: bae5f1a846

Change-Id: I1ee905f0182adb92d25208ba06a847afaf1835ba
2018-09-01 09:19:52 -07:00
Tao Bao
bae5f1a846 Merge "applypatch: {Load,Save}FileContents return bool values." 2018-09-01 16:09:02 +00:00
Tao Bao
37521a9623 Merge "applypatch: Refactor applypatch()."
am: af522672a2

Change-Id: Ia6e953937e1d23f165b51ca759568efb53e9c9db
2018-08-31 14:38:29 -07:00
Tao Bao
09e8493861 applypatch: {Load,Save}FileContents return bool values.
Bug: 110106408
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: Id72e24dd00eb451565d90cff6e049f4f4b844ea2
2018-08-31 14:31:19 -07:00
Tao Bao
af522672a2 Merge "applypatch: Refactor applypatch()." 2018-08-31 21:24:31 +00:00
Tao Bao
5609bc8b34 applypatch: Refactor applypatch().
applypatch() was initially designed for file-based OTA, operating on
individual files. It was later extended to allow patching eMMC targets
as a whole, in favor of block-based updates.

As we have deprecated file-based OTA since Oreo, part of the code in
applypatch() has become obsolete. This CL refactors the related
functions, by removing the obsolete logic and focusing on eMMC targets.

Since this CL substantially changes applypatch APIs, it adds new
functions to avoid unintentionally mixing them together. In particular,
it removes `applypatch()`, `applypatch_check()`, `applypatch_flash()`,
and adds `PatchPartition()`, `PatchPartitionCheck()`, `FlashPartition()`
and `CheckPartition()`. It also replaces the old Edify functions
`apply_patch()` and `apply_patch_check()` with `patch_partition()` and
`patch_partition_check()` respectively.

This CL requires matching changes to OTA generation script (in the same
topic).

Bug: 110106408
Test: Run recovery_unit_test and recovery_component_test on marlin.
Test: `m dist` with non-A/B target. Verify
      /system/bin/install-recovery.sh on device.
Test: `m dist` with non-A/B target using BOARD_USES_FULL_RECOVERY_IMAGE.
      Verify /system/bin/install-recovery.sh on device.
Test: Install an incremental OTA with the new updater and scripts.
Change-Id: Ia34a90114bb227f4216eb478c22dc98c8194cb7f
2018-08-31 09:21:15 -07:00
Tao Bao
287881d558 Merge "Enable c++17 in recovery_defaults."
am: 6a333cde10

Change-Id: Iec615e16f9a3b9b18297c4ee5376d5ee0baa830d
2018-08-28 13:19:27 -07:00
Tao Bao
6a333cde10 Merge "Enable c++17 in recovery_defaults." 2018-08-28 20:07:09 +00:00
Tao Bao
43bfa6e429 Enable c++17 in recovery_defaults.
And add the first few users.

Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: Ifdf093d011478b6a1dd0405b0ba48c145b509cc8
2018-08-28 10:49:07 -07:00
Tianjie Xu
3f288e4389 Merge "Remove otafault"
am: a1e3d67bd7

Change-Id: I9615dbf572f34fb6fa9b3d2b37e40e81b66fdc33
2018-08-27 19:17:15 -07:00
Tianjie Xu
a1e3d67bd7 Merge "Remove otafault" 2018-08-28 02:05:17 +00:00
Tianjie Xu
22f11205a1 Remove otafault
Now it's less beneficial to inject I/O faults since we don't see many of
them. Remove the library that mocks I/O failures. And switch to android::base
I/O when possible.

Bug: 113032079
Test: unit tests pass
Change-Id: I9f2a92b7ba80f4da6ff9e2abc27f2680138f942c
2018-08-27 17:16:19 -07:00