init: Allow options to be fixed at build time
If the file /init-options exists copy it to the runtime location
/run/initramfs/init-options.
This allows an initramfs image to be built that will not parse
any u-boot or command line variables by adding a file into the
the image. This can be done either through a recipe overlay or
additonal package today and could also be a cpio merged into the
initrd in the future.
Signed-off-by: Milton Miller <miltonm@us.ibm.com>
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 29c72cf..814ee07 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
@@ -117,6 +117,11 @@
optfile=/run/initramfs/init-options
update=/run/initramfs/update
+if test -e /${optfile##*/}
+then
+ cp /${optfile##*/} $optfile
+fi
+
if test ! -f $optfile
then
cat /proc/cmdline > $optfile