diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-06-26 21:27:31 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-02 23:08:36 +0100 |
| commit | aa470a1fcd09abbc570d3d885aff460603ef9925 (patch) | |
| tree | f04cc1fe57fa3a1310ce8c7cab3cd213d5b7c6a1 /scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | |
| parent | 673343414f4c9db32e3e0c58f07c59954bab734c (diff) | |
| download | poky-aa470a1fcd09abbc570d3d885aff460603ef9925.tar.gz | |
wic: Refactor getting bitbake variables
Wic gets bitbake variables by parsing output of 'bitbake -e' command.
This implementation improves this procedure as it runs 'bitbake -e' only
when API is called and does it only once, i.e. in a "lazy" way. As parsing
results are cached 'bitbake -e' is run only once and results are parsed
only once per requested set of variables.
get_bitbake_var became the only API call. It replaces find_artifacts,
find_artifact, find_bitbake_env_lines, get_bitbake_env_lines,
set_bitbake_env_lines and get_line_val calls making API much more clear.
(From OE-Core rev: 3abe23bd217315246ec2d98dc9c390b85cfe6a92)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py')
| -rw-r--r-- | scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py index 533eaa7bd1..76e7b033fb 100644 --- a/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py +++ b/scripts/lib/wic/plugins/source/rootfs_pcbios_ext.py | |||
| @@ -59,11 +59,7 @@ class RootfsPlugin(SourcePlugin): | |||
| 59 | if os.path.isdir(rootfs_dir): | 59 | if os.path.isdir(rootfs_dir): |
| 60 | return rootfs_dir | 60 | return rootfs_dir |
| 61 | 61 | ||
| 62 | bitbake_env_lines = misc.find_bitbake_env_lines(rootfs_dir) | 62 | image_rootfs_dir = misc.get_bitbake_var("IMAGE_ROOTFS", rootfs_dir) |
| 63 | if not bitbake_env_lines: | ||
| 64 | msger.error("Couldn't get bitbake environment, exiting.") | ||
| 65 | |||
| 66 | image_rootfs_dir = misc.find_artifact(bitbake_env_lines, "IMAGE_ROOTFS") | ||
| 67 | if not os.path.isdir(image_rootfs_dir): | 63 | if not os.path.isdir(image_rootfs_dir): |
| 68 | msg = "No valid artifact IMAGE_ROOTFS from image named" | 64 | msg = "No valid artifact IMAGE_ROOTFS from image named" |
| 69 | msg += " %s has been found at %s, exiting.\n" % \ | 65 | msg += " %s has been found at %s, exiting.\n" % \ |
