* [PATCH] runqemu: take TMPDIR from bitbake
@ 2011-06-13 17:26 Anders Darander
2011-06-13 21:16 ` Scott Garman
2011-06-13 22:22 ` Yury Bushmelev
0 siblings, 2 replies; 8+ messages in thread
From: Anders Darander @ 2011-06-13 17:26 UTC (permalink / raw)
To: openembedded-core
The old standard of using /home/anders/openembedded-core/build/tmp as TMPDIR do not work any longer,
as - is appended to the real TMPDIR. Thus, always take TMPDIR from
bitbake, unless TMPDIR is set in the environment.
Signed-off-by: Anders Darander <anders@chargestorm.se>
---
scripts/runqemu | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/scripts/runqemu b/scripts/runqemu
index a09362c..aa44070 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -262,20 +262,16 @@ SPITZ_DEFAULT_ROOTFS="core-image-sato"
setup_tmpdir() {
if [ -z "$TMPDIR" ]; then
- if [ "x$BUILDDIR" = "x" -o ! -d "$BUILDDIR/tmp" ]; then
- # BUILDDIR unset, try and get TMPDIR from bitbake
- type -P bitbake &>/dev/null || {
- echo "In order for this script to dynamically infer paths";
- echo "to kernels or filesystem images, you either need";
- echo "bitbake in your PATH or to source oe-init-build-env";
- echo "before running this script" >&2;
- exit 1; }
-
- # We have bitbake in PATH, get TMPDIR from bitbake
- TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
- else
- TMPDIR=$BUILDDIR/tmp
- fi
+ # BUILDDIR unset, try and get TMPDIR from bitbake
+ type -P bitbake &>/dev/null || {
+ echo "In order for this script to dynamically infer paths";
+ echo "to kernels or filesystem images, you either need";
+ echo "bitbake in your PATH or to source oe-init-build-env";
+ echo "before running this script" >&2;
+ exit 1; }
+
+ # We have bitbake in PATH, get TMPDIR from bitbake
+ TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
fi
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-13 17:26 [PATCH] runqemu: take TMPDIR from bitbake Anders Darander
@ 2011-06-13 21:16 ` Scott Garman
2011-06-13 22:22 ` Yury Bushmelev
1 sibling, 0 replies; 8+ messages in thread
From: Scott Garman @ 2011-06-13 21:16 UTC (permalink / raw)
To: openembedded-core
On 06/13/2011 10:26 AM, Anders Darander wrote:
> The old standard of using /home/anders/openembedded-core/build/tmp as TMPDIR do not work any longer,
> as - is appended to the real TMPDIR. Thus, always take TMPDIR from
> bitbake, unless TMPDIR is set in the environment.
>
> Signed-off-by: Anders Darander<anders@chargestorm.se>
Thanks for this improvement!
Acked-by: Scott Garman <scott.a.garman@intel.com>
> ---
> scripts/runqemu | 22 +++++++++-------------
> 1 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index a09362c..aa44070 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -262,20 +262,16 @@ SPITZ_DEFAULT_ROOTFS="core-image-sato"
>
> setup_tmpdir() {
> if [ -z "$TMPDIR" ]; then
> - if [ "x$BUILDDIR" = "x" -o ! -d "$BUILDDIR/tmp" ]; then
> - # BUILDDIR unset, try and get TMPDIR from bitbake
> - type -P bitbake&>/dev/null || {
> - echo "In order for this script to dynamically infer paths";
> - echo "to kernels or filesystem images, you either need";
> - echo "bitbake in your PATH or to source oe-init-build-env";
> - echo "before running this script">&2;
> - exit 1; }
> -
> - # We have bitbake in PATH, get TMPDIR from bitbake
> - TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
> - else
> - TMPDIR=$BUILDDIR/tmp
> - fi
> + # BUILDDIR unset, try and get TMPDIR from bitbake
> + type -P bitbake&>/dev/null || {
> + echo "In order for this script to dynamically infer paths";
> + echo "to kernels or filesystem images, you either need";
> + echo "bitbake in your PATH or to source oe-init-build-env";
> + echo "before running this script">&2;
> + exit 1; }
> +
> + # We have bitbake in PATH, get TMPDIR from bitbake
> + TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
> fi
> }
>
--
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-13 17:26 [PATCH] runqemu: take TMPDIR from bitbake Anders Darander
2011-06-13 21:16 ` Scott Garman
@ 2011-06-13 22:22 ` Yury Bushmelev
2011-06-14 5:51 ` Anders Darander
1 sibling, 1 reply; 8+ messages in thread
From: Yury Bushmelev @ 2011-06-13 22:22 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
2011/6/13 Anders Darander <anders@chargestorm.se>:
> + # We have bitbake in PATH, get TMPDIR from bitbake
> + TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
This change inspired me just another crazy idea.
Getting some variable from bitbake is frequently used task. May be our
bitbake people will add some special mode to bitbake for this? E.b.
like bsd make have (make -V KERNCONF)[1].
I would suggest syntax like 'bitbake -V TMPDIR'
[1] http://www.freebsd.org/cgi/man.cgi?query=make&manpath=FreeBSD+8.2-RELEASE
--
Yury Bushmelev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-13 22:22 ` Yury Bushmelev
@ 2011-06-14 5:51 ` Anders Darander
2011-06-14 9:25 ` Yury Bushmelev
0 siblings, 1 reply; 8+ messages in thread
From: Anders Darander @ 2011-06-14 5:51 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, Jun 14, 2011 at 00:22, Yury Bushmelev <jay4mail@gmail.com> wrote:
> 2011/6/13 Anders Darander <anders@chargestorm.se>:
>> + # We have bitbake in PATH, get TMPDIR from bitbake
>> + TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
>
> This change inspired me just another crazy idea.
> Getting some variable from bitbake is frequently used task. May be our
> bitbake people will add some special mode to bitbake for this? E.b.
> like bsd make have (make -V KERNCONF)[1].
>
> I would suggest syntax like 'bitbake -V TMPDIR'
That would definitely simplify a few lines in a number of scripts.
I'll put it on my todo-list, although it is getting rather long now
(with very little time allocated for working on that list)...
Regards,
Anders
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-14 5:51 ` Anders Darander
@ 2011-06-14 9:25 ` Yury Bushmelev
2011-06-14 10:33 ` Anders Darander
0 siblings, 1 reply; 8+ messages in thread
From: Yury Bushmelev @ 2011-06-14 9:25 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
2011/6/14 Anders Darander <anders@chargestorm.se>:
> On Tue, Jun 14, 2011 at 00:22, Yury Bushmelev <jay4mail@gmail.com> wrote:
>> 2011/6/13 Anders Darander <anders@chargestorm.se>:
>>> + # We have bitbake in PATH, get TMPDIR from bitbake
>>> + TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
>>
>> This change inspired me just another crazy idea.
>> Getting some variable from bitbake is frequently used task. May be our
>> bitbake people will add some special mode to bitbake for this? E.b.
>> like bsd make have (make -V KERNCONF)[1].
>>
>> I would suggest syntax like 'bitbake -V TMPDIR'
>
> That would definitely simplify a few lines in a number of scripts.
>
> I'll put it on my todo-list, although it is getting rather long now
> (with very little time allocated for working on that list)...
Note that user may request more than one variable with single bitbake
invocation. E.g.:
bitbake -V TMPDIR -V DEPLOY_DIR
In this case better to prefix variable value with name, like set does:
TMPDIR=/path/to/tmpdir
DEPLOY_DIR=/path/to/deploydir
--
Yury Bushmelev
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-14 9:25 ` Yury Bushmelev
@ 2011-06-14 10:33 ` Anders Darander
2011-06-14 10:35 ` Phil Blundell
0 siblings, 1 reply; 8+ messages in thread
From: Anders Darander @ 2011-06-14 10:33 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, Jun 14, 2011 at 11:25, Yury Bushmelev <jay4mail@gmail.com> wrote:
> 2011/6/14 Anders Darander <anders@chargestorm.se>:
>> On Tue, Jun 14, 2011 at 00:22, Yury Bushmelev <jay4mail@gmail.com> wrote:
>>> Getting some variable from bitbake is frequently used task. May be our
>>> bitbake people will add some special mode to bitbake for this? E.b.
>>> like bsd make have (make -V KERNCONF)[1].
>>>
>>> I would suggest syntax like 'bitbake -V TMPDIR'
>>
>> That would definitely simplify a few lines in a number of scripts.
>
> Note that user may request more than one variable with single bitbake
> invocation. E.g.:
>
> bitbake -V TMPDIR -V DEPLOY_DIR
>
> In this case better to prefix variable value with name, like set does:
>
> TMPDIR=/path/to/tmpdir
> DEPLOY_DIR=/path/to/deploydir
The question is, how often do we assume that multiple variable will be
requested?
Sure, if we need multiple variables, we'll save time by only invoking
bitbake (and parse all configs, etc) once. On the other hand, have we
then gained anything, as compared to 'bitbake -e'? Sure, we'll reduce
the output, by only outputing the requested variables... But in the
original case: TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 |
cut -d '"' -f2`
the only change we can do is to substitute 'bitbake -e' with 'bitbake
-V TMDPDIR', which wouldn't be any improvement.
Or should `bitbake -V TMPDIR` only output '/path/to/tmpdir', and
`bitbake -V TMPDIR -V DEPLOY_DIR`output
TMPDIR=/path/to/tmpdir
DEPLOY_DIR=/path/to/deploydir
i.e. only prefix the variable value if more than one variable is requested?
I'd like `bitbake -V TMPDIR` to only output the value, as otherwise we
can just use `bitbake -e` anyway. If we make `bitbake -V TMPDIR` only
output the value, then the question is should we only allow a singel
'-V VARIABLE', or should we accept multiple variables, and then prefix
the values?
Regards,
Anders
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-14 10:33 ` Anders Darander
@ 2011-06-14 10:35 ` Phil Blundell
2011-06-14 11:17 ` Anders Darander
0 siblings, 1 reply; 8+ messages in thread
From: Phil Blundell @ 2011-06-14 10:35 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, 2011-06-14 at 12:33 +0200, Anders Darander wrote:
> Sure, if we need multiple variables, we'll save time by only invoking
> bitbake (and parse all configs, etc) once. On the other hand, have we
> then gained anything, as compared to 'bitbake -e'? Sure, we'll reduce
> the output, by only outputing the requested variables... But in the
> original case: TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 |
> cut -d '"' -f2`
> the only change we can do is to substitute 'bitbake -e' with 'bitbake
> -V TMDPDIR', which wouldn't be any improvement.
Well, that's not quite true. If "bitbake -V" outputted the full
assignment then you could just write:
eval `bitbake -V TMPDIR`
which would be a considerable improvement.
p.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] runqemu: take TMPDIR from bitbake
2011-06-14 10:35 ` Phil Blundell
@ 2011-06-14 11:17 ` Anders Darander
0 siblings, 0 replies; 8+ messages in thread
From: Anders Darander @ 2011-06-14 11:17 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, Jun 14, 2011 at 12:35, Phil Blundell <pb@pbcl.net> wrote:
> On Tue, 2011-06-14 at 12:33 +0200, Anders Darander wrote:
>> Sure, if we need multiple variables, we'll save time by only invoking
>> bitbake (and parse all configs, etc) once. On the other hand, have we
>> then gained anything, as compared to 'bitbake -e'? Sure, we'll reduce
>> the output, by only outputing the requested variables... But in the
>> original case: TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 |
>> cut -d '"' -f2`
>> the only change we can do is to substitute 'bitbake -e' with 'bitbake
>> -V TMDPDIR', which wouldn't be any improvement.
>
> Well, that's not quite true. If "bitbake -V" outputted the full
> assignment then you could just write:
>
> eval `bitbake -V TMPDIR`
>
> which would be a considerable improvement.
That should be correct...
I thought about something like that, but for some (unknown) reasons
throw that idea away. I believe that I for some reason got hung on the
TMPDIr=`....` syntax.
Using eval instead, all(?) problems should be gone.
Updating my todo-list. Hopefully I'll get some time soon to implement
this, as it looks pretty trivial to add this support (at least after a
quick glance at the bitbake source).
Regards,
Anders
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-06-14 11:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 17:26 [PATCH] runqemu: take TMPDIR from bitbake Anders Darander
2011-06-13 21:16 ` Scott Garman
2011-06-13 22:22 ` Yury Bushmelev
2011-06-14 5:51 ` Anders Darander
2011-06-14 9:25 ` Yury Bushmelev
2011-06-14 10:33 ` Anders Darander
2011-06-14 10:35 ` Phil Blundell
2011-06-14 11:17 ` Anders Darander
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.