Don't build userdata.img if no partition size

And retire BOARD_DONT_BUILD_USERDATA_IMG.
This unifies the logic in build/core/Makefile and
build/tools/releasetools/img_from_target_files.

Change-Id: Ib6b4e8e0d8279ed7deaf047e9dc30eb65aba013f
diff --git a/core/Makefile b/core/Makefile
index 1e94c60..38f5aa8 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -931,7 +931,7 @@
     $(filter $(TARGET_OUT_DATA)/%,$(tests_MODULES))
 endif
 
-ifneq (true,$(BOARD_DONT_BUILD_USERDATA_IMG))
+ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
 userdataimage_intermediates := \
     $(call intermediates-dir-for,PACKAGING,userdata)
 BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
@@ -957,7 +957,7 @@
 userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
 	$(build-userdataimage-target)
 
-endif # no BOARD_DONT_BUILD_USERDATA_IMG
+endif # BOARD_USERDATAIMAGE_PARTITION_SIZE is set
 
 #######
 ## data partition tarball