summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-09-22 17:21:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 09:53:18 +0100
commitafb9340fc69f1e15de3e0d267a0984f995268298 (patch)
tree8811073d2690d3b017d4fec7218a56e933ba25b8 /scripts/lib
parentd7365185fe4fe8b5699b0464f1e2b758180f74e0 (diff)
downloadpoky-afb9340fc69f1e15de3e0d267a0984f995268298.tar.gz
devtool: build-image: fix recipe/package terminology
We build recipes and include packages into the image, adjust the terminology used in code and messages accordingly. Also fix a few typos. (From OE-Core rev: 866f6e2de20b7022803e53c4de3ff341521b4db5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/devtool/build-image.py45
1 files changed, 24 insertions, 21 deletions
diff --git a/scripts/lib/devtool/build-image.py b/scripts/lib/devtool/build-image.py
index 2c014289fe..fa6f0d738a 100644
--- a/scripts/lib/devtool/build-image.py
+++ b/scripts/lib/devtool/build-image.py
@@ -25,8 +25,8 @@ from devtool import exec_build_env_command, setup_tinfoil, parse_recipe
25 25
26logger = logging.getLogger('devtool') 26logger = logging.getLogger('devtool')
27 27
28def _get_recipes(workspace, config): 28def _get_packages(workspace, config):
29 """Get list of target recipes from the workspace.""" 29 """Get list of packages from recipes in the workspace."""
30 result = [] 30 result = []
31 tinfoil = setup_tinfoil() 31 tinfoil = setup_tinfoil()
32 for recipe in workspace: 32 for recipe in workspace:
@@ -35,7 +35,7 @@ def _get_recipes(workspace, config):
35 if recipe in data.getVar('PACKAGES', True): 35 if recipe in data.getVar('PACKAGES', True):
36 result.append(recipe) 36 result.append(recipe)
37 else: 37 else:
38 logger.warning("Skipping recipe %s as it doesn't produce " 38 logger.warning("Skipping recipe %s as it doesn't produce a "
39 "package with the same name", recipe) 39 "package with the same name", recipe)
40 tinfoil.shutdown() 40 tinfoil.shutdown()
41 return result 41 return result
@@ -46,29 +46,32 @@ def build_image(args, config, basepath, workspace):
46 appendfile = os.path.join(config.workspace_path, 'appends', 46 appendfile = os.path.join(config.workspace_path, 'appends',
47 '%s.bbappend' % image) 47 '%s.bbappend' % image)
48 48
49 # remove <image>.bbapend to make sure setup_tinfoil doesn't 49 # remove <image>.bbappend to make sure setup_tinfoil doesn't
50 # breake because of it 50 # break because of it
51 if os.path.isfile(appendfile): 51 if os.path.isfile(appendfile):
52 os.unlink(appendfile) 52 os.unlink(appendfile)
53 53
54 recipes = _get_recipes(workspace, config) 54 if workspace:
55 if recipes: 55 packages = _get_packages(workspace, config)
56 with open(appendfile, 'w') as afile: 56 if packages:
57 # include selected recipes into the image 57 with open(appendfile, 'w') as afile:
58 afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(recipes)) 58 # include packages from workspace recipes into the image
59 afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(packages))
59 60
60 # Generate notification callback devtool_warn_image_extended 61 # Generate notification callback devtool_warn_image_extended
61 afile.write('do_rootfs[prefuncs] += "devtool_warn_image_extended"\n\n') 62 afile.write('do_rootfs[prefuncs] += "devtool_warn_image_extended"\n\n')
62 afile.write("python devtool_warn_image_extended() {\n") 63 afile.write("python devtool_warn_image_extended() {\n")
63 afile.write(" bb.plain('NOTE: %%s: building with additional '\n" 64 afile.write(" bb.plain('NOTE: %%s: building with additional '\n"
64 " 'packages due to \"devtool build-image\"'" 65 " 'packages due to \"devtool build-image\"'"
65 " %% d.getVar('PN', True))\n" 66 " %% d.getVar('PN', True))\n"
66 " bb.plain('NOTE: delete %%s to clear this' %% \\\n" 67 " bb.plain('NOTE: delete %%s to clear this' %% \\\n"
67 " '%s')\n" % os.path.relpath(appendfile, basepath)) 68 " '%s')\n" % os.path.relpath(appendfile, basepath))
68 afile.write("}\n") 69 afile.write("}\n")
69 70
70 logger.info('Building image %s with the following ' 71 logger.info('Building image %s with the following '
71 'additional packages: %s', image, ' '.join(recipes)) 72 'additional packages: %s', image, ' '.join(packages))
73 else:
74 logger.warning('No packages to add, building image %s unmodified', image)
72 else: 75 else:
73 logger.warning('No recipes in workspace, building image %s unmodified', image) 76 logger.warning('No recipes in workspace, building image %s unmodified', image)
74 77