mirror of
https://git.yoctoproject.org/poky
synced 2026-07-16 03:47:03 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
673343414f
commit
aa470a1fcd
@@ -60,29 +60,6 @@ def verify_build_env():
|
||||
return True
|
||||
|
||||
|
||||
def find_artifacts(image_name):
|
||||
"""
|
||||
Gather the build artifacts for the current image (the image_name
|
||||
e.g. core-image-minimal) for the current MACHINE set in local.conf
|
||||
"""
|
||||
bitbake_env_lines = misc.get_bitbake_env_lines()
|
||||
|
||||
rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = ""
|
||||
|
||||
for line in bitbake_env_lines.split('\n'):
|
||||
if misc.get_line_val(line, "IMAGE_ROOTFS"):
|
||||
rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS")
|
||||
continue
|
||||
if misc.get_line_val(line, "DEPLOY_DIR_IMAGE"):
|
||||
kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE")
|
||||
continue
|
||||
if misc.get_line_val(line, "STAGING_DIR_NATIVE"):
|
||||
native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE")
|
||||
continue
|
||||
|
||||
return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot)
|
||||
|
||||
|
||||
CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts
|
||||
SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
|
||||
|
||||
|
||||
Reference in New Issue
Block a user