summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2020-08-24 23:20:04 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-09-01 22:09:42 +0300
commit1f6ac83881328c7103994c53e81f1564d7a93736 (patch)
treed42e7b31b19121f9157c9e73c11b07b38fbd27d1 /meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh
parent5f6ccd024351e485e76066bed2e9fdad5ef4e869 (diff)
downloadopenbmc-1f6ac83881328c7103994c53e81f1564d7a93736.tar.xz
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>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh')
-rw-r--r--meta-phosphor/recipes-phosphor/initrdscripts/phosphor-mmc-init/mmc-init.sh5
1 files changed, 4 insertions, 1 deletions
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 d41ddf713..061757519 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 @@ mkdir -p $rodir
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