Merge "Quick and dirty filtering of present LOCAL_OPTIONAL_USES_LIBRARIES."
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 4fd8baa..68f880f 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -508,6 +508,7 @@
###########################################################
my_init_rc_installed :=
+my_init_rc_path :=
my_init_rc_pairs :=
my_installed_symlinks :=
my_default_test_module :=
@@ -534,7 +535,11 @@
# Rule to install the module's companion init.rc.
my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) $(LOCAL_INIT_RC)
ifneq ($(strip $(my_init_rc)),)
-my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(LOCAL_PATH)/$(rc):$(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(rc)))
+# Make doesn't support recovery as an output partition, but some Soong modules installed in recovery
+# have init.rc files that need to be installed alongside them. Manually handle the case where the
+# output file is in the recovery partition.
+my_init_rc_path := $(if $(filter $(TARGET_RECOVERY_ROOT_OUT)/%,$(my_module_path)),$(TARGET_RECOVERY_ROOT_OUT)/system/etc,$(TARGET_OUT$(partition_tag)_ETC))
+my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(LOCAL_PATH)/$(rc):$(my_init_rc_path)/init/$(notdir $(rc)))
my_init_rc_installed := $(foreach rc,$(my_init_rc_pairs),$(call word-colon,2,$(rc)))
# Make sure we only set up the copy rules once, even if another arch variant
diff --git a/target/board/module_arm64/device.mk b/target/board/module_arm64/device.mk
deleted file mode 100644
index 0d4c543..0000000
--- a/target/board/module_arm64/device.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2020 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$(call inherit-product, build/make/target/product/default_art_config.mk)
-$(call inherit-product, build/make/target/product/core_64_bit.mk)
-$(call inherit-product, build/make/target/product/languages_default.mk)
diff --git a/target/board/module_x86/device.mk b/target/board/module_x86/device.mk
deleted file mode 100644
index cceb987..0000000
--- a/target/board/module_x86/device.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2020 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$(call inherit-product, build/make/target/product/default_art_config.mk)
-$(call inherit-product, build/make/target/product/languages_default.mk)
diff --git a/target/board/module_x86_64/device.mk b/target/board/module_x86_64/device.mk
deleted file mode 100644
index 0d4c543..0000000
--- a/target/board/module_x86_64/device.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2020 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-$(call inherit-product, build/make/target/product/default_art_config.mk)
-$(call inherit-product, build/make/target/product/core_64_bit.mk)
-$(call inherit-product, build/make/target/product/languages_default.mk)
diff --git a/target/product/module_arm.mk b/target/product/module_arm.mk
index 09ccf5f..d99dce8 100644
--- a/target/product/module_arm.mk
+++ b/target/product/module_arm.mk
@@ -14,7 +14,7 @@
# limitations under the License.
#
-$(call inherit-product, $(SRC_TARGET_DIR)/board/module_arm/device.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk)
PRODUCT_NAME := module_arm
PRODUCT_BRAND := Android
diff --git a/target/product/module_arm64.mk b/target/product/module_arm64.mk
index 468c9db..fc9529c 100644
--- a/target/product/module_arm64.mk
+++ b/target/product/module_arm64.mk
@@ -14,7 +14,8 @@
# limitations under the License.
#
-$(call inherit-product, $(SRC_TARGET_DIR)/board/module_arm64/device.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
PRODUCT_NAME := module_arm64
PRODUCT_BRAND := Android
diff --git a/target/board/module_arm/device.mk b/target/product/module_common.mk
similarity index 75%
rename from target/board/module_arm/device.mk
rename to target/product/module_common.mk
index cceb987..eedd479 100644
--- a/target/board/module_arm/device.mk
+++ b/target/product/module_common.mk
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2020 The Android Open Source Project
+# Copyright (C) 2021 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,5 +14,5 @@
# limitations under the License.
#
-$(call inherit-product, build/make/target/product/default_art_config.mk)
-$(call inherit-product, build/make/target/product/languages_default.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/default_art_config.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk)
diff --git a/target/product/module_x86.mk b/target/product/module_x86.mk
index dec4aed..b852e7a 100644
--- a/target/product/module_x86.mk
+++ b/target/product/module_x86.mk
@@ -14,7 +14,7 @@
# limitations under the License.
#
-$(call inherit-product, $(SRC_TARGET_DIR)/board/module_x86/device.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk)
PRODUCT_NAME := module_x86
PRODUCT_BRAND := Android
diff --git a/target/product/module_x86_64.mk b/target/product/module_x86_64.mk
index 5fabade..f6bc1fc 100644
--- a/target/product/module_x86_64.mk
+++ b/target/product/module_x86_64.mk
@@ -14,7 +14,8 @@
# limitations under the License.
#
-$(call inherit-product, $(SRC_TARGET_DIR)/board/module_x86_64/device.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/module_common.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
PRODUCT_NAME := module_x86_64
PRODUCT_BRAND := Android
diff --git a/tools/releasetools/Android.bp b/tools/releasetools/Android.bp
index 473d854..0c84d4f 100644
--- a/tools/releasetools/Android.bp
+++ b/tools/releasetools/Android.bp
@@ -282,6 +282,7 @@
"boot_signer",
"brotli",
"bsdiff",
+ "deapexer",
"imgdiff",
"minigzip",
"lz4",
@@ -568,6 +569,7 @@
name: "releasetools_test",
defaults: ["releasetools_test_defaults"],
main: "test_utils.py",
+ test_suites: ["general-tests"],
version: {
py2: {
enabled: true,
@@ -590,6 +592,7 @@
name: "releasetools_py3_test",
defaults: ["releasetools_test_defaults"],
main: "test_utils.py",
+ test_suites: ["general-tests"],
version: {
py2: {
enabled: false,
diff --git a/tools/releasetools/TEST_MAPPING b/tools/releasetools/TEST_MAPPING
new file mode 100644
index 0000000..3d57960
--- /dev/null
+++ b/tools/releasetools/TEST_MAPPING
@@ -0,0 +1,8 @@
+{
+ "presubmit": [
+ {
+ "name": "releasetools_test",
+ "host" : true
+ }
+ ]
+}
diff --git a/tools/releasetools/apex_utils.py b/tools/releasetools/apex_utils.py
index 3177fa0..644b92a 100644
--- a/tools/releasetools/apex_utils.py
+++ b/tools/releasetools/apex_utils.py
@@ -545,7 +545,7 @@
debugfs_path = os.path.join(OPTIONS.search_path, "bin", "debugfs_static")
deapexer = 'deapexer'
if OPTIONS.search_path:
- deapexer_path = os.path.join(OPTIONS.search_path, "deapexer")
+ deapexer_path = os.path.join(OPTIONS.search_path, "bin", "deapexer")
if os.path.isfile(deapexer_path):
deapexer = deapexer_path
for apex_filename in os.listdir(target_dir):