* Re: [wic][PATCH] wic: try to find bitbake using find_executable API
[not found] <55311968.50404@balister.org>
@ 2015-04-20 12:31 ` Philip Balister
2015-04-20 16:59 ` Ed Bartosh
0 siblings, 1 reply; 3+ messages in thread
From: Philip Balister @ 2015-04-20 12:31 UTC (permalink / raw)
To: openembedded-core
I forgot to cc the list. Unfortunately, this led to the commit going in
with the reference to oe-classic.
Please people, get your terminology correct. The word soup in the wold
is insane.
Philip
-------- Forwarded Message --------
Subject: Re: [OE-core] [wic][PATCH] wic: try to find bitbake using
find_executable API
Date: Fri, 17 Apr 2015 10:32:08 -0400
From: Philip Balister <philip@balister.org>
To: Ed Bartosh <ed.bartosh@linux.intel.com>
On 04/17/2015 09:19 AM, Ed Bartosh wrote:
> From: Ed Bartosh <eduard.bartosh@intel.com>
>
> Current wic code was assuming that bitbake directory is on the
> same level as scripts, which is not the case for oe classic.
oe classic is the ancient meta-data.
I think you mean the assumption for people who do not install bitbake
inside an openembedded-core checkout.
Philip
>
> Using find_executable bitbake location should be determined better
> as this API uss $PATH to search for executables.
>
> Fixes [YOCTO #7621]
>
> Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
> ---
> scripts/wic | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/wic b/scripts/wic
> index 5bedd90..7d388c9 100755
> --- a/scripts/wic
> +++ b/scripts/wic
> @@ -36,19 +36,25 @@ import os
> import sys
> import optparse
> import logging
> +from distutils import spawn
>
> # External modules
> scripts_path = os.path.abspath(os.path.dirname(__file__))
> lib_path = scripts_path + '/lib'
> -bitbake_path = os.path.join(scripts_path, '../bitbake/lib')
> -sys.path = sys.path + [lib_path, bitbake_path]
> +sys.path.append(lib_path)
> +
> +bitbake_exe = spawn.find_executable('bitbake')
> +if bitbake_exe:
> + bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib')
> + sys.path.append(bitbake_path)
> + from bb import cookerdata
> + from bb.main import bitbake_main, BitBakeConfigParameters
> +else:
> + bitbake_main = None
>
> from image.help import *
> from image.engine import *
>
> -from bb import cookerdata
> -from bb.main import bitbake_main, BitBakeConfigParameters
> -
> def rootfs_dir_to_args(krootfs_dir):
> """
> Get a rootfs_dir dict and serialize to string
> @@ -109,6 +115,10 @@ def wic_create_subcommand(args, usage_str):
> parser.print_help()
> sys.exit(1)
>
> + if options.build_rootfs and not bitbake_main:
> + logging.error("Can't build roofs as bitbake is not in the $PATH")
> + sys.exit(1)
> +
> if not options.image_name and not (options.rootfs_dir and
> options.bootimg_dir and
> options.kernel_dir and
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [wic][PATCH] wic: try to find bitbake using find_executable API
2015-04-20 12:31 ` [wic][PATCH] wic: try to find bitbake using find_executable API Philip Balister
@ 2015-04-20 16:59 ` Ed Bartosh
0 siblings, 0 replies; 3+ messages in thread
From: Ed Bartosh @ 2015-04-20 16:59 UTC (permalink / raw)
To: Philip Balister; +Cc: openembedded-core
On Mon, Apr 20, 2015 at 08:31:05AM -0400, Philip Balister wrote:
> I forgot to cc the list. Unfortunately, this led to the commit going in
> with the reference to oe-classic.
>
> Please people, get your terminology correct. The word soup in the wold
> is insane.
>
My bad. I've received your e-mail, but didn't have time to send the fix during weekend.
Today I've noticed that my patch was already merged.
--
Regards,
Ed
^ permalink raw reply [flat|nested] 3+ messages in thread
* [wic][PATCH] wic: try to find bitbake using find_executable API
@ 2015-04-17 13:19 Ed Bartosh
0 siblings, 0 replies; 3+ messages in thread
From: Ed Bartosh @ 2015-04-17 13:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Ed Bartosh
From: Ed Bartosh <eduard.bartosh@intel.com>
Current wic code was assuming that bitbake directory is on the
same level as scripts, which is not the case for oe classic.
Using find_executable bitbake location should be determined better
as this API uss $PATH to search for executables.
Fixes [YOCTO #7621]
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/wic | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/scripts/wic b/scripts/wic
index 5bedd90..7d388c9 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -36,19 +36,25 @@ import os
import sys
import optparse
import logging
+from distutils import spawn
# External modules
scripts_path = os.path.abspath(os.path.dirname(__file__))
lib_path = scripts_path + '/lib'
-bitbake_path = os.path.join(scripts_path, '../bitbake/lib')
-sys.path = sys.path + [lib_path, bitbake_path]
+sys.path.append(lib_path)
+
+bitbake_exe = spawn.find_executable('bitbake')
+if bitbake_exe:
+ bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib')
+ sys.path.append(bitbake_path)
+ from bb import cookerdata
+ from bb.main import bitbake_main, BitBakeConfigParameters
+else:
+ bitbake_main = None
from image.help import *
from image.engine import *
-from bb import cookerdata
-from bb.main import bitbake_main, BitBakeConfigParameters
-
def rootfs_dir_to_args(krootfs_dir):
"""
Get a rootfs_dir dict and serialize to string
@@ -109,6 +115,10 @@ def wic_create_subcommand(args, usage_str):
parser.print_help()
sys.exit(1)
+ if options.build_rootfs and not bitbake_main:
+ logging.error("Can't build roofs as bitbake is not in the $PATH")
+ sys.exit(1)
+
if not options.image_name and not (options.rootfs_dir and
options.bootimg_dir and
options.kernel_dir and
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-20 16:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <55311968.50404@balister.org>
2015-04-20 12:31 ` [wic][PATCH] wic: try to find bitbake using find_executable API Philip Balister
2015-04-20 16:59 ` Ed Bartosh
2015-04-17 13:19 Ed Bartosh
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.