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
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
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
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
Executables should be in /system/bin
rather than sbin.
Bug: 78793464
Test: boot into recovery, try adb sideload
Change-Id: I194589119a099d29e56b0648f0906a5ae2aa6770
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
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
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
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
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)
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
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
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
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
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
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)
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
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
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)
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
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