merge in klp-release history after reset to master
diff --git a/core/build_id.mk b/core/build_id.mk
index 8f7b926..40bb35d 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -13,9 +13,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+
+#
+# Defines branch-specific values.
+#
+
 # BUILD_ID is usually used to specify the branch name
 # (like "MAIN") or a branch name and a release candidate
-# (like "CRB01").  It must be a single word, and is
+# (like "TC1-RC5").  It must be a single word, and is
 # capitalized by convention.
+#
+BUILD_ID := MASTER
 
-export BUILD_ID=KRS11D
+# DISPLAY_BUILD_NUMBER should only be set for development branches,
+# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
+# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
+# is the same as BUILD_ID
+DISPLAY_BUILD_NUMBER := true
diff --git a/core/cleanspec.mk b/core/cleanspec.mk
index d4a8eed..500ce54 100644
--- a/core/cleanspec.mk
+++ b/core/cleanspec.mk
@@ -64,6 +64,6 @@
 # ************************************************
 
 subdir_cleanspecs := \
-    $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git . CleanSpec.mk)
+    $(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git . CleanSpec.mk)
 include $(subdir_cleanspecs)
 subdir_cleanspecs :=
diff --git a/core/definitions.mk b/core/definitions.mk
index 7834baa..bf9901e 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -147,7 +147,7 @@
 # $(1): directory to search under
 # Ignores $(1)/Android.mk
 define first-makefiles-under
-$(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git \
+$(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git \
         --mindepth=2 $(1) Android.mk)
 endef
 
diff --git a/core/main.mk b/core/main.mk
index 25ec74e..47847bf 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -479,7 +479,7 @@
 # Can't use first-makefiles-under here because
 # --mindepth=2 makes the prunes not work.
 subdir_makefiles := \
-	$(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)
+	$(shell build/tools/findleaves.py --prune=$(OUT_DIR) --prune=.repo --prune=.git $(subdirs) Android.mk)
 
 include $(subdir_makefiles)
 
diff --git a/core/pathmap.mk b/core/pathmap.mk
index 5953bdf..f3a9e78 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -113,6 +113,7 @@
         v4 \
         v7/gridlayout \
         v7/appcompat \
+        v7/mediarouter \
         v8/renderscript \
         v13
 
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index 6e08832..f5732d1 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -84,6 +84,14 @@
 ifdef LOCAL_INSTALLED_MODULE
 ifdef LOCAL_SHARED_LIBRARIES
 $(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += $(LOCAL_MODULE):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(LOCAL_SHARED_LIBRARIES))
+
+# We also need the LOCAL_BUILT_MODULE dependency,
+# since we use -rpath-link which points to the built module's path.
+built_shared_libraries := \
+    $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
+    $(addsuffix $(so_suffix), \
+        $(LOCAL_SHARED_LIBRARIES)))
+$(LOCAL_BUILT_MODULE) : $(built_shared_libraries)
 endif
 endif
 
diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk
index 35cbd27..3bd4f31 100644
--- a/target/board/generic/BoardConfig.mk
+++ b/target/board/generic/BoardConfig.mk
@@ -44,3 +44,11 @@
 # Build and enable the OpenGL ES View renderer. When running on the emulator,
 # the GLES renderer disables itself if host GL acceleration isn't available.
 USE_OPENGL_RENDERER := true
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 576716800
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 209715200
+BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 512
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk
index c3881b4..e6f43af 100644
--- a/target/board/generic_mips/BoardConfig.mk
+++ b/target/board/generic_mips/BoardConfig.mk
@@ -48,3 +48,11 @@
 # Build and enable the OpenGL ES View renderer. When running on the emulator,
 # the GLES renderer disables itself if host GL acceleration isn't available.
 USE_OPENGL_RENDERER := true
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 576716800
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 209715200
+BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 512
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk
index 4a9e5fe..ed7da38 100644
--- a/target/board/generic_x86/BoardConfig.mk
+++ b/target/board/generic_x86/BoardConfig.mk
@@ -33,3 +33,11 @@
 # Build and enable the OpenGL ES View renderer. When running on the emulator,
 # the GLES renderer disables itself if host GL acceleration isn't available.
 USE_OPENGL_RENDERER := true
+
+TARGET_USERIMAGES_USE_EXT4 := true
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 576716800
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 209715200
+BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 512
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
diff --git a/target/product/base.mk b/target/product/base.mk
index d3c18fb..e9f43a7 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -85,6 +85,7 @@
     netcfg \
     netd \
     ping \
+    ping6 \
     platform.xml \
     pppd \
     pm \