[PATCH openbmc v2 22/34] init: Run from RAM if file system type is specified as none

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Mar 8 08:30:11 AEDT 2016


From: "Milton D. Miller II" <miltonm at us.ibm.com>

Allow file system type none for rwfst, which means do not mount a
separate file system but just use the directory in the tmpfs /run.

This will be used to allow the flash controller to not be used by
the running image, allowing flash updates while the BMC is running
the main application.

It could also be used for a file system less prone to corruption
where the read-write overlay is only updated with whitelisted files
at specific points in time with updates to the update script.

Signed-off-by: Milton Miller <miltonm at us.ibm.com>
---
 .../recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
index d4d2cc1..89e4538 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -183,12 +183,16 @@ then
 	then
 		debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)"
 	fi
-elif test "$rwfst" != jffs2
+elif test "$rwfst" != jffs2 -a "$rwfst" != none
 then
 	echo "No '$fsck' in read only fs, skipping fsck."
 fi
 
-if ! mount $rwdev $rwdir -t $rwfst -o $rwopts
+if test "$rwfst" = none
+then
+	echo "Running with read-write overlay in RAM for this boot."
+	echo "No state will be preserved unless flash update performed."
+elif ! mount $rwdev $rwdir -t $rwfst -o $rwopts
 then
 	msg="$(cat)" << HERE
 
-- 
2.7.1




More information about the openbmc mailing list