[PATCH openbmc v2 28/34] init: Add option to copy files into memory

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


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

Add an option to copy files from the rwfs to ram then run in ram.

This allows customizations like user ids and network settings to
be initialized from the read-write filesystem.

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

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 b4d1569..9aa2131 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
@@ -169,6 +169,21 @@ then
 	rwfst=none
 fi
 
+copyfiles=
+if grep -w copy-files-to-ram $optfile
+then
+	rwfst=none
+	copyfiles=y
+fi
+
+# It would be nice to do this after fsck but that mean rofs is mounted
+# which triggers the mtd is mounted check
+if test "$rwfst$copyfiles" = noney
+then
+	touch $trigger
+	$update --copy-files --clean-saved-files --no-restore-files
+fi
+
 if grep -w copy-base-filesystem-to-ram $optfile &&
 	test ! -e /run/image-rofs && ! cp $rodev /run/image-rofs
 then
-- 
2.7.1




More information about the openbmc mailing list