[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch
new file mode 100644
index 0000000..df202c8
--- /dev/null
+++ b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/0001-define-loff_t-if-not-already-defined.patch
@@ -0,0 +1,30 @@
+From 848717da4a28d33f8aa8f889377e61e6b1b8ae67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Jul 2017 18:29:52 -0700
+Subject: [PATCH] define loff_t if not already defined
+
+Helps to build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ yaffs_guts.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/yaffs_guts.h b/yaffs_guts.h
+index 6bcf12d..4af17ce 100644
+--- a/yaffs_guts.h
++++ b/yaffs_guts.h
+@@ -18,6 +18,10 @@
+ 
+ #include "yportenv.h"
+ 
++#ifndef loff_t
++#define loff_t off_t
++#endif
++
+ #define YAFFS_OK	1
+ #define YAFFS_FAIL  0
+ 
+-- 
+2.13.2
+
diff --git a/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/makefile-add-ldflags.patch b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/makefile-add-ldflags.patch
new file mode 100644
index 0000000..bb21899
--- /dev/null
+++ b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils/makefile-add-ldflags.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/utils/Makefile b/utils/Makefile
+index 710ebbf..6259893 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -57,10 +57,10 @@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c
+ 	$(CC) -c $(CFLAGS) $< -o $@
+ 
+ mkyaffsimage: $(MKYAFFSIMAGEOBJS) $(COMMONOBJS)
+-	$(CC) -o $@  $^
++	$(CC) $(LDFLAGS) -o $@  $^
+ 
+ mkyaffs2image: $(MKYAFFS2IMAGEOBJS) $(COMMONOBJS)
+-	$(CC) -o $@ $^
++	$(CC) $(LDFLAGS) -o $@ $^
+ 
+ 
+ clean:
diff --git a/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb
new file mode 100644
index 0000000..6095e27
--- /dev/null
+++ b/meta/meta-openembedded/meta-filesystems/recipes-filesystems/yaffs2/yaffs2-utils_git.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Yet Another Flash File System"
+DESCRIPTION = "Tools for managing 'yaffs2' file systems."
+
+SECTION = "base"
+HOMEPAGE = "http://www.yaffs.net"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://utils/mkyaffs2image.c;beginline=11;endline=13;md5=5f5464f9b3e981ca574e65b00e438561 \
+                    file://utils/mkyaffsimage.c;beginline=10;endline=12;md5=5f5464f9b3e981ca574e65b00e438561 \
+                    "
+
+PV = "0.0+git${SRCPV}"
+
+DEPENDS = "mtd-utils"
+
+# Source is the HEAD of master branch at the time of writing this recipe
+SRC_URI = "git://www.aleph1.co.uk/yaffs2;protocol=git;branch=master \
+           file://makefile-add-ldflags.patch \
+           file://0001-define-loff_t-if-not-already-defined.patch \
+           "
+
+SRCREV = "3439fa4e60dd9799766b2c101f799ed9e565b632"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+CFLAGS_append = " -I.. -DCONFIG_YAFFS_UTIL -DCONFIG_YAFFS_DEFINES_TYPES"
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile() {
+    cd utils && oe_runmake
+}
+
+INSTALL_FILES = "mkyaffsimage \
+                 mkyaffs2image \
+                "
+do_install() {
+    install -d ${D}${sbindir}/
+    for i in ${INSTALL_FILES}; do
+        install -m 0755 utils/$i ${D}${sbindir}/
+    done
+}
+
+BBCLASSEXTEND = "native"