Merge "Remove $(DEX2OAT) from DEX2OAT_DEPENDENCY when USE_DEX2OAT_DEBUG is set."
diff --git a/core/Makefile b/core/Makefile
index 410fa16..2039d94 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -784,8 +784,15 @@
else
recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab))
endif
+
+ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
# Named '.dat' so we don't attempt to use imgdiff for patching it.
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat
+else
+# We carry a full copy of the recovery image. recovery-resource.dat is no
+# longer needed.
+RECOVERY_RESOURCE_ZIP :=
+endif
ifeq ($(recovery_resources_private),)
$(info No private recovery resources for TARGET_DEVICE $(TARGET_DEVICE))
@@ -877,16 +884,18 @@
$(RECOVERY_INSTALL_OTA_KEYS)
$(call build-recoveryimage-target, $@)
+ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
$(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET)
$(hide) mkdir -p $(dir $@)
$(hide) find $(TARGET_RECOVERY_ROOT_OUT)/res -type f | sort | zip -0qrj $@ -@
+endif
.PHONY: recoveryimage-nodeps
recoveryimage-nodeps:
@echo "make $@: ignoring dependencies"
$(call build-recoveryimage-target, $(INSTALLED_RECOVERYIMAGE_TARGET))
-else
+else # ! ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
INSTALLED_RECOVERYIMAGE_TARGET :=
RECOVERY_RESOURCE_ZIP :=
endif
@@ -994,6 +1003,7 @@
# we can see how big it's going to be, and include that in the system
# image size check calculation.
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
+ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch)
RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p
$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \
@@ -1003,6 +1013,9 @@
@echo "Construct recovery from boot"
mkdir -p $(dir $@)
PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@
+else # $(BOARD_USES_FULL_RECOVERY_IMAGE) == true
+RECOVERY_FROM_BOOT_PATCH := $(INSTALLED_RECOVERYIMAGE_TARGET)
+endif
endif
@@ -1496,6 +1509,9 @@
# We need to create userdata.img with real data because the instrumented libraries are in userdata.img.
$(hide) echo "userdata_img_with_data=true" >> $(zip_root)/META/misc_info.txt
endif
+ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
+ $(hide) echo "full_recovery_image=true" >> $(zip_root)/META/misc_info.txt
+endif
$(call generate-userimage-prop-dictionary, $(zip_root)/META/misc_info.txt)
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
./build/tools/releasetools/make_recovery_patch $(zip_root) $(zip_root)
diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h
index 8b9097b..4abec42 100644
--- a/core/combo/include/arch/windows/AndroidConfig.h
+++ b/core/combo/include/arch/windows/AndroidConfig.h
@@ -76,8 +76,6 @@
#define _WIN32 1
#define _WIN32_WINNT 0x0500 /* admit to using >= Win2K */
-#define HAVE_WINDOWS_PATHS /* needed by simulator */
-
/*
* The default path separator for the platform
*/
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
index 3941edf..f150714 100644
--- a/core/cxx_stl_setup.mk
+++ b/core/cxx_stl_setup.mk
@@ -24,6 +24,18 @@
endif
else
my_cxx_stl := $(strip $(LOCAL_CXX_STL))
+ ifdef LOCAL_SDK_VERSION
+ # The NDK has historically used LOCAL_NDK_STL_VARIANT to specify the
+ # STL. An Android.mk that specifies both LOCAL_CXX_STL and
+ # LOCAL_SDK_VERSION will incorrectly try (and most likely fail) to use
+ # the platform STL in an NDK binary. Emit an error to direct the user
+ # toward the correct option.
+ #
+ # Note that we could also accept LOCAL_CXX_STL as an alias for
+ # LOCAL_NDK_STL_VARIANT (and in fact soong does use the same name), but
+ # the two options use different names for the STLs.
+ $(error $(LOCAL_PATH): $(LOCAL_MODULE): Must use LOCAL_NDK_STL_VARIANT rather than LOCAL_CXX_STL for NDK binaries)
+ endif
endif
# Yes, this is actually what the clang driver does.
diff --git a/libs/host/include/host/Directories.h b/libs/host/include/host/Directories.h
deleted file mode 100644
index fccce46..0000000
--- a/libs/host/include/host/Directories.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef HOST_MKDIRS_H
-#define HOST_MKDIRS_H
-
-#include <string>
-
-std::string parent_dir(const std::string& path);
-
-extern "C" int mkdirs(const char* path);
-
-#endif // HOST_MKDIRS_H
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 0d8ca34..5fcdbe4 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -1395,18 +1395,24 @@
if info_dict is None:
info_dict = OPTIONS.info_dict
- diff_program = ["imgdiff"]
- path = os.path.join(input_dir, "SYSTEM", "etc", "recovery-resource.dat")
- if os.path.exists(path):
- diff_program.append("-b")
- diff_program.append(path)
- bonus_args = "-b /system/etc/recovery-resource.dat"
- else:
- bonus_args = ""
+ full_recovery_image = info_dict.get("full_recovery_image", None) == "true"
- d = Difference(recovery_img, boot_img, diff_program=diff_program)
- _, _, patch = d.ComputePatch()
- output_sink("recovery-from-boot.p", patch)
+ if full_recovery_image:
+ output_sink("etc/recovery.img", recovery_img.data)
+
+ else:
+ diff_program = ["imgdiff"]
+ path = os.path.join(input_dir, "SYSTEM", "etc", "recovery-resource.dat")
+ if os.path.exists(path):
+ diff_program.append("-b")
+ diff_program.append(path)
+ bonus_args = "-b /system/etc/recovery-resource.dat"
+ else:
+ bonus_args = ""
+
+ d = Difference(recovery_img, boot_img, diff_program=diff_program)
+ _, _, patch = d.ComputePatch()
+ output_sink("recovery-from-boot.p", patch)
try:
boot_type, boot_device = GetTypeAndDevice("/boot", info_dict)
@@ -1414,7 +1420,19 @@
except KeyError:
return
- sh = """#!/system/bin/sh
+ if full_recovery_image:
+ sh = """#!/system/bin/sh
+if ! applypatch -c %(type)s:%(device)s:%(size)d:%(sha1)s; then
+ applypatch /system/etc/recovery.img %(type)s:%(device)s %(sha1)s %(size)d && log -t recovery "Installing new recovery image: succeeded" || log -t recovery "Installing new recovery image: failed"
+else
+ log -t recovery "Recovery image already installed"
+fi
+""" % {'type': recovery_type,
+ 'device': recovery_device,
+ 'sha1': recovery_img.sha1,
+ 'size': recovery_img.size}
+ else:
+ sh = """#!/system/bin/sh
if ! applypatch -c %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then
applypatch %(bonus_args)s %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s %(recovery_type)s:%(recovery_device)s %(recovery_sha1)s %(recovery_size)d %(boot_sha1)s:/system/recovery-from-boot.p && log -t recovery "Installing new recovery image: succeeded" || log -t recovery "Installing new recovery image: failed"
else
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index 531b432..f5b912f 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -218,7 +218,8 @@
if i.is_dir:
i.children.sort(key=lambda i: i.name)
- # set metadata for the files generated by this script.
+ # Set metadata for the files generated by this script. For full recovery
+ # image at system/etc/recovery.img, it will be taken care by fs_config.
i = self.ITEMS.get("system/recovery-from-boot.p", None)
if i:
i.uid, i.gid, i.mode, i.selabel, i.capabilities = 0, 0, 0o644, None, None
@@ -422,11 +423,9 @@
def HasRecoveryPatch(target_files_zip):
- try:
- target_files_zip.getinfo("SYSTEM/recovery-from-boot.p")
- return True
- except KeyError:
- return False
+ namelist = [name for name in target_files_zip.namelist()]
+ return ("SYSTEM/recovery-from-boot.p" in namelist or
+ "SYSTEM/etc/recovery.img" in namelist)
def HasVendorPartition(target_files_zip):
try:
@@ -1360,6 +1359,7 @@
common.MakeRecoveryPatch(OPTIONS.target_tmp, output_sink,
target_recovery, target_boot)
script.DeleteFiles(["/system/recovery-from-boot.p",
+ "/system/etc/recovery.img",
"/system/etc/install-recovery.sh"])
print "recovery image changed; including as patch from boot."
else:
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index ec49112..962d3dd 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -175,6 +175,7 @@
data = input_tf_zip.read(info.filename)
out_info = copy.copy(info)
+ # Replace keys if requested.
if (info.filename == "META/misc_info.txt" and
OPTIONS.replace_verity_private_key):
ReplaceVerityPrivateKey(input_tf_zip, output_tf_zip, misc_info,
@@ -184,12 +185,14 @@
new_data = ReplaceVerityPublicKey(output_tf_zip,
OPTIONS.replace_verity_public_key[1])
write_to_temp(info.filename, info.external_attr, new_data)
+ # Copy BOOT/, RECOVERY/, META/, ROOT/ to rebuild recovery patch.
elif (info.filename.startswith("BOOT/") or
info.filename.startswith("RECOVERY/") or
info.filename.startswith("META/") or
info.filename == "SYSTEM/etc/recovery-resource.dat"):
write_to_temp(info.filename, info.external_attr, data)
+ # Sign APKs.
if info.filename.endswith(".apk"):
name = os.path.basename(info.filename)
key = apk_key_map[name]
@@ -214,6 +217,7 @@
new_data = ReplaceCerts(data)
common.ZipWriteStr(output_tf_zip, out_info, new_data)
elif info.filename in ("SYSTEM/recovery-from-boot.p",
+ "SYSTEM/etc/recovery.img",
"SYSTEM/bin/install-recovery.sh"):
rebuild_recovery = True
elif (OPTIONS.replace_ota_keys and