meta-phosphor: static-norootfs: check for uboot env to mount ubifs as tmpfs

Add a check if `openbmconce` U-boot env set as `no-persist-fs`
if so, then instead of mounting `/run/mnt-persist` as ubifs filesystem,
simply mount it as tmpfs. This will prevent issues related to a mounted,
persistent filesystem when running data sanitization scripts to wipe
the BMC.

Test:

Build and run in QEMU.  Initial mounts:
```
root@bletchley:~# mount | grep "mnt-persist"
ubi0:rwfs on /run/mnt-persist type ubifs (rw,relatime,sync,compr=zstd,assert=read-only,ubi=0,vol=0)
overlay on /var type overlay (rw,relatime,lowerdir=/var,upperdir=/run/mnt-persist/var-data,workdir=/run/mnt-persist/var-work,uuid=on)
overlay on /etc type overlay (rw,relatime,lowerdir=/etc,upperdir=/run/mnt-persist/etc-data,workdir=/run/mnt-persist/etc-work,uuid=on)
overlay on /home/root type overlay (rw,relatime,lowerdir=/home/root,upperdir=/run/mnt-persist/home/root-data,workdir=/run/mnt-persist/home/root-work,uuid=on)
overlay on /mnt/data type overlay (rw,relatime,lowerdir=/mnt/data,upperdir=/run/mnt-persist/mnt/data-data,workdir=/run/mnt-persist/mnt/data-work,uuid=on)
```

Run `fw_setenv openbmconce no-persist-fs && reboot`.  Afterwards:
```
root@bletchley:~# mount | grep mnt-persist
tmpfs on /run/mnt-persist type tmpfs (rw,relatime)
overlay on /var type overlay (rw,relatime,lowerdir=/var,upperdir=/run/mnt-persist/var-data,workdir=/run/mnt-persist/var-work,redirect_dir=nofollow,uuid=null)
overlay on /etc type overlay (rw,relatime,lowerdir=/etc,upperdir=/run/mnt-persist/etc-data,workdir=/run/mnt-persist/etc-work,redirect_dir=nofollow,uuid=null)
overlay on /home/root type overlay (rw,relatime,lowerdir=/home/root,upperdir=/run/mnt-persist/home/root-data,workdir=/run/mnt-persist/home/root-work,redirect_dir=nofollow,uuid=null)
overlay on /mnt/data type overlay (rw,relatime,lowerdir=/mnt/data,upperdir=/run/mnt-persist/mnt/data-data,workdir=/run/mnt-persist/mnt/data-work,redirect_dir=nofollow,uuid=null)
```

Observe /run/mnt-persist is mounted with tmpfs instead of ubifs and all
the overlays are still mounted.

Change-Id: I4b0251bce114ddad38706b5cd93aef31aa7e8e12
Signed-off-by: Ciaran Concannon <cjcon90@pm.me>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/30-ubiattach-or-format b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/30-ubiattach-or-format
index 1676004..20f1577 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/30-ubiattach-or-format
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/30-ubiattach-or-format
@@ -4,6 +4,21 @@
     exit 1
 fi
 
+# If "no-persist-fs" is set, only mount as a tmpfs and exit, so that we can
+# still create writable file system entries.
+if /sbin/fw_printenv -n openbmconce | grep -w -q "no-persist-fs"; then
+    echo "Mounting /run/mnt-persist as tmpfs"
+    if ! mkdir -p /run/mnt-persist ; then
+        exit 1
+    fi
+
+    if ! mount -t tmpfs tmpfs /run/mnt-persist ; then
+        exit 1
+    fi
+
+    exit
+fi
+
 if [ ! -e /run/format-persist ]; then
     if ! ubiattach -p /dev/mtd/rwfs > /dev/null ; then
         echo "unformatted-ubi" >> /run/format-persist