Commit graph

235 commits

Author SHA1 Message Date
Tao Bao
ea38c4160a Merge "Build and use minadbd as a shared library." 2018-08-07 17:50:45 +00:00
Tao Bao
4fd4f89591 Build and use minadbd as a shared library.
The former `minadbd` module is now built as a shared library
(`libminadbd_services.so`) that serves sideloading under recovery, with
a dynamic dependency on `libadbd.so`.

This allows sharing and reusing libadbd code on device (both of `adbd`
and `recovery` now uses `libadbd.so`). As a result, it reduces the size
of `recovery` binary from 1407360-byte to (1272880 + 33032)-byte
(aosp_marlin-userdebug).

Bug: 78793464
Test: `m -j bootimage` with aosp_marlin-userdebug
Test: Run minadbd_test on marlin.
Test: Boot into recovery and verify that sideloading still works.
Change-Id: I6c2bc3d351d5af71220a9b9f956c8c039e52c781
2018-08-06 17:06:43 -07:00
Tao Bao
75acf24207 Merge "Dynamically load device-specific recovery UI lib."
am: 9cf9b689d9

Change-Id: I73e3fdc01ff4b51fd18272980ce1360b0bc069f7
2018-08-06 15:32:57 -07:00
Tao Bao
42c45e2b66 Dynamically load device-specific recovery UI lib.
We used to statically link the device-specific recovery UI extension
(`TARGET_RECOVERY_UI_LIB`) into `recovery`. Such a logic can't be easily
migrated to Soong, as modules specified by `TARGET_RECOVERY_UI_LIB` may
not be built with Soong.

Instead of porting all the device-specific codes over, this CL builds
and installs the UI lib as a shared library with Android.mk. `recovery`
dlopen(3)'s and dlsym(3)'s `make_device` to invoke the device-specific
UI lib on start.

Note that in order to make dlopen(3) actually working, we have to switch
`recovery` to be dynamically linked (we will make the move later
anyway).

Bug: 110380063
Test: Build and boot into marlin recovery image. Check that
      device-specific recovery UI is successfully loaded.
Change-Id: Ia9861c7559a95f3f50676534540c0cb87cae4574
2018-08-06 12:35:23 -07:00
Tao Bao
ea105889a5 Merge "minui: Move to Soong."
am: f2bc68cfe1

Change-Id: Iab9a892a3d4d691884e4709c288de1d122d67473
2018-08-06 10:58:16 -07:00
Tao Bao
7ee83f627e minui: Move to Soong.
Note that although libminui says "shared_libs" in Android.bp file,
`recovery` binary will still statically link the libs, until we drop the
`LOCAL_FORCE_STATIC_EXECUTABLE := true` flag from `recovery` module.

Bug: 110380063
Test: `mmma -j bootable/recovery` with aosp_taimen-userdebug
Test: Boot into recovery and `Run graphics test`.
Change-Id: I48785d161dfe52eb01667e938d9c3f0a497b61a2
2018-08-05 14:42:26 -07:00
Tao Bao
17bf8d0518 Merge "ui: Read custom recovery UI values via system property."
am: 2117b4bd07

Change-Id: Ia9e2d805f2e90b9be8426010581a32d0b27fe8e6
2018-08-03 16:02:17 -07:00
Tao Bao
0bc88de7aa ui: Read custom recovery UI values via system property.
The matching change to build system now writes these values as build
properties for recovery image. This allows us dropping the dependency on
Android.mk (as well as having more flexibility to do UI customization).

Also rename a few constant names, as the naming doesn't fully follow the
style guide (which reads "whose value is fixed for the duration of the
program").

Bug: 110380063
Test: Build and flash recovery image on taimen, which uses custom margin
      height. Check the UI and choose `Run graphics test`.
Change-Id: I2c50326123639cb36022f51b62cdeed925d77ba7
2018-07-31 15:14:40 -07:00
Hridya Valsaraju
ed2480be9b Merge "Move recovery from /sbin to /system/bin"
am: 4c80768796

Change-Id: I543608d884f1cfe1fea59e78a4a47c6d6c3be4a1
2018-07-27 13:34:20 -07:00
Hridya Valsaraju
cfb3c92302 Move recovery from /sbin to /system/bin
Executables should be in /system/bin
rather than sbin.

Bug: 78793464
Test: boot into recovery, try adb sideload
Change-Id: I194589119a099d29e56b0648f0906a5ae2aa6770
2018-07-26 17:12:40 -07:00
Hridya Valsaraju
b6b129b258 Revert "Make recovery libraries shared / recovery_available"
This reverts commit c936a69619.

Reason for revert: b/111734137

Change-Id: Ie9c1fdc75d6e87dba7019c4e6d1799af25c2f94a
2018-07-23 17:49:14 +00:00
Jerry Zhang
c936a69619 Make recovery libraries shared / recovery_available
Test: compiles
Bug: 78793464
Change-Id: Iff64bc1a597e70f749a9d825f7d386baa427be3d
Merged-In: Iff64bc1a597e70f749a9d825f7d386baa427be3d
(cherry picked from commit 92969c49dc)
2018-07-20 17:54:03 +00:00
Jiyong Park
681ae40d41 Merge "e2fsdroid and mke2fs are dynamic executable in recovery partition"
am: 9b5d4ea20f

Change-Id: I017a76c320f29baff3183b0156c1fdf2deed66bf
2018-06-20 15:24:29 -07:00
Jiyong Park
69364fe553 e2fsdroid and mke2fs are dynamic executable in recovery partition
The two utilities are now converted to dynamic executables as shared
libraries are supported in recovery mode.

As part of the conversion, their location has moved from /sbin to
/system/bin. Reflect the change in the program 'recovery'

Bug: 79146551
Test: adb reboot recovery, and select 'Wipe data/factory reset'. The
data partition is formatted and there is no selinux denial.

Change-Id: Ie7cfc4c50ab1e6767e4a5170533ccf826ec7d7f3
2018-06-20 14:24:05 +09:00
Tao Bao
a855c33880 Merge "Drop the dependency on AB_OTA_UPDATER flag."
am: 9fb0d89583

Change-Id: Id57bbf9ba9d8e4fe905dc183f0655f1b24db89fd
2018-06-19 13:05:24 -07:00
Tao Bao
cf60a44bd4 Drop the dependency on AB_OTA_UPDATER flag.
This shortens the gap between A/B and non-A/B builds, by replacing the
dependency on build-time flag with runtime detection instead. It also
allows building and testing both paths regardless of the target OTA
type.

The size increase to /sbin/recovery looks negligible (< 0.01%).
 - marlin: increased from 2084928 to 2085024;
 - angler: increased from 2084776 to 2084896.

Test: Run recovery_component_test on angler and marlin.
Test: Sideload an A/B OTA package on marlin.
Test: Sideload a non-A/B OTA package on angler.
Change-Id: I1d927d1ede9713fb42f73b4fe324aa5705ee6f99
2018-06-19 10:50:43 -07:00
David Anderson
5a78f3984f Merge "recovery: add --fsck_unshare_blocks option for adb remount" am: bda4495176
am: b0d9b3594b

Change-Id: I86d3af476e87184e653de38cdb4faa1c9975ccba
2018-05-31 18:11:40 -07:00
David Anderson
edee8361d7 recovery: add --fsck_unshare_blocks option for adb remount
Allow "adb remount" on deduplicated filesystems to reboot into recovery
and run e2fsck to undo deduplication. The e2fsck binary is copied from
the system partition into tmpfs, and the system partition is unmounted
so e2fsck can run safely.

Bug: 64109868
Test: recovery with --fsck_unshare_blocks; adb remount
Change-Id: I7558749b018b58f3c4339e51a95831dbd5be1ae3
2018-05-30 13:24:30 -07:00
Tao Bao
f91fdfb3fc Merge "tools: Move to Soong." am: 6b16093b29
am: 9016deefe4

Change-Id: I1c8b1dd470279e3e5b8ca15c76dfe09691257bd6
2018-05-29 11:09:10 -07:00
Tao Bao
6b16093b29 Merge "tools: Move to Soong." 2018-05-29 17:55:39 +00:00
Tao Bao
e462cdffe9 tools: Move to Soong.
Test: `mmma -j bootable/recovery/`
Test: Build and run RecoveryLocalizer on device.
Change-Id: I3359223c82bd670c94ad51296cb8b357b04f5349
2018-05-17 13:10:08 -07:00
Tao Bao
371fe6e8bc Move stuff from recovery into librecovery.
Move most source files into librecovery so they become testable. Only
recovery_main.cpp and logging.cpp are built into recovery module, as
they perform one-time setup (e.g. setting up logger).

Test: `mmma -j bootable/recovery` with
      aosp_{angler,bullhead,fugu,dragon,marlin}-userdebug
Test: recovery_host_test; recovery_unit_test; recovery_component_test;
      recovery_manual_test
Test: Build and boot into recovery image on angler.
Change-Id: Ic4444f87a2f123557c71085f81dc2b2764c05ed8
Merged-In: Ic4444f87a2f123557c71085f81dc2b2764c05ed8
2018-05-17 09:59:26 -07:00
Tao Bao
fd0ace8f6e Move stuff from recovery into librecovery.
Move most source files into librecovery so they become testable. Only
recovery_main.cpp and logging.cpp are built into recovery module, as
they perform one-time setup (e.g. setting up logger).

Test: `mmma -j bootable/recovery` with
      aosp_{angler,bullhead,fugu,dragon,marlin}-userdebug
Test: recovery_host_test; recovery_unit_test; recovery_component_test;
      recovery_manual_test
Test: Build and boot into recovery image on angler.
Change-Id: Ic4444f87a2f123557c71085f81dc2b2764c05ed8
(cherry picked from commit bf4c006d7bc8a4517c82399bbffd9cb09971c0b4)
2018-05-16 22:31:41 -07:00
Tao Bao
554a876cc1 Merge "Clean up the Makefile for recovery and tests." am: 1f0b9962b0
am: 0c2998ffe3

Change-Id: I5d4765279fa10317e7f8d61cc4f0972baf10040e
2018-05-11 18:06:19 -07:00
Tao Bao
9e30997676 Clean up the Makefile for recovery and tests.
Reorder librecovery and librecovery_ui, so that librecovery stays closer
to recovery (in preparation for later changes that move more files
between the two). For the libraries in LOCAL_STATIC_LIBRARIES, reorder
them based on the dependency - local modules coming first, with external
libraries near the end. Sort the local / external modules, unless a
specific order is needed.

In tests/Android.mk, split the monolithic list of LOCAL_STATIC_LIBRARIES
based on modules. This makes adding / finding libraries easier.

There's no functionality in this CL.

Test: mmma -j bootable/recovery
Change-Id: I6836be574df565001ae9cd3d466a2b6460d90d08
2018-05-11 15:53:58 -07:00
Tao Bao
81726e4430 Merge "Move device.cpp into librecovery_ui." am: db6dc14bff
am: fb8636f48f

Change-Id: I18cad42da6f9f560c3ed1568a20889419520cd21
2018-05-11 14:50:21 -07:00
Tao Bao
db6dc14bff Merge "Move device.cpp into librecovery_ui." 2018-05-11 21:38:01 +00:00
Tao Bao
e0871294aa Merge "tests: Add tests for ScreenRecoveryUI." am: 8c6f699b36
am: ca88c67135

Change-Id: I238b8b412046c883863828d2b7578d51dadef9e0
2018-05-11 13:22:26 -07:00
Tao Bao
8c6f699b36 Merge "tests: Add tests for ScreenRecoveryUI." 2018-05-11 20:06:22 +00:00
Tao Bao
20976a0913 Merge "recovery: Configure device menu based on runtime info." am: e498ef2f03
am: bd32e1b50b

Change-Id: Id611c10a6f84afdec38ca01d6932f4c964f9c2ac
2018-05-11 10:57:40 -07:00
Tao Bao
6a542dcc3b Move device.cpp into librecovery_ui.
librecovery_ui will be exposed for device-specific RecoveryUI. With the
current code structure, 'device.h' and 'ui.h' will always be needed in
order to implement device-specific RecoveryUI.

Bug: 76436783
Test: lunch aosp_{angler,marlin,dragon,walleye}-userdebug;
      `mmma -j bootable/recovery` respectively.
Change-Id: I15e8851b230a65526ac9310e0ee6621b7daea589
2018-05-11 10:51:26 -07:00
Tao Bao
e5d2c25ecf recovery: Configure device menu based on runtime info.
Drop the dependency on build time flag of AB_OTA_UPDATER when compiling
device.cpp. Note that AB_OTA_UPDATER still guards the package install
behavior (install.cpp).

This can be extended to cover the entry of "Apply update from SD card".

Test: Build and boot into recovery on angler and walleye respectively.
      Check the recovery menu.
Change-Id: I36a6a6b4101ba61d4d374e32353c36cc5716f9ce
2018-05-10 20:46:46 -07:00
Tao Bao
6cd816859e tests: Add tests for ScreenRecoveryUI.
In order to support that, this CL adds Paths::set_resource_dir() to
override the default resource dir ("/res/images/") that's only available
under recovery. Note that since there're external modules depending on
libminui, it adds a separate function of res_set_resource_dir(), instead
of requiring the dependency on libotautil for everyone.

Test: mmma -j bootable/recovery
Test: Run recovery_unit_test on marlin.
Change-Id: I0a7dcf4476808bea9e634eaffc9676f6cbaf92b7
2018-05-08 15:53:56 -07:00
Jerry Zhang
152933a28e recovery: Refactor logging code into logging.cpp
Move common logging related functions to
rotate_logs.cpp, and rename that to logging.cpp.

Test: Recovery works
Bug: 78793464
Merged-In: I00f20a79a296680122b8437d54a87897c5cb2fc7
Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
2018-05-07 14:14:17 -07:00
Jerry Zhang
cadf4ed451 recovery: Refactor logging code into logging.cpp
Move common logging related functions to
rotate_logs.cpp, and rename that to logging.cpp.

Test: Recovery works
Bug: 78793464
Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
(cherry picked from commit 3c3f211d1e)
2018-05-07 19:25:03 +00:00
android-build-prod (mdb)
13415d9138 Merge changes I1cc5d702,I32ab9854 am: 420f7f8df4
am: c4ba6b738f

Change-Id: I7696fb68e13e214ee830b9de1bf66dc6f1cac691
2018-05-04 10:43:36 -07:00
Tao Bao
2c52639d01 Move reboot() from common.h into otautil/sysutil.h.
This breaks the dependency on common.h (which belongs to
recovery/librecovery) from librecovery_ui. reboot() is now owned by
libotautil, which is expected to be a leaf node to be depended on.

With the change, recovery and updater also share the same reboot() code
now.

Test: mmma -j bootable/recovery
Change-Id: I1cc5d702cfe49302048db33d31c9c87ddc97ac71
2018-05-03 23:18:38 -07:00
Tao Bao
6d99d4b457 recovery: Split main() into recovery_main.cpp.
This prepares for moving more codes from recovery into librecovery, so
that they will become more easily testable. recovery_main.cpp will be
the source code for recovery module, with the rest moved into
librecovery. recovery_main.cpp mainly does the initializations, such as
setting up the logger.

Test: mmma -j bootable/recovery
Test: recovery_component_test
Test: Build and boot into recovery image on marlin.
Change-Id: I8e846524546b6f3f0e32ed869e851f62261eef23
Merged-In: I8e846524546b6f3f0e32ed869e851f62261eef23
2018-05-01 09:48:00 -07:00
Tao Bao
2ac56afc7b recovery: Split main() into recovery_main.cpp.
This prepares for moving more codes from recovery into librecovery, so
that they will become more easily testable. recovery_main.cpp will be
the source code for recovery module, with the rest moved into
librecovery. recovery_main.cpp mainly does the initializations, such as
setting up the logger.

Test: mmma -j bootable/recovery
Test: recovery_component_test
Test: Build and boot into recovery image on marlin.
Change-Id: I8e846524546b6f3f0e32ed869e851f62261eef23
(cherry picked from commit c241cb662440551eb0d2f42345f7ee08cf60a7dd)
2018-04-30 21:04:55 -07:00
android-build-prod (mdb)
1c1737b660 Merge "Merge libmounts into libotautil." am: 686353215f
am: cddf5dbf67

Change-Id: I57bcd1195084d2e60861aa5b410e2eb50c41c3c3
2018-04-28 09:55:49 -07:00
Tao Bao
9a319f01f8 Merge libmounts into libotautil.
Export its header (mounts.h) from there, and drop the dot dot dependency
from libupdater / updater.

Test: mmma bootable/recovery
Test: recovery_component_test
Change-Id: Ic26a6b9b78a34dbe1f178b138f3abaafffbec44c
2018-04-27 21:13:57 -07:00
android-build-prod (mdb)
cf277abb8f Merge "Rename the dir for SystemUpdaterSample." am: a544bfab2b
am: 4b52553cbb

Change-Id: If4113d931c95cb0e076035a384a9a5193e4a8369
2018-04-25 17:26:33 -07:00
Tao Bao
32118f6690 Rename the dir for SystemUpdaterSample.
Also replace the occurrence in README.md and PREUPLOAD.cfg.

Test: mmma -j bootable/recovery
Change-Id: I04c0ef00dd64f49e008ad2a4a2c1e8eaed76bf8d
2018-04-25 15:34:37 -07:00
Tao Bao
8206907cf0 Merge "update_verifier: Move to Soong." am: ed022fccdf
am: 9bc286dd71

Change-Id: I17da945eaa609f40d9601109c435110599ed88f6
2018-04-23 15:47:30 -07:00
Tao Bao
afb9fc29a2 update_verifier: Move to Soong.
Test: mmma -j bootable/recovery
Change-Id: I3a3574c89318304231c01f7633d32ece31df098c
2018-04-20 14:26:38 -07:00
Chih-Hung Hsieh
4d92ca3f65 Merge "Disable lld where it fails." am: 0c8eea86f9
am: dd2277a9bd

Change-Id: Ic245166068d1c87a1fbcb2fa36a0141914e9cd34
2018-04-16 11:48:42 -07:00
Chih-Hung Hsieh
83847e6ed9 Disable lld where it fails.
Bug: 77543887
Test: make checkbuild and boot
Change-Id: I4134a8eec592dac347c84cc7dc3f9f99f27bc50c
2018-04-16 09:39:07 -07:00
Pirama Arumuga Nainar
9e76ce0ad6 Use the non-LTO, non-PGO version of libhwbinder
am: 2ca4a403e7

Change-Id: Ic2cf355dd9faa2ed1c04f2673a41974df2c9f4a9
2018-04-10 11:29:27 -07:00
Pirama Arumuga Nainar
2ca4a403e7 Use the non-LTO, non-PGO version of libhwbinder
Bug: http://b/77320844

Android.mk doesn't have support for PGO either.  This causes linker
error (about missing __llvm_profile symbols) in the PGO-instrumentation
enabled builds in the release branch.

Test: m ANDROID_PGO_INSTRUMENT=ALL
Change-Id: Ib5dfdea88073bd95da2cd02e92c85bfffcca80d6
2018-04-09 17:43:25 +00:00
Yi Kong
bbb5b84c51 Merge "Use non-LTO variant of libhwbinder" into pi-dev
am: 7fdb6355e4

Change-Id: Ib78dee41815c782e0377d2e1fcb3754010ec8bb2
2018-04-06 13:36:38 -07:00