recovery uses more shared libraries.

Bug: 110380063
Test: `m -j installclean && mmma -j bootable/recovery` with
      aosp_taimen-userdebug
Test: Build (`m -j bootimage`) and boot into recovery. Check that
      `adb sideload` and `Run graphics test` both work.
Test: Run recovery_unit_test and recovery_component_test on marlin.
Change-Id: Ie6ed0e7cafa352d5faff9d1b6ccef724a0415e65
This commit is contained in:
Tao Bao 2018-08-06 15:52:24 -07:00
parent 08cf9ccb2f
commit 818f938188
5 changed files with 55 additions and 24 deletions

View file

@ -16,6 +16,11 @@ cc_defaults {
name: "recovery_defaults", name: "recovery_defaults",
cflags: [ cflags: [
"-D_FILE_OFFSET_BITS=64",
// Must be the same as RECOVERY_API_VERSION.
"-DRECOVERY_API_VERSION=3",
"-Wall", "-Wall",
"-Werror", "-Werror",
], ],
@ -24,6 +29,7 @@ cc_defaults {
// Generic device that uses ScreenRecoveryUI. // Generic device that uses ScreenRecoveryUI.
cc_library_static { cc_library_static {
name: "librecovery_ui_default", name: "librecovery_ui_default",
recovery_available: true,
defaults: [ defaults: [
"recovery_defaults", "recovery_defaults",
@ -37,6 +43,7 @@ cc_library_static {
// The default wear device that uses WearRecoveryUI. // The default wear device that uses WearRecoveryUI.
cc_library_static { cc_library_static {
name: "librecovery_ui_wear", name: "librecovery_ui_wear",
recovery_available: true,
defaults: [ defaults: [
"recovery_defaults", "recovery_defaults",
@ -50,6 +57,7 @@ cc_library_static {
// The default VR device that uses VrRecoveryUI. // The default VR device that uses VrRecoveryUI.
cc_library_static { cc_library_static {
name: "librecovery_ui_vr", name: "librecovery_ui_vr",
recovery_available: true,
defaults: [ defaults: [
"recovery_defaults", "recovery_defaults",
@ -62,6 +70,7 @@ cc_library_static {
cc_library_static { cc_library_static {
name: "libverifier", name: "libverifier",
recovery_available: true,
defaults: [ defaults: [
"recovery_defaults", "recovery_defaults",
@ -72,10 +81,13 @@ cc_library_static {
"verifier.cpp", "verifier.cpp",
], ],
static_libs: [ shared_libs: [
"libbase", "libbase",
"libcrypto", "libcrypto",
"libcrypto_utils", "libcrypto_utils",
],
static_libs: [
"libotautil", "libotautil",
], ],
} }

View file

@ -125,31 +125,32 @@ health_hal_static_libraries := \
libbatterymonitor libbatterymonitor
librecovery_static_libraries := \ librecovery_static_libraries := \
libbootloader_message \
libfusesideload \ libfusesideload \
libminadbd \ libminadbd \
libminui \ libminui \
libverifier \ libverifier \
libotautil \ libotautil \
$(health_hal_static_libraries) \ $(health_hal_static_libraries) \
libasyncio \
libcrypto_utils \
libcrypto \
libext4_utils \
libfs_mgr \
libpng \
libsparse \
libvintf_recovery \ libvintf_recovery \
libvintf \ libvintf \
libhidl-gen-utils \
libtinyxml2 \ librecovery_shared_libraries := \
libziparchive \ libasyncio \
libbase \ libbase \
libutils \ libbootloader_message \
libcrypto \
libcrypto_utils \
libcutils \ libcutils \
libext4_utils \
libfs_mgr \
libhidl-gen-utils \
liblog \ liblog \
libpng \
libselinux \ libselinux \
libtinyxml2 \
libutils \
libz \ libz \
libziparchive \
# librecovery (static library) # librecovery (static library)
# =============================== # ===============================
@ -173,6 +174,9 @@ LOCAL_MODULE := librecovery
LOCAL_STATIC_LIBRARIES := \ LOCAL_STATIC_LIBRARIES := \
$(librecovery_static_libraries) $(librecovery_static_libraries)
LOCAL_SHARED_LIBRARIES := \
$(librecovery_shared_libraries)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
# recovery (static executable) # recovery (static executable)
@ -200,6 +204,7 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \
librecovery_ui \ librecovery_ui \
$(librecovery_shared_libraries)
LOCAL_HAL_STATIC_LIBRARIES := libhealthd LOCAL_HAL_STATIC_LIBRARIES := libhealthd
@ -219,7 +224,8 @@ endif
# e2fsck is needed for adb remount -R. # e2fsck is needed for adb remount -R.
ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true) ifeq ($(BOARD_EXT4_SHARE_DUP_BLOCKS),true)
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
LOCAL_REQUIRED_MODULES += e2fsck_static LOCAL_REQUIRED_MODULES += \
e2fsck_static
endif endif
endif endif
@ -235,10 +241,23 @@ LOCAL_REQUIRED_MODULES += \
# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery` # TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
# module is built with Soong (with `recovery: true` flag). # module is built with Soong (with `recovery: true` flag).
LOCAL_REQUIRED_MODULES += \ LOCAL_REQUIRED_MODULES += \
libasyncio.recovery \
libbase.recovery \ libbase.recovery \
libbootloader_message.recovery \
libcrypto.recovery \
libcrypto_utils.recovery \
libcutils.recovery \
libext4_utils.recovery \
libfs_mgr.recovery \
libhidl-gen-utils.recovery \
liblog.recovery \ liblog.recovery \
libpng.recovery \ libpng.recovery \
libselinux.recovery \
libsparse.recovery \
libtinyxml2.recovery \
libutils.recovery \
libz.recovery \ libz.recovery \
libziparchive.recovery \
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)

View file

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
cc_library_static { cc_library {
name: "libfusesideload", name: "libfusesideload",
cflags: [ cflags: [

View file

@ -14,6 +14,7 @@
cc_library { cc_library {
name: "libminui", name: "libminui",
recovery_available: true,
defaults: [ defaults: [
"recovery_defaults", "recovery_defaults",

View file

@ -16,6 +16,11 @@ cc_library_static {
name: "libotautil", name: "libotautil",
host_supported: true, host_supported: true,
recovery_available: true,
defaults: [
"recovery_defaults",
],
// Minimal set of files to support host build. // Minimal set of files to support host build.
srcs: [ srcs: [
@ -23,16 +28,10 @@ cc_library_static {
"rangeset.cpp", "rangeset.cpp",
], ],
static_libs: [ shared_libs: [
"libbase", "libbase",
], ],
cflags: [
"-D_FILE_OFFSET_BITS=64",
"-Werror",
"-Wall",
],
export_include_dirs: [ export_include_dirs: [
"include", "include",
], ],
@ -46,9 +45,9 @@ cc_library_static {
"thermalutil.cpp", "thermalutil.cpp",
], ],
static_libs: [ shared_libs: [
"libselinux",
"libcutils", "libcutils",
"libselinux",
], ],
}, },
}, },