From 092c9025a96bc014c21cf8029c290a07adf3a3b4 Mon Sep 17 00:00:00 2001 From: Alex Klyubin Date: Mon, 13 Mar 2017 13:28:34 -0700 Subject: [PATCH] Add /file_contexts.bin only to devices which need it /file_contexts.bin is needed only by devices which do not have PRODUCT_FULL_TREBLE set to true. Adding this file to devices which have PRODUCT_FULL_TREBLE set to true causes confusion and wastes about 800 kB of space. /file_contexts.bin was being added unconditionally to all devices due to the build system needing the combined file_contexts file for host-side labelling of filesystems in images and for inclusion into target files ZIP (again, to be used for host-side labelling later). This change switches these targets to depend on the same file, but from intermediates directory. As a result, everything continues to work just fine, but without pulling in /file_contexts.bin. On devices which need /file_contexts.bin, it is pulled in by system/core/init/Android.mk. Test: /file_contexts.bin still there on bullhead, but not there on sailfish with PRODUCT_FULL_TREBLE set to true. Test: Clean build, device boots up with, no new denials. Reboot to recovery, recovery boots up fine too, no denials. This was tested on sailfish-eng and marlin-eng. Bug: 36002414 Change-Id: I9bbbb08bbf7d874bba0bafcc19bcbf9eec564326 --- core/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index b0a03b584..cf0aa4a42 100644 --- a/core/Makefile +++ b/core/Makefile @@ -835,7 +835,7 @@ INTERNAL_USERIMAGES_DEPS += $(FEC) endif endif -SELINUX_FC := $(TARGET_ROOT_OUT)/file_contexts.bin +SELINUX_FC := $(call intermediates-dir-for,ETC,file_contexts.bin)/file_contexts.bin INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC) INTERNAL_USERIMAGES_DEPS += $(BLK_ALLOC_TO_BASE_FS)