From d821c96c529ac83db33a471df745887508e9afef Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Wed, 15 Feb 2017 12:36:18 -0600 Subject: Symlink file_contexts --> file_contexts.bin The presence of /file_contexts is still important to TWRP: - files written while in adb shell only pick up contexts if /file_contexts is present - fixContexts looks for /file_contexts - if !USE_EXT4 (is this possible), then make_ext4fs looks for /file_contexts when wiping In the event than file_contexts.bin also becomes more important in the future, leave it in place and create a symlink to it. Change-Id: Ic87852248d42d5ea6bf936df160efa41294b6520 --- Android.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Android.mk b/Android.mk index d6a318ba5..2b7c2d124 100644 --- a/Android.mk +++ b/Android.mk @@ -478,12 +478,27 @@ ifeq ($(shell test $(CM_PLATFORM_SDK_VERSION) -ge 3; echo $$?),0) endif endif +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 25; echo $$?),0) + LOCAL_ADDITIONAL_DEPENDENCIES += file_contexts_symlink +endif + ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) LOCAL_REQUIRED_MODULES := recovery-persist recovery-refresh endif include $(BUILD_EXECUTABLE) +# Symlink for file_contexts +include $(CLEAR_VARS) + +LOCAL_MODULE := file_contexts_symlink +LOCAL_MODULE_TAGS := optional +LOCAL_POST_INSTALL_CMD := \ + $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/sbin && \ + ln -sf /file_contexts.bin $(TARGET_RECOVERY_ROOT_OUT)/file_contexts + +include $(BUILD_PHONY_PACKAGE) + ifneq ($(TW_USE_TOOLBOX), true) include $(CLEAR_VARS) # Create busybox symlinks... gzip and gunzip are excluded because those need to link to pigz instead -- cgit v1.2.3