file_contexts: remove symlink to binary file and use text version instead
Some older update binaries can't read the binary file_contexts, so include
the text version of the file to prevent errors. This removes the symlink
to the binary version of the file and uses the concatenated file_contexts
from the OUT build folder.
Change-Id: Ia57c9b47c95945721d3dfa1ec8e18c4bb199adff
diff --git a/Android.mk b/Android.mk
index 4b29e47..335a2d4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -485,7 +485,7 @@
endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0)
- LOCAL_ADDITIONAL_DEPENDENCIES += file_contexts_symlink
+ LOCAL_ADDITIONAL_DEPENDENCIES += file_contexts_text
endif
ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),)
@@ -497,11 +497,11 @@
# Symlink for file_contexts
include $(CLEAR_VARS)
-LOCAL_MODULE := file_contexts_symlink
+LOCAL_MODULE := file_contexts_text
LOCAL_MODULE_TAGS := optional
+LOCAL_REQUIRED_MODULES := file_contexts.bin
LOCAL_POST_INSTALL_CMD := \
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin && \
- ln -sf /file_contexts.bin $(TARGET_RECOVERY_ROOT_OUT)/file_contexts
+ $(hide) cp -f $(OUT)/obj/ETC/file_contexts.bin_intermediates/file_contexts.concat.tmp $(TARGET_RECOVERY_ROOT_OUT)/file_contexts
include $(BUILD_PHONY_PACKAGE)