oe-chipsec.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: chipsec@lists.01.org
Subject: [PATCH 5/9] chipsec: correct location of installation
Date: Fri, 10 Mar 2017 15:36:17 -0800	[thread overview]
Message-ID: <1489188981-23886-6-git-send-email-ricardo.neri-calderon@linux.intel.com> (raw)
In-Reply-To: <1489188981-23886-1-git-send-email-ricardo.neri-calderon@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

Now chipsec relies on setuptools to install chipsec. This leads to a
bizarre issue in which the chipsec artifacts are buried under a
directory structure ${D}/${PYTHON_SITEPACKAGES_DIR}${D}/
${PYTHON_SITEPACKAGES_DIR}. Relocate the chipsec binaries to the
expected location.

Also, we use the --root option in setup.py to get rid of the CPU
architecture and the operating system sufix to the package name.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
---
 meta-luv/recipes-core/chipsec/chipsec_git.bb | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/meta-luv/recipes-core/chipsec/chipsec_git.bb b/meta-luv/recipes-core/chipsec/chipsec_git.bb
index da0f970..2f7bcb6 100644
--- a/meta-luv/recipes-core/chipsec/chipsec_git.bb
+++ b/meta-luv/recipes-core/chipsec/chipsec_git.bb
@@ -46,6 +46,9 @@ def get_target_arch(d):
 
 EXTRA_OEMAKE += "ARCH="${@get_target_arch(d)}""
 
+DISTUTILS_INSTALL_ARGS = "--root=${D}${PYTHON_SITEPACKAGES_DIR} \
+    --install-data=${D}/${datadir}"
+
 fix_mod_path() {
     sed -i -e "s:^INSTALL_MOD_PATH_PREFIX = .*:INSTALL_MOD_PATH_PREFIX = \"${PYTHON_SITEPACKAGES_DIR}\":" ${S}/source/tool/chipsec_main.py
     sed -i -e "s:PYTHONPATH:${PYTHON_SITEPACKAGES_DIR}:" ${WORKDIR}/chipsec
@@ -63,6 +66,19 @@ do_patch_append() {
 do_install_append() {
     install -d ${D}${bindir}
     install -m 0755 ${WORKDIR}/chipsec ${D}${bindir}
+
+    #
+    # FIXME: for some reason chipsec ends up installed in a repeated
+    # directory structure. Thus, we need to move it to its proper location
+    # under PYTHON_SITEPACKAGES_DIR
+    #
+
+    install -d ${D}${PYTHON_SITEPACKAGES_DIR}/${PN}
+    mv ${D}${PYTHON_SITEPACKAGES_DIR}${D}${PYTHON_SITEPACKAGES_DIR}/* ${D}${PYTHON_SITEPACKAGES_DIR}/${PN}
+    # remove old files
+    cd ${D}${PYTHON_SITEPACKAGES_DIR}
+    ls | grep -v chipsec | xargs rm -fr
+    cd $OLDPWD
 }
 
 LUV_TEST_LOG_PARSER="luv-parser-chipsec"
-- 
2.7.4


  parent reply	other threads:[~2017-03-10 23:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 23:36 [PATCH 0/9] chipsec: bump to v1.2.5+ Ricardo Neri
2017-03-10 23:36 ` [PATCH 1/9] core-image-efi-initramfs: Temporarily disable chipsec Ricardo Neri
2017-03-10 23:36 ` [PATCH 2/9] chipsec: update support for 32-bit Ricardo Neri
2017-03-10 23:36 ` [PATCH 3/9] chipsec: do not custom-build the chipsec kernel module Ricardo Neri
2017-03-10 23:36 ` [PATCH 4/9] chipsec: remove _prepend's that change directories Ricardo Neri
2017-03-10 23:36 ` Ricardo Neri [this message]
2017-03-10 23:36 ` [PATCH 6/9] chipsec: update build time and runtime dependencies Ricardo Neri
2017-03-10 23:36 ` [PATCH 7/9] chipsec: bump to v1.2.5+ Ricardo Neri
2017-03-10 23:36 ` [PATCH 8/9] chipsec: do not ship manual Ricardo Neri
2017-03-10 23:36 ` [PATCH 9/9] core-image-efi-initramfs: Re-enable chipsec Ricardo Neri

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=1489188981-23886-6-git-send-email-ricardo.neri-calderon@linux.intel.com \
    --to=ricardo.neri-calderon@linux.intel.com \
    --cc=chipsec@lists.01.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).