Commit Graph

7656 Commits

Author SHA1 Message Date
android-build-team Robot
8f5d76996a Snap for 5674532 from 2b40105c43 to qt-c2f2-release
Change-Id: I438a83fcc9087046c214cb4e24542bb96885589d
2019-06-20 03:11:53 +00:00
Zhijun He
2b40105c43 Revert "libprocessgroup users use libcutils"
am: cdbd84de26

Change-Id: I83e2eb9e4961141389d7c8d90fd70363985b9855
2019-06-18 22:50:40 -07:00
Zhijun He
cdbd84de26 Revert "libprocessgroup users use libcutils"
This reverts commit 46ec20b692.

Reason for revert: breaks all camera use cases

Bug: 135568875
Change-Id: I86747c0df5489f80d1966dd07669637597fb2b00
2019-06-19 04:44:04 +00:00
Steven Moreland
f1532a9655 libprocessgroup users use libcutils
am: 46ec20b692

Change-Id: I39a19e98437e210aa14bee4f03c1c69e8f2faa34
2019-06-18 16:48:47 -07:00
Steven Moreland
46ec20b692 libprocessgroup users use libcutils
libprocessgroup symbols are being moved into libcutils in order to
optimize linking/memory usage. libprocessgroup will no longer be
required in the future (however removing references to it will come
separately).

Since libcutils is used statically here, the dependencies of
libprocessgroup need to be explicitly listed.

Bug: 135145426
Test: boot
Change-Id: I91c082f0fa2f5f5c52751065cd5f50f5cb965b23
2019-06-18 16:25:23 +00:00
android-build-team Robot
5e18c61962 Merge "Snap for 5652689 from e3cc180d31 to qt-c2f2-release" into qt-c2f2-release 2019-06-12 04:12:24 +00:00
android-build-team Robot
27f5a96c1b Merge "Snap for 5652689 from e3cc180d31 to qt-c2f2-release" into qt-c2f2-release 2019-06-12 04:07:27 +00:00
android-build-team Robot
e87768a93f Merge "Snap for 5652689 from e3cc180d31 to qt-c2f2-release" into qt-c2f2-release 2019-06-12 04:06:31 +00:00
android-build-team Robot
3acb74ebc4 Merge "Snap for 5652689 from e3cc180d31 to qt-c2f2-release" into qt-c2f2-release 2019-06-12 04:06:12 +00:00
android-build-team Robot
7c9a059ecb Merge "Snap for 5652689 from e3cc180d31 to qt-c2f2-release" into qt-c2f2-release 2019-06-12 04:02:40 +00:00
android-build-team Robot
383d7fbfd4 Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: I72529a59e52bc599a62bc523701e3a46628182a8
2019-06-12 03:36:32 +00:00
android-build-team Robot
aa532ad2ae Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: I169747f92eede5de61ddaf630b64dc5080ffdfc1
2019-06-12 03:34:04 +00:00
android-build-team Robot
48d38a678e Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: I38326a27161ea1373560ffdbe04ef958b7f2de7e
2019-06-12 03:26:18 +00:00
android-build-team Robot
00a8c46edb Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: I6e79526d97e8f4d548d8e969cc431b1c22df1c60
2019-06-12 03:25:06 +00:00
android-build-team Robot
f235920792 Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: Ibff099e3d6df7791a83ae08be24cee14445b6024
2019-06-12 03:15:02 +00:00
android-build-team Robot
0bb08ac13d Snap for 5652689 from e3cc180d31 to qt-c2f2-release
Change-Id: I4ef136cf474919ebe95fcadc3867272cf0d1fcbc
2019-06-12 03:06:21 +00:00
Tao Bao
e3cc180d31 minadbd: adb rescue getprop returns newline-terminated result.
This change addresses the comment in [1], which makes the results of
`adb shell getprop foo` and `adb rescue getprop foo` more consistent.
That is, both will return newline-terminated results now.

[1] https://r.android.com/c/platform/bootable/recovery/+/976340/3/minadbd/minadbd_services.cpp#188

Fixes: 134027350
Test: Run the following commands on taimen (under rescue mode):
    `adb rescue getprop ro.build.fingerprint`
    `adb rescue getprop ro.nonexistent`
    `adb rescue getprop`
Change-Id: I5af47f8ea4d569b8507e259daef87749c0945f47
Merged-In: I5af47f8ea4d569b8507e259daef87749c0945f47
(cherry picked from commit 57a27890ce)
2019-06-11 12:55:34 -07:00
Tao Bao
5359d777e6 minadbd: Support adb rescue getprop.
It dumps all the allowed properties, similar to `adb shell getprop`.

Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Ic0864ca0fb51505ec1e4f38af2464591aa576201
Merged-In: Ic0864ca0fb51505ec1e4f38af2464591aa576201
(cherry picked from commit d8db81a014)
2019-06-05 23:28:25 -07:00
Tao Bao
7a31ab675e minadbd: More allowed properties.
Most of these properties are already part of the fingerprint. This CL
allows querying them directly, instead of encouraging users to decode
from fingerprints.

Bug: 134027350
Test: Boot into rescue mode on taimen. Run `adb rescue getprop` with new
      props.
Change-Id: Id4667fcaf0e908c391085b22e22c957acd01d9c4
Merged-In: Id4667fcaf0e908c391085b22e22c957acd01d9c4
(cherry picked from commit 3b9ef341be)
2019-06-05 23:28:10 -07:00
android-build-team Robot
3ad8e569de Snap for 5606075 from af0a76d1c5 to qt-c2f2-release
Change-Id: I1fe793c932f605c790bf4633260ef17b3bc20244
2019-05-25 23:18:25 +00:00
Tao Bao
af0a76d1c5 Add misc_writer.
am: 35e0f6d290

Change-Id: I4c9c9db09280a0e492cf832489b48511728413b4
2019-05-23 13:26:11 -07:00
Tao Bao
35e0f6d290 Add misc_writer.
bootloader_message.h currently divides /misc into four segments. The
space between 2K and 16K is reserved for vendor use (e.g. bootloader
persists flags). This CL adds a vendor tool "misc_writer", to allow
writing data to the vendor space in /misc, before getting a dedicated
HAL for accessing /misc partition (b/131775112).

Targets need to explicitly include the module, then invoke the
executable to write data. For example, the following command will write
3-byte data ("0xABCDEF") to offset 4 in vendor space (i.e. 2048 + 4 in
/misc).
$ /vendor/bin/misc_writer --vendor-space-offset 4 --hex-string 0xABCDEF

Bug: 132906936
Test: Run recovery_unit_test on crosshatch.
Test: Call the command via init.hardware.rc on crosshatch. Check that
      the call finishes successfully. Then check the contents written to
      /misc (`dd bs=1 skip=2048 if=/dev/block/sda2 count=32 | xxd`).
Change-Id: I79548fc63fc79b705a0320868690569c3106949f
Merged-In: I79548fc63fc79b705a0320868690569c3106949f
(cherry picked from commit 7ae0169842)
2019-05-20 15:58:53 -07:00
Bill Yi
9681eef5ff Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I4933222253f1bde2daab4726be971c6d7008a0e4
2019-05-04 18:39:11 -07:00
xunchang
5a1916b9be Support wipe command in rescue mode
Bug: 131037235
Test: unit tests pass, run `adb rescue wipe`
Change-Id: I22668f2c98fe2d9195d2561f961c28a7c08e712c
(cherry picked from commit fedeef6f6d)
2019-04-29 15:21:23 -07:00
Tao Bao
75321ade87 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
Bug: 128415917
Test: Boot into rescue mode. Run `adb rescue getprop` and `adb rescue
      install`. Check the UI. Then run `adb reboot rescue`.
Change-Id: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94
Merged-In: I5b7de9dfd898ed8e14bea0d4ad7385a9bae26e94
(cherry picked from commit d9cb014d43)
2019-04-28 12:14:16 -07:00
Tao Bao
7b9b7db877 minadbd: Support adb reboot under sideload/rescue modes.
Bug: 128415917
Test: Run the following commands under sideload and rescue modes
      respectively.
$ adb reboot
$ adb reboot bootloader
$ adb reboot recovery
$ adb reboot rescue
$ adb reboot invalid
Change-Id: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
Merged-In: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
(cherry picked from commit 10f441a9db)
2019-04-26 12:25:02 -07:00
xunchang
23f15fcfaf Add test for minadbd
Ass some unit tests to check if the minadbd service exit correctly in
the failure case. Also start the fuse and verify the socket communication
between minadbd with adb host, and minadbd with recovery.

Bug: 131037235
Test: run unit tests repeatedly, injects some errors and test fails
without dangling process.
Change-Id: I2f073b701b25d7f1aafc59868a7a91a8cbefaf49
Merged-In: I2f073b701b25d7f1aafc59868a7a91a8cbefaf49
(cherry picked from commit 9c04eb46b7)
2019-04-26 12:24:40 -07:00
Tao Bao
e5c6446a10 minadbd: Support rescue install and getprop commands.
Bug: 128415917
Test: Enter rescue mode on taimen. Send the following commands:
      `adb rescue getprop ro.build.fingerprint`
      `adb rescue getprop ro.build.date.utc`
      `adb rescue install /path/to/package.zip`
Test: Sideload on taimen w/ `adb sideload /path/to/package.zip`.
Change-Id: Ibc25daf9fd13f7002e54789f67aaf85d06976bb8
Merged-In: Ibc25daf9fd13f7002e54789f67aaf85d06976bb8
(cherry picked from commit ed717ca17d)
2019-04-26 12:21:55 -07:00
Tao Bao
178cdd4f5c Remove the FD parameter from FuseDataProvider ctor.
This leaves the FD implementation details to subclasses. In particular,
it allows minadbd to do additional works with the FD after sideloading.

Bug: 128415917
Test: atest recovery_component_test
Test: atest minadbd_test
Test: Sideload package on taimen.
Change-Id: I106bbaad05201227bbc5fe28890bbbb06fdcb67e
Merged-In: I106bbaad05201227bbc5fe28890bbbb06fdcb67e
(cherry picked from commit 2be9737cf4)
2019-04-26 12:21:38 -07:00
Tao Bao
378bfbfc5c Allow entering rescue mode via recovery UI.
Only enabled on debuggable builds.

Bug: 128415917
Test: Sideload package on taimen.
Test: Choose "Enter rescue" from recovery UI.
Change-Id: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02
Merged-In: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02
(cherry picked from commit c6dc325e88)
2019-04-26 12:20:03 -07:00
Bill Yi
d0052c30ce Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Ie58e59d8d2731350f58bc9733e4599f75a3aca61
2019-04-16 19:59:20 -07:00
xunchang
cd780b456f DO NOT MERGE: Move load & restore logs to logging.cpp
We perform these steps to perserve the recovery logs when wiping
/cache partition. Move them to logging.cpp to keep the actually
EraseVolume function concise.

Bug: 130166585
Test: unit tests pass, mount cache and check last log after cache
Change-Id: Idc52833817a446f3a0148a3dd2112f911c9ef48d
(cherry picked from commit 2239b9e4dd)
2019-04-16 19:26:44 +00:00
xunchang
388d253b9c DO NOT MERGE: Move wipe cache|data to libinstall
Therefore, libinstall becomes the sole owner to handle the request
from minadbd service.

The change also includes
1. move logging.cpp out of librecovery
2. drop the dependency on common.h
3. now it's more sensible to move the wipe_cache as part of
install_package. move the wipe_cache to the end of the function.

Bug: 130166585
Test: wipe data and cache from menu
Change-Id: I6f356dccdb38015c50acf756bac246f87c30fc1f
(cherry picked from commit 316e971746)
2019-04-16 19:26:31 +00:00
xunchang
95d67323a4 DO NOT MERGE: Add socket communication between recovery and minadbd
This cl adds a socket pair to support the communication between recovery
and minadbd. Therefore, minadbd will be able to issue multiple commands
to recovery and get back the status of each command.

This cl also switches the adb sideload from the recovery menu to use
this protocol; and moves minadbd to a separate binary.

Bug: 130166585
Test: sideload a package
Change-Id: I80d36d5c4e6fe1ae3ea23640907bc50c0dc0d482
(cherry picked from commit 34690ced91)
2019-04-16 19:26:20 +00:00
Tao Bao
2f8afba707 DO NOT MERGE: Build libinstall as a static library.
It was once considered to be shared between recovery and minadbd, so
that the latter can start an install on its own. The plan has been
changed, since package install -- including device wipe operations --
could be device-specific, which should be done by recovery only.

This CL moves libinstall back to a static library, which also saves the
overall size (reducing from 140256 + 660576 to 555880 bytes on
aosp_taimen-userdebug).

Bug: 130166585
Test: Run recovery_component_test.
Test: `adb sideload` on taimen.
Change-Id: Ib1f5f79f235df4682c0bd104425c9c122f6091ba
2019-04-16 19:25:23 +00:00
Bill Rassieur
7df2da5948 Merge master@5428150 into git_qt-dev-plus-aosp.
am: 86de943dcc

Change-Id: I13691eb31834462d14b9a7ea07eebc75dfba7de0
2019-04-03 17:20:26 -07:00
Bill Rassieur
549321c723 Merge master@5406228 into git_qt-dev-plus-aosp.
am: 74253cca39

Change-Id: I8694e28304a111d7bc6675993a8219d4c328d3a6
2019-04-03 16:11:09 -07:00
David Anderson
53cbda8056 Merge "Append -verity when looking for verity device-mapper names." am: bc2eab4315 am: 9a53189ae5
am: 5fa37b77d1

Change-Id: I44383f3609730fc12aeac24061a7940010a60338
2019-04-02 15:09:14 -07:00
David Anderson
5fa37b77d1 Merge "Append -verity when looking for verity device-mapper names." am: bc2eab4315
am: 9a53189ae5

Change-Id: Ibc664119ec22f7dd1906f1afc44015829c6e3d2e
2019-04-02 14:08:44 -07:00
David Anderson
9a53189ae5 Merge "Append -verity when looking for verity device-mapper names."
am: bc2eab4315

Change-Id: I39b5e0f2f0baf8d459a535de470c99f8a5d4adf9
2019-04-02 14:04:49 -07:00
David Anderson
bc2eab4315 Merge "Append -verity when looking for verity device-mapper names." 2019-04-02 20:16:36 +00:00
Bill Rassieur
86de943dcc Merge master@5428150 into git_qt-dev-plus-aosp.
Change-Id: I1c69d7c91e68fd4baba7b6510acf2a69e1a6c5d7
BUG: 129345239
2019-04-02 18:26:46 +00:00
David Anderson
c52663c4ea Append -verity when looking for verity device-mapper names.
Bug: 123666267
Test: recovery_component_test passes
Change-Id: I9b608b3fbfa14cc45ad0b4de6cb5cecdef983acb
2019-04-01 17:13:11 -07:00
Tao Bao
1055819fa8 Merge changes Ibbe7084e,If584fc8a am: bb8f0fff17 am: effd4ca883
am: 64ec642955

Change-Id: I9294ea938a634e9d95cb2639eea150c2fb1ac30c
2019-03-30 08:41:12 -07:00
Tao Bao
64ec642955 Merge changes Ibbe7084e,If584fc8a am: bb8f0fff17
am: effd4ca883

Change-Id: Icb25c9b6be3e08b346f9e44f0c4f3d358f548204
2019-03-30 08:37:12 -07:00
Tao Bao
effd4ca883 Merge changes Ibbe7084e,If584fc8a
am: bb8f0fff17

Change-Id: I1df188d9a668dffc2f81000c30ae1d6fd2f4bb1c
2019-03-30 08:33:15 -07:00
Tao Bao
bb8f0fff17 Merge changes Ibbe7084e,If584fc8a
* changes:
  recovery: Remove SetUsbConfig() out of common.h.
  Remove ui_print().
2019-03-30 15:18:18 +00:00
Tao Bao
e0cfab3de9 recovery: Remove SetUsbConfig() out of common.h.
libinstall now has its own copy.

Test: mmma -j bootable/recovery
Change-Id: Ibbe7084e15baeb7e744f2175d5944477092acc9e
2019-03-29 15:54:02 -07:00
Tao Bao
bc982a4f88 Remove ui_print().
This used to be a helper function that allows printing message to UI.
We no longer have any active user in bootable/recovery. Device-specific
code can achieve the same functionality by calling GetUI()->Print()
instead.

Test: mmma -j bootable/recovery
Change-Id: If584fc8a51d1af466f1d94d8ea5faa262603a784
2019-03-29 15:50:02 -07:00
Tianjie Xu
8e39f3d54e Merge "Move install to separate module" am: a232d9dccb am: 3f25d6bb07
am: 719c7edd2a

Change-Id: I06348c5bafedd3a3b610dea2bcac4e2622aec24c
2019-03-29 15:04:04 -07:00