summaryrefslogtreecommitdiffstats
path: root/core/Makefile
diff options
context:
space:
mode:
authordhacker29 <dhackerdvm@gmail.com>2015-11-05 00:55:01 -0500
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-11-05 09:38:48 -0800
commit5edc9e08ca395769f975dd817c38784a68b166b5 (patch)
treef4ffa2b3d2a32cd143bc2c55d6d27bef5eb468bf /core/Makefile
parent766a518ae6de4b81c4fc139f90b51521a2f681b7 (diff)
downloadbuild-5edc9e08ca395769f975dd817c38784a68b166b5.zip
build-5edc9e08ca395769f975dd817c38784a68b166b5.tar.gz
build-5edc9e08ca395769f975dd817c38784a68b166b5.tar.bz2
Conditionally create symlink /system/vendor if needed
We don't need to build a vendor image in CM, just create the symlink for Nexus devices that use a vendor partition To use add BOARD_NEEDS_VENDORIMAGE_SYMLINK := true to BoardConfig.mk Change-Id: Id39ee89007af39346f0887796ed3cbad81765c46
Diffstat (limited to 'core/Makefile')
-rw-r--r--core/Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/Makefile b/core/Makefile
index 596abb1..c1a3cf3 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1173,6 +1173,18 @@ define create-system-vendor-symlink
endef
endif
+# Only Create symlink /system/vendor to /vendor if necessary.
+ifdef BOARD_NEEDS_VENDORIMAGE_SYMLINK
+define create-system-vendor-symlink
+$(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \
+ echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>&2; \
+ echo 'You cannot install files to $(TARGET_OUT)/vendor while building a separate vendor.img!' 1>&2; \
+ exit 1; \
+fi
+$(hide) ln -sf /vendor $(TARGET_OUT)/vendor
+endef
+endif
+
# $(1): output file
define build-systemimage-target
@echo "Target system fs image: $(1)"