All of lore.kernel.org
 help / color / mirror / Atom feed
From: OpenBMC Patches <openbmc-patches@stwcx.xyz>
To: openbmc@lists.ozlabs.org
Subject: [PATCH openbmc 16/16] initfs: Store whiltelist in a directory of files
Date: Thu, 30 Jun 2016 18:50:33 -0500	[thread overview]
Message-ID: <20160630235033.17091-17-openbmc-patches@stwcx.xyz> (raw)
In-Reply-To: <20160630235033.17091-1-openbmc-patches@stwcx.xyz>

From: Milton Miller <miltonm@us.ibm.com>

Change the whiltelist definition to be files in a directory instead
of a single file.  This will allow us to store which files should
be saved in individual recipes and also supports comments in the
whitelist.

The actual split into separate files is deferred for prototyping
what assistance classes should look like to make the whitelist
(eg systemd service files); also the packages will need to be
added to the package list for the initramfs image.

Signed-off-by: Milton Miller <miltonm@us.ibm.com>
---
 .../common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh | 2 +-
 .../recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh      | 6 ++++--
 .../recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-initfs.bb   | 5 +++--
 3 files changed, 8 insertions(+), 5 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 70af93d..1f54d39 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
@@ -18,7 +18,7 @@ fi
 
 mkdir -p $rodir $rwdir
 
-cp -rp init shutdown update whitelist bin sbin usr lib etc var run/initramfs
+cp -rp init shutdown update whitelist.d bin sbin usr lib etc var run/initramfs
 
 # To start a interactive shell with job control at this point, run
 # getty 38400 ttyS4
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 f0c41a7..b061e26 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
@@ -100,7 +100,7 @@ toram=
 checksize=y
 checkmount=y
 
-whitelist=/run/initramfs/whitelist
+whitelist=/run/initramfs/whitelist.d/
 image=/run/initramfs/image-
 imglist=
 
@@ -191,7 +191,9 @@ then
 		done
 		mkdir -p "${d%/*}"
 		cp -rp "$upper/$f" "${d%/*}/"
-	done < $whitelist
+	done << HERE
+$(grep -v ^# $whitelist*)
+HERE
 
 	if test -n "$mounted"
 	then
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-initfs.bb b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-initfs.bb
index f81e21d..70b6686 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-initfs.bb
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/obmc-phosphor-initfs.bb
@@ -21,10 +21,11 @@ do_install() {
         install -m 0755 ${WORKDIR}/obmc-init.sh ${D}/init
         install -m 0755 ${WORKDIR}/obmc-shutdown.sh ${D}/shutdown
         install -m 0755 ${WORKDIR}/obmc-update.sh ${D}/update
-        install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist
+        install -d ${D}/whitelist.d
+        install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist.d/whitelist
         install -d ${D}/dev
         mknod -m 622 ${D}/dev/console c 5 1
 }
 
-FILES_${PN} += " /init /shutdown /update /whitelist /dev "
+FILES_${PN} += " /init /shutdown /update /whitelist.d/whitelist /dev "
 FILES_${PN} += " /init-options /init-download-url "
-- 
2.9.0

      parent reply	other threads:[~2016-06-30 23:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 23:50 [PATCH openbmc 00/16] Update flash update to be useable at runtime for v1.0-stable OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 01/16] image_types_uboot: Don't truncate when assembling flash OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 02/16] initfs: Fix recipe, remove unnecessary class OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 03/16] initfs: shutdown: comment on update success OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 04/16] initfs: update: Don't exec sh or sulogin on error just exit 1 OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 05/16] initfs: update: Do not cause an error if no files were saved OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 06/16] initfs: update: Consistently add ERROR: and print to stderr OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 07/16] initfs: update: add option to perform checks but skip actual update OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 08/16] initfs: update: check individual mtd partitions for mounts OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 09/16] initfs: update: add check for image size vs mtd size OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 10/16] initfs: update: add --help message OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 11/16] initfs: init: add file for base options OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 12/16] image-types_uboot: Package a self contained netboot image OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 13/16] initfs: update: handle no images to update OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 14/16] initfs: update: Sanitize whitelist directory entries OpenBMC Patches
2016-06-30 23:50 ` [PATCH openbmc 15/16] initfs: whitelist: Sanitize obmc events whitelist entry OpenBMC Patches
2016-06-30 23:50 ` OpenBMC Patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160630235033.17091-17-openbmc-patches@stwcx.xyz \
    --to=openbmc-patches@stwcx.xyz \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.