[PATCH openbmc v2 10/34] update: Read whitelist from the /run/initramfs directory

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


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

Find the whitelist under /run/initramfs directory instead of
looking in root directory.  This results in the whitelist always
existing and being the same instance (copy) in all environments.

Currently the update script is invoked from two places: from
shutdown, where systemd bind-mounted the initramfs directory on
itself and made it root (with its parent /run mounted underneath
it in a twist), and from the initramfs init script where it
copied the files from its root directory into the /run/initramfs
directory for use at shutdown time when the original rootfs is
no longer reachable.

By looking under /run/initramfs we will always look at one copy
of the whitelist.  This will also allow future modes where the
update script can be invoked while running from a copies of
the file systems located in RAM.

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

diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index f40a546..efdd913 100755
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -63,6 +63,9 @@ doclean=
 dosave=y
 dorestore=y
 
+whitelist=/run/initramfs/whitelist
+image=/run/initramfs/image-
+
 while test "$1" != "${1#-}"
 do
 	case "$1" in
@@ -104,12 +107,11 @@ then
 		d="$save/$f"
 		mkdir -p "${d%/*}"
 		cp -rp $upper/$f "${d%/*}/"
-	done < whitelist
+	done < $whitelist
 
 	umount $rwdir
 fi
 
-image=/run/initramfs/image-
 for f in $image*
 do
 	m=$(findmtd ${f#$image})
-- 
2.7.1




More information about the openbmc mailing list