filesystem: mount rw and overlay

Append base-files to add new fstab and depend on mount-overlay recipe.
Add systemd services to help mounting overlay fs.

Resolves openbmc/openbmc#2134

Change-Id: Ib56fcdde9f7364fca56a08e1ce72e7cafaac35b0
Signed-off-by: Edward A. James <eajames@us.ibm.com>
diff --git a/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb
new file mode 100644
index 0000000..4125fd0
--- /dev/null
+++ b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help.bb
@@ -0,0 +1,5 @@
+inherit obmc-phosphor-license
+
+SYSTEMD_SERVICE_${PN} = "prepare-overlay.service mount-machine-id.service"
+
+inherit obmc-phosphor-systemd
diff --git a/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service
new file mode 100644
index 0000000..0d72f0a
--- /dev/null
+++ b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/mount-machine-id.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Mount machine-id
+Requires=etc.mount
+After=etc.mount
+DefaultDependencies=false
+ConditionPathExists=!/var/persist/etc/machine-id
+
+[Install]
+RequiredBy=local-fs.target
+
+[Service]
+ExecStart=/bin/sh -c "mount --bind /run/machine-id /etc/machine-id"
+Type=oneshot
+RemainAfterExit=no
diff --git a/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service
new file mode 100644
index 0000000..0f48277
--- /dev/null
+++ b/common/recipes-phosphor/mount-overlay-help/mount-overlay-help/prepare-overlay.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Prepare for overlay fs
+RequiresMountsFor=/var
+DefaultDependencies=false
+
+[Service]
+ExecStart=/bin/sh -c "rm -rf /var/persist/etc-work && mkdir -p /var/persist/etc /var/persist/etc-work"
+Type=oneshot
+RemainAfterExit=no