From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 3/3] devtool: run kernel dependencies
Date: Thu, 27 Aug 2015 17:24:39 +0300 [thread overview]
Message-ID: <D204F72E.57941%markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <1610283.bR69gNP3St@peggleto-mobl.ger.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2465 bytes --]
Hi,
On 27/08/15 15:45, "Paul Eggleton" <paul.eggleton@linux.intel.com> wrote:
>Hi Markus,
>
>On Thursday 27 August 2015 14:49:50 Markus Lehtonen wrote:
>> The kernel package needs "kern-tools-native" in order for it's
>> do_kernel_metadata. Thus, devtool extract for kernel in a pristine
>> environment fails. With the current bb.tinfoil implementation it is not
>> possible to run arbitrary bitbake commands - e.g. run
>> "bitbake kern-tools-native -c populate_sysroot" in our case. This patch
>> implements an ugly workaround for that problem, basically by hardcoding
>> this dependency and running the required bitbake task(s) before tinfoil
>> is initialized.
>>
>> [YOCTO #6658]
>>
>> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
>> ---
>> scripts/lib/devtool/standard.py | 19 ++++++++++++++++++-
>> 1 file changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/lib/devtool/standard.py
>> b/scripts/lib/devtool/standard.py index 3725d87..bf24e32 100644
>> --- a/scripts/lib/devtool/standard.py
>> +++ b/scripts/lib/devtool/standard.py
>> @@ -197,6 +197,8 @@ def extract(args, config, basepath, workspace):
>> """Entry point for the devtool 'extract' subcommand"""
>> import bb
>>
>> + _check_extract_deps(config, basepath, args.recipename)
>> +
>> tinfoil = setup_tinfoil()
>>
>> rd = _parse_recipe(config, tinfoil, args.recipename, True)
>> @@ -237,6 +239,20 @@ class BbTaskExecutor(object):
>> self.executed.append(func)
>>
>>
>> +def _check_extract_deps(config, basepath, recipename):
>> + """HACK: Ugly workaround for making sure that requirements are met
>>when
>> + trying to extract a package"""
>> + tinfoil = setup_tinfoil()
>> + rd = _parse_recipe(config, tinfoil, recipename, True)
>> + if bb.data.inherits_class('kernel-yocto', rd):
>> + tinfoil.shutdown()
>
>Hmm, surely you need to call shutdown() in the non-kernel case as well?
>Otherwise won't the lock still be in place when this function returns and
>then
>setup_tinfoil() is called a second time?
Argh, I was a bit too hasty with this one. You can find a new version of
this patch attached as well as in the git repository at:
git://git.openembedded.org/openembedded-core-contrib
marquiz/devtool/kernel
http://git.openembedded.org/openembedded-core-contrib/log/?h=marquiz/devtoo
l/kernel
Thanks,
Markus
[-- Attachment #2: 0001-devtool-run-kernel-dependencies.patch --]
[-- Type: application/octet-stream, Size: 2957 bytes --]
From c15e4c9f17cd0bf6bfcc7c18a5f034d360d670ac Mon Sep 17 00:00:00 2001
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Date: Wed, 26 Aug 2015 17:13:46 +0300
Subject: [PATCH] devtool: run kernel dependencies
The kernel package needs "kern-tools-native" in order for it's
do_kernel_metadata. Thus, devtool extract for kernel in a pristine
environment fails. With the current bb.tinfoil implementation it is not
possible to run arbitrary bitbake commands - e.g. run
"bitbake kern-tools-native -c populate_sysroot" in our case. This patch
implements an ugly workaround for that problem, basically by hardcoding
this dependency and running the required bitbake task(s) before tinfoil
is initialized.
[YOCTO #6658]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
scripts/lib/devtool/standard.py | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 3725d87..7456fc8 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -197,7 +197,7 @@ def extract(args, config, basepath, workspace):
"""Entry point for the devtool 'extract' subcommand"""
import bb
- tinfoil = setup_tinfoil()
+ tinfoil = _prep_extract_operation(config, basepath, args.recipename)
rd = _parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
@@ -237,6 +237,24 @@ class BbTaskExecutor(object):
self.executed.append(func)
+def _prep_extract_operation(config, basepath, recipename):
+ """HACK: Ugly workaround for making sure that requirements are met when
+ trying to extract a package. Returns the tinfoil instance to be used."""
+ tinfoil = setup_tinfoil()
+ rd = _parse_recipe(config, tinfoil, recipename, True)
+
+ if bb.data.inherits_class('kernel-yocto', rd):
+ tinfoil.shutdown()
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath,
+ 'bitbake kern-tools-native')
+ tinfoil = setup_tinfoil()
+ except bb.process.ExecutionError as err:
+ raise DevtoolError("Failed to build kern-tools-native:\n%s" %
+ err.stdout)
+ return tinfoil
+
+
def _extract_source(srctree, keep_temp, devbranch, d):
"""Extract sources of a recipe"""
import bb.event
@@ -422,8 +440,10 @@ def modify(args, config, basepath, workspace):
raise DevtoolError("directory %s does not exist or not a directory "
"(specify -x to extract source from recipe)" %
args.srctree)
-
- tinfoil = setup_tinfoil()
+ if args.extract:
+ tinfoil = _prep_extract_operation(config, basepath, args.recipename)
+ else:
+ tinfoil = setup_tinfoil()
rd = _parse_recipe(config, tinfoil, args.recipename, True)
if not rd:
--
2.1.4
prev parent reply other threads:[~2015-08-27 14:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 11:49 [PATCH 0/3] devtool: improvements to kernel support Markus Lehtonen
2015-08-27 11:49 ` [PATCH 1/3] devtool: make required tasks be run in kernel build Markus Lehtonen
2015-08-27 11:49 ` [PATCH 2/3] devtool: extract: correct initial rev for kernel packages Markus Lehtonen
2015-08-27 11:49 ` [PATCH 3/3] devtool: run kernel dependencies Markus Lehtonen
2015-08-27 12:45 ` Paul Eggleton
2015-08-27 14:24 ` Markus Lehtonen [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=D204F72E.57941%markus.lehtonen@linux.intel.com \
--to=markus.lehtonen@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/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