Commit Graph

7281 Commits

Author SHA1 Message Date
Xin Li 8e7be1faeb [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
am: 343a7dcdd2 -s ours
am skip reason: subject contains skip directive

Change-Id: Iea7679752ae74ce0d026fe3e58d3d3df88b21739
2019-05-09 15:48:46 -07:00
Xin Li 343a7dcdd2 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:46 +00:00
Elliott Hughes 46fa74623a Merge "Track libziparchive API change."
am: 6da27adb0b

Change-Id: Ib261d224fe4b57ead972987466dc30411505aa30
2019-05-09 14:46:26 -07:00
Tianjie Xu e945763a5d Merge "Skip hashtree computation during block image verify"
am: c046a61d97

Change-Id: If5934f92768248c79029c3e7e0934b7a2a37c88d
2019-05-09 14:43:49 -07:00
Elliott Hughes 6da27adb0b Merge "Track libziparchive API change." 2019-05-09 21:32:52 +00:00
Tianjie Xu c046a61d97 Merge "Skip hashtree computation during block image verify" 2019-05-09 20:47:57 +00:00
Tianjie Xu 3fda5d6508 Skip hashtree computation during block image verify
The hashtree computation is designed to execute after we write all the
bytes to the target block device. And executing the command during block
image verify will almost always fail since we are still on the source
build.

Test: run simulator
Change-Id: If8ebb66739969520367a0815f5f8f89f6fae47cf
2019-05-09 10:58:10 -07:00
Tianjie Xu 93667742fe Merge "Add Updater class and remove UpdaterInfo"
am: 19737a5b38

Change-Id: If5ec40a583441f54b6bb012cd9f501f14d4f3b86
2019-05-09 10:51:05 -07:00
Tianjie Xu 19737a5b38 Merge "Add Updater class and remove UpdaterInfo" 2019-05-09 17:33:52 +00:00
Xin Li a5741b06ef DO NOT MERGE - Merge Pie Bonito/Sargo into master.
Bug: 131756210
Change-Id: Ia8a170576e6473ec4dae90d481e17aa216223e97
2019-05-09 09:27:02 -07:00
Tianjie Xu 58d59129e1 Add Updater class and remove UpdaterInfo
The UpdaterInfo class is merely a collection of pointers and POD types.
We can replace it with a Updater class that has the ownership of the
resources. This also makes this class extensible as we plan to add more
functionality in the host simulator.

Bug: 131911365
Test: unit tests pass, run an update on cuttlefish and check last_install
Change-Id: I07ca5963bbee8ae3cb85ccc184464910aa73d4e4
2019-05-08 23:07:04 -07:00
Elliott Hughes 143a03fa03 Track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: I618bbcf38914dd81e042e0cfd1976ff26274dc30
2019-05-08 17:28:22 -07:00
Elliott Hughes 0d24715223 Merge "Track libziparchive API change."
am: 9423d2f6b7

Change-Id: I611e235693bd7b060f472280f94e89e2f52a2ea0
2019-05-06 17:14:06 -07:00
Elliott Hughes 9423d2f6b7 Merge "Track libziparchive API change." 2019-05-06 23:45:16 +00:00
Colin Cross 5a25636f34 Merge "Disable libbootloader_message for darwin"
am: 12262d568a

Change-Id: Ic3016f69893c4f5792f30be1edf341e6d6338297
2019-05-06 14:25:08 -07:00
Treehugger Robot 12262d568a Merge "Disable libbootloader_message for darwin" 2019-05-06 21:09:10 +00:00
Elliott Hughes a86dddbfa5 Track libziparchive API change.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ie5b2b0cff087f2e9e65a4e77c187e3173357f3ad
2019-05-06 10:28:14 -07:00
Colin Cross fb68d38fba Disable libbootloader_message for darwin
libfstab is not built for darwin, don't build libbootloader_message
either.

Bug: 131709594
Test: m PRODUCT-sdk-sdk sdk_repo
Change-Id: I6e3b04f1c3e97d5aa6ac0452bf13e714f8dae437
2019-05-06 09:49:00 -07:00
Elliott Hughes 24566cebf5 Merge "ConsumePrefix is now in libbase."
am: b699b4b1cd

Change-Id: I03b337a921882fa0c06744fb903b8e06c385f9d9
2019-05-03 17:43:25 -07:00
Elliott Hughes b699b4b1cd Merge "ConsumePrefix is now in libbase." 2019-05-04 00:03:14 +00:00
Elliott Hughes 93838f6e42 ConsumePrefix is now in libbase.
Test: treehugger
Change-Id: I2feecabb77986d3e007de1009b123c2d98454631
2019-05-03 10:33:04 -07:00
Yifan Hong d3916e2f1f Merge changes from topic "cuttlefish_misc"
am: be25cd21e4

Change-Id: I9f4cdb1a67c9eae1b1d55d56f40887d686b39644
2019-05-03 09:39:25 -07:00
Treehugger Robot be25cd21e4 Merge changes from topic "cuttlefish_misc"
* changes:
  libbootloader_message: host_supported.
  libbootloader_message: write recovery to any device
2019-05-03 16:09:27 +00:00
Tianjie Xu 15a899363e Merge "Implement FuseBlockDataProvider"
am: bfd6cf59dc

Change-Id: I6dd3d4d9cae5597dbaa3e880f0cbcc2e46e98809
2019-05-02 18:30:42 -07:00
Tianjie Xu bfd6cf59dc Merge "Implement FuseBlockDataProvider" 2019-05-03 00:35:58 +00:00
Yifan Hong d83070ddb9 libbootloader_message: host_supported.
Also, strlcat is not available on host, so use
std::string::operator+= instead.

Test: cuttlefish
Bug: 79094284

Change-Id: I1e69daeb522ca73f43e0c4855cf099a021ed4d47
2019-05-02 15:51:56 -07:00
Yifan Hong c784ce50e8 libbootloader_message: write recovery to any device
Test: cuttlefish
Bug: 79094284

Change-Id: If1a6460a8cbed2e2d22fa9e16e6d7ca84f4592d0
2019-05-02 15:50:15 -07:00
xunchang 311e6ca7b6 Implement FuseBlockDataProvider
Adds a fuse data provider that parses the metadata from a block map,
reads the data from the given ranges of the block device; and provides
the data to the fuse.

Bug: 127071893
Test: unit tests pass, install a package from block map
Change-Id: Ie9925ee9144e98642505b3f5e1a4a186d2b21ed0
2019-05-01 12:09:38 -07:00
Tao Bao 2ea4768d6e Merge changes I2d42f55a,Ic1b5dbf7
am: b5fe2dd00c

Change-Id: I253e8f580cfa41a6a240cb311970a3165fd69fb0
2019-04-30 15:36:27 -07:00
Tao Bao b5fe2dd00c Merge changes I2d42f55a,Ic1b5dbf7
* changes:
  install: Install functions return InstallResult.
  install: Return bool for a few check functions.
2019-04-30 21:49:03 +00:00
Tao Bao adc99efd1c install: Install functions return InstallResult.
Test: `atest recovery_unit_test recovery_component_test`
Test: Sideload a package on taimen.
Change-Id: I2d42f55a89931ee495ea5c5d9e6b5ee1058e8e52
2019-04-30 13:58:03 -07:00
Tao Bao 36c7276cb2 install: Return bool for a few check functions.
The results from these functions have boolean semantics. They're
returning `int` prior to this CL, with some of them mixing 0 and
InstallResult.  Note that SetUpNonAbUpdateCommands() was returning
INSTALL_CORRUPT / INSTALL_ERROR / 0 prior to this change, but all the
callers handle INSTALL_CORRUPT and INSTALL_ERROR the same way.

This CL changes them to return bool instead.

Test: `mmma -j bootable/recovery`
Test: TreeHugger
Test: Sideload on taimen.
Change-Id: Ic1b5dbf79aaca68b53ab8ea2c8ba3d19f988c571
2019-04-30 13:58:03 -07:00
Tao Bao 064ce341ee Merge "tests: Merge recovery_component_test into recovery_unit_test."
am: 865d1df0c9

Change-Id: I39fe185e72acd6eb934db6868df1526fdfc1614c
2019-04-30 12:30:22 -07:00
Tao Bao 865d1df0c9 Merge "tests: Merge recovery_component_test into recovery_unit_test." 2019-04-30 19:09:36 +00:00
Tao Bao 4a01f36d21 tests: Merge recovery_component_test into recovery_unit_test.
Most of the tests in component/ are in fact unit tests. And it doesn't
look practically beneficial to distinguish between the two:
- They have the same test setup;
- We always run both (recovery_unit_test and recovery_component_test)
  at the same time;
- Breaking any of them would be equally bad.

This CL merges the tests in recovery_component_test into
recovery_unit_test to save the effort to maintain both.

Test: Run recovery_unit_test on marlin (via `adb sync data`).
Test: `atest recovery_unit_test`
Change-Id: I93ff32e7219cd83425a4bcfe5613978a8dd48d75
2019-04-30 09:13:36 -07:00
Tao Bao 3486372d69 Merge "Consolidate the codes that handle reboot/shutdown."
am: 189c8f9aeb

Change-Id: I4bf9b921c241b2c062c452ed38a0215600e6ec98
2019-04-29 15:19:32 -07:00
Tao Bao 189c8f9aeb Merge "Consolidate the codes that handle reboot/shutdown." 2019-04-29 21:53:41 +00:00
Tao Bao 782dcc1996 Consolidate the codes that handle reboot/shutdown.
Test: Choose `Reboot system now`, `Power off`, `Reboot to bootloader`
      from recovery UI respectively.
Test: `adb reboot recovery` while under sideload mode.
Change-Id: I0f3d55b80b472178ea4f6970b29cd9df0778b639
2019-04-29 12:12:25 -07:00
Tao Bao a4993ce078 Merge "Add install/wipe_device.cpp."
am: 40ccbe3324

Change-Id: I0a7e05a6ca5d5ea8ea3e7b5bc3a83a61dc218440
2019-04-29 11:54:20 -07:00
Tao Bao 40ccbe3324 Merge "Add install/wipe_device.cpp." 2019-04-29 18:46:53 +00:00
Tianjie Xu 6c9f2acda0 Merge "Support wipe command in rescue mode"
am: 8fc8f39b62

Change-Id: I2c9776d877de6474362c0c67049f9bc5c5647f62
2019-04-29 11:00:29 -07:00
Tianjie Xu 8fc8f39b62 Merge "Support wipe command in rescue mode" 2019-04-29 17:47:20 +00:00
Tao Bao 7f19d100b5 Add install/wipe_device.cpp.
Prior to this CL, GetWipePartitionList was declared in install.h
(libinstall) but defined in recovery.cpp (librecovery). This CL
addresses the issue by refactoring wipe-device related functions into
install/wipe_device.cpp.

Test: atest recovery_component_test
Change-Id: I7ebe04ccfda3d793e085403560a0a202752d9ee3
2019-04-26 23:23:19 -07:00
Tao Bao a11bb6c2c0 Merge "Add recovery_host_test to TEST_MAPPING."
am: 42168c4ab2

Change-Id: I43301da565a7ab5e1509a5e14aa7d297f0855dac
2019-04-26 14:11:51 -07:00
Treehugger Robot 42168c4ab2 Merge "Add recovery_host_test to TEST_MAPPING." 2019-04-26 20:30:48 +00:00
xunchang fedeef6f6d Support wipe command in rescue mode
Bug: 131037235
Test: unit tests pass, run `adb rescue wipe`
Change-Id: I22668f2c98fe2d9195d2561f961c28a7c08e712c
2019-04-26 10:36:48 -07:00
Tao Bao 83186dddb2 Add recovery_host_test to TEST_MAPPING.
Also remove the AndroidTest.xml file, which is no longer needed (the
`data` property in Android.bp takes care of that). The AndroidTest.xml
file would otherwise block `atest recovery_host_test` from running.

Test: TreeHugger; check the test result.
Change-Id: If545878a1f3ae627986e19a94b42162f133b9098
2019-04-26 10:05:55 -07:00
Tao Bao 2f5b6751d8 Merge "Parse BCB command to enter rescue mode."
am: e645ba5aca

Change-Id: I898b6cc59cbb03109e800ddaf6ee3f642a0078f5
2019-04-25 16:35:00 -07:00
Tao Bao e645ba5aca Merge "Parse BCB command to enter rescue mode." 2019-04-25 23:18:08 +00:00
Tao Bao d9cb014d43 Parse BCB command to enter rescue mode.
bootloader will set `boot-rescue` in BCB command field to indicate
booting into rescue mode. This CL adds the matching parsing code.

This CL changes the on-screen UI to display the default image while
waiting for each sideload / rescue command.

It also changes the minadbd reboot handlers to use REBOOT_ instead of
the previous ENTER_ actions. This ensures a reboot going through
bootloader, which may load a newly installed bootloader/recovery.

Bug: 128505466
Test: Boot into rescue mode. Run `adb rescue getprop` and `adb rescue
      install`. Check the UI. Then run `adb reboot rescue`.
Change-Id: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94
2019-04-25 14:02:41 -07:00