From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rgbsC3znWzDql7 for ; Fri, 1 Jul 2016 09:50:55 +1000 (AEST) Received: from localhost (172.110.7.206 [172.110.7.206]) by mx.zohomail.com with SMTPS id 1467330652428228.34655050815365; Thu, 30 Jun 2016 16:50:52 -0700 (PDT) From: OpenBMC Patches 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 Message-Id: <20160630235033.17091-17-openbmc-patches@stwcx.xyz> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160630235033.17091-1-openbmc-patches@stwcx.xyz> References: <20160630235033.17091-1-openbmc-patches@stwcx.xyz> X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2016 23:50:56 -0000 From: Milton Miller 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 --- .../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