[Add overlayfs feature]

[Description]
Add overlayfs feature
1. support overlayfs feature refer to colgin

[Release-log]

diff --git a/recipes-devtools/initrd/files/init_readonlyfs.sh b/recipes-devtools/initrd/files/init_readonlyfs.sh
new file mode 100644
index 0000000..ae7e341
--- /dev/null
+++ b/recipes-devtools/initrd/files/init_readonlyfs.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+set +e
+
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+INIT="/lib/systemd/systemd"
+
+$MOUNT -n -t ubifs /dev/ubi0_2 /overlay
+[ ! -d  "/overlay/upper" ] && mkdir /overlay/upper
+[ ! -d  "/overlay/work" ] && mkdir /overlay/work
+$MOUNT -n  -t overlay overlayfs:/overlay -o rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work /mnt
+pivot_root /mnt /mnt/rom
+$MOUNT -n /rom/dev -o noatime --move /dev
+$MOUNT -n /rom/overlay -o noatime --move /overlay
+
+
+exec $INIT
diff --git a/recipes-devtools/initrd/systemd_%.bbappend b/recipes-devtools/initrd/systemd_%.bbappend
new file mode 100644
index 0000000..42a8ac6
--- /dev/null
+++ b/recipes-devtools/initrd/systemd_%.bbappend
@@ -0,0 +1,15 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append = " file://init_readonlyfs.sh \
+                 "
+FILES_${PN} += " /overlay \
+               /rom \"
+
+do_install_append() {
+       install -d ${D}/overlay
+       install -d ${D}/rom
+       install -m 0755 ${WORKDIR}/init_readonlyfs.sh ${D}${rootlibexecdir}/init_readonlyfs.sh
+       [ -e ${D}/sbin/init ] && rm -rf ${D}/sbin/init
+       ln -s ${rootlibexecdir}/init_readonlyfs.sh ${D}/sbin/init
+}
+
+FILES_${PN} += " ${rootlibexecdir}/init_readonlyfs.sh "