OSDN Git Service

Conditionally create symlink /system/vendor if needed
authordhacker29 <dhackerdvm@gmail.com>
Thu, 5 Nov 2015 05:55:01 +0000 (00:55 -0500)
committerMichael Bestas <mikeioannina@gmail.com>
Fri, 6 Jan 2017 23:37:34 +0000 (01:37 +0200)
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

core/Makefile

index c5f4992..5465be5 100644 (file)
@@ -1219,6 +1219,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)"