summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-08-14 05:11:36 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-08-14 05:11:36 +0200
commit1b91bf6f4ff42553253ed8658517070707153645 (patch)
treeb6c795f960aa2d52ff5bf32ab9c946149a41a438
parentSnap for 4949134 from eee4b3a61b42f4b5c89c3b672971b2e16f24dd9c to qt-release (diff)
parentMerge "Reland "Build and use minadbd as a shared library."" am: 337bd80b78 am: 7785eec4f2 (diff)
downloadandroid_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar.gz
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar.bz2
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar.lz
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar.xz
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.tar.zst
android_bootable_recovery-1b91bf6f4ff42553253ed8658517070707153645.zip
-rw-r--r--Android.bp130
-rw-r--r--Android.mk194
-rw-r--r--fuse_sideload/Android.bp3
-rw-r--r--minadbd/Android.bp19
-rw-r--r--tests/Android.mk4
-rw-r--r--tests/component/resources_test.cpp9
l---------tests/res-testdata/res-hdpi1
l---------tests/res-testdata/res-mdpi1
l---------tests/res-testdata/res-xhdpi1
l---------tests/res-testdata/res-xxhdpi1
l---------tests/res-testdata/res-xxxhdpi1
-rw-r--r--updater_sample/Android.bp8
12 files changed, 162 insertions, 210 deletions
diff --git a/Android.bp b/Android.bp
index 97126f5b1..630c7965e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,6 +26,34 @@ cc_defaults {
],
}
+cc_library {
+ name: "librecovery_ui",
+ recovery_available: true,
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ srcs: [
+ "device.cpp",
+ "screen_ui.cpp",
+ "ui.cpp",
+ "vr_ui.cpp",
+ "wear_ui.cpp"
+ ],
+
+ static_libs: [
+ "libminui",
+ "libotautil",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libpng",
+ "libz",
+ ],
+}
+
// Generic device that uses ScreenRecoveryUI.
cc_library_static {
name: "librecovery_ui_default",
@@ -68,6 +96,76 @@ cc_library_static {
],
}
+cc_defaults {
+ name: "librecovery_defaults",
+
+ defaults: [
+ "recovery_defaults",
+ ],
+
+ shared_libs: [
+ "libbase",
+ "libbootloader_message",
+ "libcrypto",
+ "libcrypto_utils",
+ "libcutils",
+ "libext4_utils",
+ "libfs_mgr",
+ "libfusesideload",
+ "libhidl-gen-utils",
+ "liblog",
+ "libpng",
+ "libselinux",
+ "libsparse",
+ "libtinyxml2",
+ "libutils",
+ "libz",
+ "libziparchive",
+ ],
+
+ static_libs: [
+ "libminui",
+ "libverifier",
+ "libotautil",
+ "libvintf_recovery",
+ "libvintf",
+
+ // TODO(b/80132328): Remove the dependency on static health HAL.
+ "libhealthd.default",
+ "android.hardware.health@2.0-impl",
+ "android.hardware.health@2.0",
+ "android.hardware.health@1.0",
+ "android.hardware.health@1.0-convert",
+ "libhealthstoragedefault",
+ "libhidltransport",
+ "libhidlbase",
+ "libhwbinder_noltopgo",
+ "libbatterymonitor",
+ ],
+}
+
+cc_library_static {
+ name: "librecovery",
+ recovery_available: true,
+
+ defaults: [
+ "librecovery_defaults",
+ ],
+
+ srcs: [
+ "adb_install.cpp",
+ "fsck_unshare_blocks.cpp",
+ "fuse_sdcard_provider.cpp",
+ "install.cpp",
+ "recovery.cpp",
+ "roots.cpp",
+ ],
+
+ include_dirs: [
+ "system/vold",
+ ],
+}
+
cc_library_static {
name: "libverifier",
recovery_available: true,
@@ -92,6 +190,38 @@ cc_library_static {
],
}
+cc_binary {
+ name: "recovery",
+ recovery: true,
+
+ defaults: [
+ "librecovery_defaults",
+ ],
+
+ srcs: [
+ "logging.cpp",
+ "recovery_main.cpp",
+ ],
+
+ shared_libs: [
+ "libminadbd_services",
+ "librecovery_ui",
+ ],
+
+ static_libs: [
+ "librecovery",
+ "librecovery_ui_default",
+ ],
+
+ required: [
+ "e2fsdroid.recovery",
+ "librecovery_ui_ext",
+ "mke2fs.conf",
+ "mke2fs.recovery",
+ "recovery_deps",
+ ],
+}
+
// The dynamic executable that runs after /data mounts.
cc_binary {
name: "recovery-persist",
diff --git a/Android.mk b/Android.mk
index 447041617..9888f8616 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,11 +23,6 @@ RECOVERY_FSTAB_VERSION := 2
# librecovery_ui_default, which uses ScreenRecoveryUI.
TARGET_RECOVERY_UI_LIB ?= librecovery_ui_default
-recovery_common_cflags := \
- -Wall \
- -Werror \
- -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
-
# librecovery_ui_ext (shared library)
# ===================================
include $(CLEAR_VARS)
@@ -49,169 +44,16 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \
LOCAL_SHARED_LIBRARIES := \
libbase \
liblog \
- librecovery_ui
-
-include $(BUILD_SHARED_LIBRARY)
-
-# librecovery_ui (shared library)
-# ===============================
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- device.cpp \
- screen_ui.cpp \
- ui.cpp \
- vr_ui.cpp \
- wear_ui.cpp
-
-LOCAL_MODULE := librecovery_ui
-
-LOCAL_CFLAGS := $(recovery_common_cflags)
-
-LOCAL_MULTILIB := first
-
-ifeq ($(TARGET_IS_64_BIT),true)
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib64
-else
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/lib
-endif
-
-LOCAL_STATIC_LIBRARIES := \
- libminui \
- libotautil \
-
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- libpng \
- libz \
+ librecovery_ui.recovery
include $(BUILD_SHARED_LIBRARY)
-# librecovery_ui (static library)
-# ===============================
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- device.cpp \
- screen_ui.cpp \
- ui.cpp \
- vr_ui.cpp \
- wear_ui.cpp
-
-LOCAL_MODULE := librecovery_ui
-
-LOCAL_CFLAGS := $(recovery_common_cflags)
-
-LOCAL_STATIC_LIBRARIES := \
- libminui \
- libotautil \
-
-LOCAL_SHARED_LIBRARIES := \
- libbase \
- libpng \
- libz \
-
-include $(BUILD_STATIC_LIBRARY)
-
-# Health HAL dependency
-health_hal_static_libraries := \
- android.hardware.health@2.0-impl \
- android.hardware.health@2.0 \
- android.hardware.health@1.0 \
- android.hardware.health@1.0-convert \
- libhealthstoragedefault \
- libhidltransport \
- libhidlbase \
- libhwbinder_noltopgo \
- libvndksupport \
- libbatterymonitor
-
-librecovery_static_libraries := \
- libfusesideload \
- libminadbd \
- libminui \
- libverifier \
- libotautil \
- $(health_hal_static_libraries) \
- libvintf_recovery \
- libvintf \
-
-librecovery_shared_libraries := \
- libasyncio \
- libbase \
- libbootloader_message \
- libcrypto \
- libcrypto_utils \
- libcutils \
- libext4_utils \
- libfs_mgr \
- libhidl-gen-utils \
- liblog \
- libpng \
- libselinux \
- libtinyxml2 \
- libutils \
- libz \
- libziparchive \
-
-# librecovery (static library)
-# ===============================
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- adb_install.cpp \
- fsck_unshare_blocks.cpp \
- fuse_sdcard_provider.cpp \
- install.cpp \
- recovery.cpp \
- roots.cpp \
-
-LOCAL_C_INCLUDES := \
- system/vold \
-
-LOCAL_CFLAGS := $(recovery_common_cflags)
-
-LOCAL_MODULE := librecovery
-
-LOCAL_STATIC_LIBRARIES := \
- $(librecovery_static_libraries)
-
-LOCAL_SHARED_LIBRARIES := \
- $(librecovery_shared_libraries)
-
-include $(BUILD_STATIC_LIBRARY)
-
-# recovery (static executable)
-# ===============================
+# recovery_deps: A phony target that's depended on by `recovery`, which
+# builds additional modules conditionally based on Makefile variables.
+# ======================================================================
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := \
- logging.cpp \
- recovery_main.cpp \
-
-LOCAL_MODULE := recovery
-
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/system/bin
-
-# Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText
-# http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld.
-LOCAL_USE_CLANG_LLD := false
-
-LOCAL_CFLAGS := $(recovery_common_cflags)
-
-LOCAL_STATIC_LIBRARIES := \
- librecovery \
- librecovery_ui_default \
- $(librecovery_static_libraries)
-
-LOCAL_SHARED_LIBRARIES := \
- librecovery_ui \
- $(librecovery_shared_libraries)
-
-LOCAL_HAL_STATIC_LIBRARIES := libhealthd
-
-LOCAL_REQUIRED_MODULES := \
- e2fsdroid.recovery \
- mke2fs.recovery \
- mke2fs.conf
+LOCAL_MODULE := recovery_deps
ifeq ($(TARGET_USERIMAGES_USE_F2FS),true)
ifeq ($(HOST_OS),linux)
@@ -235,31 +77,7 @@ LOCAL_REQUIRED_MODULES += \
recovery-refresh
endif
-LOCAL_REQUIRED_MODULES += \
- librecovery_ui_ext
-
-# TODO(b/110380063): Explicitly install the following shared libraries to recovery, until `recovery`
-# module is built with Soong (with `recovery: true` flag).
-LOCAL_REQUIRED_MODULES += \
- libasyncio.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 \
- libpng.recovery \
- libselinux.recovery \
- libsparse.recovery \
- libtinyxml2.recovery \
- libutils.recovery \
- libz.recovery \
- libziparchive.recovery \
-
-include $(BUILD_EXECUTABLE)
+include $(BUILD_PHONY_PACKAGE)
include \
$(LOCAL_PATH)/tests/Android.mk \
diff --git a/fuse_sideload/Android.bp b/fuse_sideload/Android.bp
index b7f9c039a..90c4c22c3 100644
--- a/fuse_sideload/Android.bp
+++ b/fuse_sideload/Android.bp
@@ -14,6 +14,7 @@
cc_library {
name: "libfusesideload",
+ recovery_available: true,
cflags: [
"-D_XOPEN_SOURCE",
@@ -30,7 +31,7 @@ cc_library {
"include",
],
- static_libs: [
+ shared_libs: [
"libbase",
"libcrypto",
],
diff --git a/minadbd/Android.bp b/minadbd/Android.bp
index 432b2f0f5..00244ee7e 100644
--- a/minadbd/Android.bp
+++ b/minadbd/Android.bp
@@ -26,8 +26,11 @@ cc_defaults {
],
}
-cc_library_static {
- name: "libminadbd",
+// `libminadbd_services` is analogous to the `libadbd_services` for regular `adbd`, but providing
+// the sideload service only.
+cc_library {
+ name: "libminadbd_services",
+ recovery_available: true,
defaults: [
"minadbd_defaults",
@@ -39,14 +42,11 @@ cc_library_static {
"minadbd_services.cpp",
],
- static_libs: [
- "libfusesideload",
+ shared_libs: [
+ "libadbd",
"libbase",
"libcrypto",
- ],
-
- whole_static_libs: [
- "libadbd",
+ "libfusesideload",
],
}
@@ -62,8 +62,9 @@ cc_test {
],
static_libs: [
+ "libminadbd_services",
+ "libadbd",
"libBionicGtestMain",
- "libminadbd",
],
shared_libs: [
diff --git a/tests/Android.mk b/tests/Android.mk
index 3d3e63e7e..b6f5b451f 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -170,14 +170,12 @@ librecovery_static_libraries := \
librecovery \
libbootloader_message \
libfusesideload \
- libminadbd \
librecovery_ui_default \
librecovery_ui \
libminui \
libverifier \
libotautil \
$(health_hal_static_libraries) \
- libasyncio \
libcrypto_utils \
libcrypto \
libext4_utils \
@@ -208,7 +206,7 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_TEST_DATA := \
$(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata) \
- $(call find-test-data-in-subdirs, bootable/recovery, "*_text.png", res-*)
+ $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*_text.png", res-testdata)
include $(BUILD_NATIVE_TEST)
# Host tests
diff --git a/tests/component/resources_test.cpp b/tests/component/resources_test.cpp
index 618d5a4dd..b00c3d528 100644
--- a/tests/component/resources_test.cpp
+++ b/tests/component/resources_test.cpp
@@ -32,10 +32,11 @@
static const std::string kLocale = "zu";
-static const std::vector<std::string> kResourceImagesDirs{ "res-mdpi/images/", "res-hdpi/images/",
- "res-xhdpi/images/",
- "res-xxhdpi/images/",
- "res-xxxhdpi/images/" };
+static const std::vector<std::string> kResourceImagesDirs{
+ "res-testdata/res-mdpi/images/", "res-testdata/res-hdpi/images/",
+ "res-testdata/res-xhdpi/images/", "res-testdata/res-xxhdpi/images/",
+ "res-testdata/res-xxxhdpi/images/",
+};
static int png_filter(const dirent* de) {
if (de->d_type != DT_REG || !android::base::EndsWith(de->d_name, "_text.png")) {
diff --git a/tests/res-testdata/res-hdpi b/tests/res-testdata/res-hdpi
new file mode 120000
index 000000000..c339b1df4
--- /dev/null
+++ b/tests/res-testdata/res-hdpi
@@ -0,0 +1 @@
+../../res-hdpi \ No newline at end of file
diff --git a/tests/res-testdata/res-mdpi b/tests/res-testdata/res-mdpi
new file mode 120000
index 000000000..4be630d6f
--- /dev/null
+++ b/tests/res-testdata/res-mdpi
@@ -0,0 +1 @@
+../../res-mdpi \ No newline at end of file
diff --git a/tests/res-testdata/res-xhdpi b/tests/res-testdata/res-xhdpi
new file mode 120000
index 000000000..429eead83
--- /dev/null
+++ b/tests/res-testdata/res-xhdpi
@@ -0,0 +1 @@
+../../res-xhdpi \ No newline at end of file
diff --git a/tests/res-testdata/res-xxhdpi b/tests/res-testdata/res-xxhdpi
new file mode 120000
index 000000000..304cc28b3
--- /dev/null
+++ b/tests/res-testdata/res-xxhdpi
@@ -0,0 +1 @@
+../../res-xxhdpi \ No newline at end of file
diff --git a/tests/res-testdata/res-xxxhdpi b/tests/res-testdata/res-xxxhdpi
new file mode 120000
index 000000000..2236ad8cc
--- /dev/null
+++ b/tests/res-testdata/res-xxxhdpi
@@ -0,0 +1 @@
+../../res-xxxhdpi \ No newline at end of file
diff --git a/updater_sample/Android.bp b/updater_sample/Android.bp
index 0d209bbd3..845e07b70 100644
--- a/updater_sample/Android.bp
+++ b/updater_sample/Android.bp
@@ -24,11 +24,9 @@ android_app {
],
optimize: {
- // TODO(b/112462307): proguard_flags_files is not picked up by Soong.
- // proguard_flags_files: [
- // "proguard.flags",
- // ],
- enabled: false,
+ proguard_flags_files: [
+ "proguard.flags",
+ ],
},
resource_dirs: ["res"],