Commit graph

6932 commits

Author SHA1 Message Date
Treehugger Robot
02a945556e Merge "Check and dump the signal info for killed updater." 2018-11-08 22:57:47 +00:00
Tao Bao
481613b35f Merge "minui: GRSurface manages data with std::unique_ptr." 2018-11-08 17:31:40 +00:00
Tao Bao
e7b775ca2c Check and dump the signal info for killed updater.
WEXITSTATUS only gives meaningful value if WIFEXITED is true. So we may
see a slightly confusing message of "E:Error in /path/to/package (Status
0)" for a killed updater process (e.g. updater calling abort(3)). This
CL dumps the signal number for such a case.

Test: abort() in child process. Check the output.
Change-Id: I72e6654a6499d65155085de658062efb9f1e36ac
2018-11-07 15:25:30 -08:00
Tao Bao
9cf163e673 minui: GRSurface manages data with std::unique_ptr.
Test: Run recovery_unit_test on marlin.
Test: `Run graphics test` on taimen.
Change-Id: I34bd862049900b0030f2840a92a7fa3e02fa2c10
2018-11-07 14:36:45 -08:00
Tao Bao
67b7e64034 Merge changes If24c6b7c,I381b0103
* changes:
  image_generator: Fix the warnings on import order.
  Add tools/ to the style-checking path.
2018-11-06 22:04:50 +00:00
Tao Bao
529bb742b7 image_generator: Fix the warnings on import order.
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:36: Wrong order for java.util.StringTokenizer import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:43: Wrong order for org.apache.commons.cli.CommandLine import. Use Ctrl+Shift+O (Eclipse) or Ctrl+Alt+O (Intellij) to sort imports. https://source.android.com/setup/code-style#order-import-statementsERRORS:
[platform/bootable/recovery] tools/image_generator/ImageGenerator.java:50: Extra separation in import group before 'org.w3c.dom.Document'

Test: `mmma -j bootable/recovery`
Test: `repo upload` no longer gives warnings.
Change-Id: If24c6b7ca33b9223b3e326a48885c24c35b5fa68
2018-11-06 11:34:31 -08:00
Tao Bao
6394a73713 Add tools/ to the style-checking path.
Test: Touch a Java file in tools/. `repo upload` gives warnings.
Change-Id: I381b01038d8a0c0e90817e383ca5323908fdd592
2018-11-06 11:27:13 -08:00
Tao Bao
d1f105a466 Merge "tests: Add a testcase for updater overrun while patching." 2018-11-06 19:16:44 +00:00
Tao Bao
3cb3c524f6 tests: Add a testcase for updater overrun while patching.
For any patching command, the resulting data should always exactly fill
up the given target range.

Test: Run recovery_component_test on marlin.
Change-Id: Ib3cc1fc5c11094e2eab3fe370753db51c7c4135c
2018-11-05 20:47:53 -08:00
Treehugger Robot
06aea3a894 Merge "ui: Manage loaded resources with smart pointers." 2018-11-06 01:37:37 +00:00
Tao Bao
a0404ecd16 Merge "updater: Error out on underrun during patching." 2018-11-05 21:17:25 +00:00
Tao Bao
f720da5317 Merge "tests: Remove obsolete testdata files." 2018-11-05 20:09:03 +00:00
Tao Bao
da409fb8d6 ui: Manage loaded resources with smart pointers.
Test: Run recovery_unit_test on marlin.
Test: `Run graphics test` on marlin.
Change-Id: I8239c3d9fb288f80ee11f615402768ff8ef8ecd0
2018-11-05 10:15:59 -08:00
Tao Bao
81ef508bd8 tests: Remove obsolete testdata files.
testdata/jarsigned.zip and testdata/unsigned.zip became dead since
commit 432918603f ("Refactor existing
tests to use gtest").

testdata/patch.bsdiff became dead when applypatch/applypatch.sh was
deleted (commit c3ef089dfa).

Test: Run recovery_unit_test and recovery_component_test.
Change-Id: Ie1a7f8850878593fcb7d4554759a539271ffb207
2018-11-05 09:10:11 -08:00
Tao Bao
a2cff952cf updater: Error out on underrun during patching.
Test: Run recovery_component_test on marlin.
Change-Id: If23baf42aeacb48500edabc2eadd2e7119a848da
2018-11-05 08:55:11 -08:00
Tianjie Xu
d84922216c Merge "Make the text image readable under recovery" 2018-11-05 06:41:55 +00:00
Treehugger Robot
f2a9152408 Merge "minui: Use android::base::unique_fd in MinuiBackendFbdev." 2018-11-02 22:09:39 +00:00
Tao Bao
f65d48bb5a minui: Use android::base::unique_fd in MinuiBackendFbdev.
Test: mmma -j bootable/recovery
Test: `Run graphics test` on taimen.
Change-Id: I5b25cafbd0107943606a87f0619242cf950174ac
2018-11-02 09:35:08 -07:00
Tao Bao
948790fa4c Merge "minui: Add GRSurface::Clone()." 2018-11-02 02:11:10 +00:00
Tianjie Xu
22dd019aa5 Make the text image readable under recovery
Encode the width, height and locale of the localized image as pixels so
that recovery can locate the correct range of the image from a
concatenated png file.

Also address a few todoes including wrapping the CJK text, making a
catch-all type for all languages.

Test: view the generated image under locale test
Change-Id: Icd3997eb4e992e76ef72526787d64c406f606970
2018-11-01 15:57:31 -07:00
Tao Bao
63b59dcead minui: Add GRSurface::Clone().
Clone() allows duplicating the image that's stored in the GRSurface.

Test: Run recovery_unit_test.
Change-Id: Ia50d507c6200f2de5f17143775de805247a60e1f
2018-11-01 12:14:46 -07:00
Tao Bao
d2e1c0a981 Merge changes I69ce001a,I14514017,I8e67cda7
* changes:
  minui: Remove the default and copy ctors for GRSurface.
  minui: Refactor GRSurfaceAdf.
  minui: Refactor GRSurfaceFbdev.
2018-11-01 18:37:33 +00:00
Tianjie Xu
cbdcfc0038 Merge "Refactor the code to check the metadata" 2018-11-01 17:38:18 +00:00
Tao Bao
4ba20f1031 Merge "tests: Use FRIEND_TEST in ScreenRecoveryUITest." 2018-11-01 17:19:16 +00:00
Tao Bao
929e481e71 tests: Use FRIEND_TEST in ScreenRecoveryUITest.
Test: Run recovery_unit_test on marlin.
Change-Id: I93ec6df8c056b2c485200822f18db0b852595242
2018-10-31 23:09:49 -07:00
Tao Bao
710bc535f4 minui: Remove the default and copy ctors for GRSurface.
As well as all the derived classes. Instances must be created with
Create(). A default copy ctor would mess up the ownership of the
mapped or allocated buffer in these classes, so that has been explicitly
removed.

Test: mmma -j bootable/recovery
Test: Run recovery_unit_test on marlin.
Test: `Run graphics test` on blueline.
Change-Id: I69ce001a9ec9e3ac851edb6ec4d3fa11f4aaea08
2018-10-31 20:28:29 -07:00
Tao Bao
1b18cf56e2 minui: Refactor GRSurfaceAdf.
Test: mmma -j bootable/recovery
Change-Id: I14514017aace4b7043a9db1f5a93ec130a6f89c4
2018-10-31 20:28:29 -07:00
Tao Bao
4a22b28bea minui: Refactor GRSurfaceFbdev.
- Adds Create() that returns a GRSurfaceFbdev instance.
- Moves away from using the copy ctor (precisely assignment operator) of
  GRSurfaceFbdev.
- Moves the GRSurfaceFbdev deallocation code into GRSurfaceFbdev's dtor.
- Manages MinuiBackendFbdev::gr_framebuffer with std::unique_ptr.

Test: mmma -j bootable/recovery
Test: `Run graphics test` on taimen.
Change-Id: I8e67cda7bc3a2feec0790124d035caa36fb58a89
2018-10-31 20:28:29 -07:00
Tao Bao
287d5dc618 Merge "minui: Add a protected GRSurface ctor." 2018-11-01 03:18:41 +00:00
David Anderson
023807fcf7 Merge "recovery: Fix mounting /system with dynamic partitions." 2018-10-31 20:38:46 +00:00
Tao Bao
44820ac1e3 minui: Add a protected GRSurface ctor.
This prepares for the removal of the default and copy ctors, by making
GRSurface::Create() as the only way to get GRSurface instances.

Test: mmma -j bootable/recovery
Test: Run recovery_unit_test on marlin.
Change-Id: I0c34c3f3967e252deb020907c83acbac8a8f36b9
2018-10-31 11:19:28 -07:00
Tianjie Xu
93b5bf261c Refactor the code to check the metadata
The two functions check_wipe_package() and check_newer_ab_build() were
using the same flow; and checked the same device properties against the
metadata file in the package. These properties include: ota_type,
pre-device, and serial number.

Therefore, we can consolidate the checks to a single function; and
continue to check the fingerprint and timestamp only for AB updates.

This change also addresses the need to accept multiple serial number in
the wipe package.

Bug: 118401208
Test: unit tests pass
Change-Id: Ia6bc48fb6effcae059a2ff2cf71764b4136b4c00
2018-10-31 11:03:58 -07:00
David Anderson
2b2f423ef6 recovery: Fix mounting /system with dynamic partitions.
When using dynamic partitions, the blk_device field in fstab_rec must be
translated to a /dev/block/dm-N node with
fs_mgr_update_logical_partition. However, init will not have created
these nodes to begin with since CreateLogicalPartitions is not called in
recovery. This patch addresses both issues.

Note that flashing system through fastbootd will not work while /system is
mounted.

Bug: 118634720
Test: manual test
Change-Id: I06c83309d09eab6b65245b1ed10c51d05398f23e
2018-10-30 13:47:59 -07:00
Tianjie Xu
d84d570d8c Merge "Add description for the new translation" 2018-10-30 03:00:47 +00:00
Tianjie Xu
fd27983b62 Merge "Switch to use commandline parser" 2018-10-29 22:23:31 +00:00
Tianjie Xu
41cb6a65ac Merge "Clean up the zipfile creation in InstallTest" 2018-10-29 21:54:25 +00:00
Tianjie Xu
9f843e7751 Add description for the new translation
As we localize the wipe data menu under the recovery mode, some
additional strings need the new translation. The strings include
1. The menu header that prompts a data wipe
2. Try again description
3. Factory reset description
4. The menu header to confirm a data wipe
5. Cancel description

We will resue the "Factory reset description" in the confirmation menu;
and the image_generator tool will be moved to this directory in later
cls.

Bug: 74397117
Test: mma
Change-Id: I706b8677dba506b62e890f6b200e3eb3b11ce483
2018-10-29 14:43:44 -07:00
Tianjie Xu
f2fb49a3c4 Clean up the zipfile creation in InstallTest
Consolidate them into a static function.

Test: unit tests pass
Change-Id: If05b62215940b221fc499d779eedc5079f68a060
2018-10-29 12:04:13 -07:00
Tianjie Xu
aeec0b2076 Delete the dumpkey host tool
We used to dump the public key files into some text format; and parse
them under recovery. But now we have switched to read the certificates
directly from the zip files; and there's no caller of this dumpkey host
tool any more.

Bug: 116655889
Test: mma
Change-Id: I115592e2a894b3375495c81cb249d1bed1a5d973
2018-10-29 11:14:09 -07:00
Tianjie Xu
edfeb97f9f Switch to use commandline parser
The commandline parser adds some flexibility to the argument parsing. It
also makes the help message more descriptive.

Bug: 74397117
Test: generate a image, checks the help message
Change-Id: Ib238658a9a6fa8806f1b0dde419c8fb970e7cb37
2018-10-29 11:01:36 -07:00
Tianjie Xu
64ceace44f Merge "Remove the load_keys function" 2018-10-25 17:25:49 +00:00
Tianjie Xu
6793f61795 Merge "Add sanity check when loading public keys for OTA package" 2018-10-25 04:03:23 +00:00
Tianjie Xu
cbe93e6506 Remove the load_keys function
This function is used to parse the result of dumpKeys. It's no longer
needed as we are now parsing the public keys from the zipfile.

Bug: 116655889
Test: unit tests pass
Change-Id: I817906e451664058c644f4329ff499bbe4587ebb
2018-10-24 23:26:59 +00:00
Treehugger Robot
c17c819693 Merge "minui: Cleanup GRSurfaceDrm and MinuiBackendDrm." 2018-10-24 23:26:59 +00:00
Tianjie Xu
b5110de1b3 Add sanity check when loading public keys for OTA package
For RSA keys, check if it has a 2048 bits modulus, and its public
exponent is 3 or 65537. For EC keys, check if the field size is 256
bits for its curve.

Bug: 116655889
Test: unit tests pass
Change-Id: I5c00f4d2b61c98c434f0b49db232155d5d0770ec
2018-10-24 16:25:09 -07:00
Bill Yi
0db98fa501 Merge pie-platform-release to aosp-master - DO NOT MERGE
Change-Id: Iabf1575f1a51c31cd567f9a9374cea70f0263952
2018-10-24 14:45:09 -07:00
Tao Bao
d096d7e5a9 minui: Cleanup GRSurfaceDrm and MinuiBackendDrm.
This CL adds a dtor to GRSurfaceDrm that handles the resource
deallocation. It also manages MinuiBackendDrm::GRSurfaceDrms with smart
pointers.

Test: Build and boot into recovery on blueline. `Run graphics test`.
Change-Id: Iff7bbdddbc0b5ab16483d00870794fca9f832bd5
2018-10-24 09:38:34 -07:00
Treehugger Robot
47b650b588 Merge "ui: Add constness to Draw- functions." 2018-10-24 00:28:21 +00:00
Tianjie Xu
ee9c65a38e Merge "Add a function to construct the GRSurface in test" 2018-10-23 19:22:12 +00:00
Tianjie Xu
1e10cc4297 Add a function to construct the GRSurface in test
This fixes the build error as the initializer list no longer work
without the proper constructor for c++ class.

Bug: 74397117
Test: unit tests pass
Change-Id: If3ff508a1a01ad5326413dab8e05bacae8a946c8
2018-10-23 12:10:46 -07:00