Commit graph

6889 commits

Author SHA1 Message Date
Tianjie Xu
2c28ae3933 Merge changes from topic "am-88276146-0d74-467c-8b81-8d471d84ce66" into oc-dev
* changes:
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439 skipped: 4a53559e98
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103 skipped: cce521e439
  [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: f39f139103
  DO NOT MERGE: Initialize the ZipArchive to zero before parsing
2018-10-05 21:57:50 +00:00
Tianjie Xu
81da8b12d2 Merge "Compare the fingerprint before reading the partition" 2018-10-05 21:56:49 +00:00
Tom Cherry
04e4afb9cf Use only signed/unsigned numbers with ParseInt/ParseUint respectively
Test: build
Change-Id: If56b33c9c420237ff441779ba1dbebffd9dae8e3
2018-10-05 14:37:13 -07:00
Tianjie Xu
9eed65e1db Compare the fingerprint before reading the partition
The update_verifier now compares the fingerprint of a partition before
performing the blocks read. If the fingerprint of the current system property
mismatches the one embedded in the care_map, verification of this partition
will be skipped. This is useful for the possible system only updates in the
future.

Bug: 114778109
Test: unit tests pass
Change-Id: Iea309148a05109b5810dfb533d94260d77ab8540
2018-10-04 16:42:57 -07:00
Android Build Merger (Role)
7969be6037 [automerger skipped] DO NOT MERGE: Initialize the ZipArchive to zero before parsing skipped: 2050579b79
Change-Id: Ie86cf384b4c16fdee4e26e23016ed2ebe99f8a64
2018-10-04 21:11:13 +00:00
Tianjie Xu
2050579b79 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-10-04 21:11:11 +00:00
Jayant Chowdhary
6ab02efb27 Merge "Reland: "recovery_test_component: Add libbinderthreadstate as static dependency.""
am: f89067ab97

Change-Id: I893141a2b491fb398ab1e2a6fd966401ab06cfd9
2018-10-02 13:56:35 -07:00
Jayant Chowdhary
f89067ab97 Merge "Reland: "recovery_test_component: Add libbinderthreadstate as static dependency."" 2018-10-02 20:14:37 +00:00
Christopher Ferris
e4f6fa690c Merge "Move to new isolation test runner."
am: d87a79a947

Change-Id: Icdda931c0807d43fde1a6b7fa44a6af5306efeb9
2018-10-01 16:36:50 -07:00
Christopher Ferris
d87a79a947 Merge "Move to new isolation test runner." 2018-10-01 23:07:31 +00:00
Jayant Chowdhary
d24b054fa8 Reland: "recovery_test_component: Add libbinderthreadstate as static
dependency."

This reverts commit 26b86bb1dc.

Reason for revert: Dependencies which broke tests due to exclusion from 
                   LOCAL_JNI_SHARED_LIBS have been added.

Change-Id: I364acfe8bd0526fb26f69cc29fb3545fc3e79764
2018-10-01 22:55:56 +00:00
Christopher Ferris
272467d950 Move to new isolation test runner.
Test: Ran tests.
Change-Id: I5fa99f7b6b03c7b9247b4f340f3df982063b0e3e
2018-10-01 12:19:33 -07:00
Remi NGUYEN VAN
76eaa35201 Merge "Revert "recovery_test_component: Add libbinderthreadstate as static dependency.""
am: 968009cd5b

Change-Id: Ia13095c45e217806326f6a44abf989ab09162f55
2018-09-28 02:59:01 -07:00
Remi NGUYEN VAN
968009cd5b Merge "Revert "recovery_test_component: Add libbinderthreadstate as static dependency."" 2018-09-28 09:42:53 +00:00
Remi NGUYEN VAN
26b86bb1dc Revert "recovery_test_component: Add libbinderthreadstate as static dependency."
This reverts commit a71c10b464.

Reason for revert: This breaks framework tests and blocks presubmit

Change-Id: Iae94878889c1e71e2da5336fe75af88dfd3bfcfa
2018-09-28 07:51:13 +00:00
Jayant Chowdhary
20eb921f47 Merge "recovery_test_component: Add libbinderthreadstate as static dependency."
am: 2dcbebf88f

Change-Id: Ifeff0896746981726a49117f1ad59a55dc064dc9
2018-09-27 14:14:37 -07:00
Jayant Chowdhary
2dcbebf88f Merge "recovery_test_component: Add libbinderthreadstate as static dependency." 2018-09-27 21:02:35 +00:00
Tianjie Xu
881f4225f2 Merge "Enable fingerprint in care_map"
am: f3d0e4783f

Change-Id: I9e15e8eb029b6da6142fd87318452a144f8c0a6a
2018-09-27 10:42:33 -07:00
Jayant Chowdhary
a71c10b464 recovery_test_component: Add libbinderthreadstate as static dependency.
Bug: 110364143

Bug: 114311116

Test: mm -j64

Change-Id: I3b9174443b00ad57be60881736afde7647351bd1
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2018-09-27 10:36:57 -07:00
Tianjie Xu
f3d0e4783f Merge "Enable fingerprint in care_map" 2018-09-27 17:32:33 +00:00
Tao Bao
f4bf630200 Merge "Allow OTA package size larger than 2GiB(2147483647 bytes) on sideload."
am: b32bd8a333

Change-Id: I69e31f6c34da79ca7ae3600b97941717ff3d48b6
2018-09-27 09:55:48 -07:00
Tao Bao
b32bd8a333 Merge "Allow OTA package size larger than 2GiB(2147483647 bytes) on sideload." 2018-09-27 16:34:13 +00:00
katao
77d6173714 Allow OTA package size larger than 2GiB(2147483647 bytes) on sideload.
At present, multiple partitions such as vendor have been added,
which reduces the coupling between mobile phone manufacturers
and Android systems. However, it may increase the generated
package size substantially (e.g. from ~200MB to ~800MB).
Causes the package size to exceed the int limit (2147483647 bytes).
Change the int length parameters to long.

Bug: http://b/112003354
Test: adb sideload ota.zip (ota.zip bigger than 2147483647 bytes)
Change-Id: Ifb656431f7b961ac0e91754107578dc8b89ff14e
Signed-off-by: katao <katao@xiaomi.com>
2018-09-27 16:34:01 +00:00
Tianjie Xu
f595a46735 Enable fingerprint in care_map
Enable the encoding and parsing of the property_id & partition
fingerprint by default; and add a flag "--no_fingerprint" to disable
the fingerprint generation/parsing to convert the legacy care_map.txt

Bug: 114778109
Test: run unittests in add_img_to_target_files
Change-Id: Id4216d5954e78c3a2d8e8bf19342109daf66a528
2018-09-26 20:14:53 -07:00
Hridya Valsaraju
4e30d0d687 Merge "Enter into userspace fastboot only if the device supports it"
am: c2e6f0410c

Change-Id: I503f02ce45b582018672e84e04311ec2bac88c82
2018-09-24 13:07:55 -07:00
Treehugger Robot
c2e6f0410c Merge "Enter into userspace fastboot only if the device supports it" 2018-09-24 19:41:22 +00:00
Tianjie Xu
4c65ab54c1 Merge "Refactor update_verifier into a class"
am: ff29eb7f12

Change-Id: Ibecfa11ad96f9b34c1c9a0096f5096e798a18054
2018-09-20 22:54:57 -07:00
Tianjie Xu
d671cc136f Merge "Move the parse of last_install to recovery-persist"
am: 6c8c7c1975

Change-Id: I4c5dc50ff2a3cfe6c7205aa48e27687166be337c
2018-09-20 22:31:51 -07:00
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
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