mmc-init: Run fsck.ext4 on the rwfs device

It's a good practice to run fsck before mounting a device. Call
fsck.ext4 -p on the read-write device, this option attempts to
fix any error that can be fixed safely without user intervention.
No need to check for the return code, if it fails then the mount
command will likely fail.

It also takes no time to run:

mount read-only -> fsck read-write -> mount read-write:

[    4.174115] EXT4-fs (mmcblk0p4): mounted filesystem with ordered data mode. Opts: (null)
rwfs: clean, 11/917504 files, 81919/1835008 blocks
[    4.185143] EXT4-fs (mmcblk0p6): mounted filesystem with ordered data mode. Opts: (null)

(From meta-phosphor rev: c3d695892ef990f70cb851b5613dee68068471b3)

Change-Id: I946791233a06da0c8ee16585d92f64039a845879
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
index d41ddf7..0617575 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
@@ -48,7 +48,10 @@
 if ! mount /dev/disk/by-partlabel/"$(get_root)" $rodir -t ext4 -o ro; then
     /bin/sh
 fi
-if ! mount /dev/disk/by-partlabel/rwfs $rodir/var -t ext4 -o rw; then
+
+rwfsdev="/dev/disk/by-partlabel/rwfs"
+fsck.ext4 -p "${rwfsdev}"
+if ! mount "${rwfsdev}" $rodir/var -t ext4 -o rw; then
     /bin/sh
 fi