All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
To: <openembedded-core@lists.openembedded.org>
Cc: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Subject: [PATCH 2/3] devtool modify: Create a copy of kernel source
Date: Tue, 4 Dec 2018 16:37:06 -0800	[thread overview]
Message-ID: <1543970227-15416-3-git-send-email-chandana.kalluri@xilinx.com> (raw)
In-Reply-To: <1543970227-15416-1-git-send-email-chandana.kalluri@xilinx.com>

If kernel source is not already downloaded i.e staging kernel dir is
empty, place a copy of the source when the user runs devtool modify linux-yocto.
This way the kernel source is available for other packages that use it.

[YOCTO #10416]

Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
---
 scripts/lib/devtool/standard.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 3a8222a..06a0619 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -567,7 +567,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
         with open(preservestampfile, 'w') as f:
             f.write(d.getVar('STAMP'))
         try:
-            if bb.data.inherits_class('kernel-yocto', d):
+            if is_kernel_yocto:
                 # We need to generate the kernel config
                 task = 'do_configure'
             else:
@@ -594,6 +594,14 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
             raise DevtoolError('Something went wrong with source extraction - the devtool-source class was not active or did not function correctly:\n%s' % str(e))
         srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir'))
 
+        # Check if work-shared is empty, if yes 
+        # find source and copy to work-shared
+        if is_kernel_yocto:
+              workshareddir = d.getVar('STAGING_KERNEL_DIR')
+              if os.path.exists(workshareddir) and not os.listdir(workshareddir):
+                   os.rmdir(workshareddir)
+                   copy_src_to_ws(srcsubdir,workshareddir)
+
         tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
         srctree_localdir = os.path.join(srctree, 'oe-local-files')
 
-- 
2.7.4



  parent reply	other threads:[~2018-12-05 12:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05  0:37 [PATCH 0/3] Devtool: provide easy means of reconfiguring the kernel Sai Hari Chandana Kalluri
2018-12-05  0:37 ` [PATCH 1/3] devtool modify: Update devtool modify to copy source from work-shared if its already downloaded Sai Hari Chandana Kalluri
2018-12-06 14:23   ` Mittal, Anuj
2018-12-05  0:37 ` Sai Hari Chandana Kalluri [this message]
2018-12-05  0:37 ` [PATCH 3/3] devtool: provide support for devtool menuconfig command Sai Hari Chandana Kalluri
2018-12-05 12:33 ` ✗ patchtest: failure for Devtool: provide easy means of reconfiguring the kernel (rev2) Patchwork

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=1543970227-15416-3-git-send-email-chandana.kalluri@xilinx.com \
    --to=chandana.kalluri@xilinx.com \
    --cc=openembedded-core@lists.openembedded.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.