u-boot: rename u-boot.inc to u-boot-ubi.inc

Rename u-boot.inc to u-boot-ubi.inc to make it slightly clearer
that the include file is for ubi related things.

Use _append rather than += to avoid losing patches if SRC_URI is set
later during parse.

Change-Id: Ibb5c632bccf29a6a21056f280ebb3041c366347f
Tested: Built witherspoon and palmetto images.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/common/recipes-bsp/u-boot/u-boot-ubi.inc b/common/recipes-bsp/u-boot/u-boot-ubi.inc
new file mode 100644
index 0000000..ec5f861
--- /dev/null
+++ b/common/recipes-bsp/u-boot/u-boot-ubi.inc
@@ -0,0 +1,22 @@
+inherit image_version
+
+SRC_URI_append = " file://0001-configs-ast-Add-redundnant-env.patch"
+
+SRC_URI_append = " ${@bb.utils.contains('MACHINE_FEATURES', 'obmc-ubi-fs', \
+    'file://0001-config-ast-common-hack-bootopts.patch \
+     file://0004-config-ast-common-ubi-bootops.patch \
+     file://0001-config-ast-common-Add-conditional-factory-reset-comm.patch', '', d)}"
+
+python do_configure () {
+    if "obmc-ubi-fs" in d.getVar("MACHINE_FEATURES", True):
+        version_id=do_get_versionID(d)
+        d.setVar('VERSION_ID', version_id)
+        bb.build.exec_func("patch_uboot", d)
+}
+
+patch_uboot () {
+	sed -i "s/kernel-0/kernel-${VERSION_ID}/g" \
+	${S}/patches/0004-config-ast-common-ubi-bootops.patch &> /dev/null
+	sed -i "s/kernel-0/kernel-${VERSION_ID}/g" \
+	${S}/include/configs/ast-common.h &> /dev/null
+}