summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/build-image.py
Commit message (Collapse)AuthorAgeFilesLines
* devtool: build-image: rename modulePaul Eggleton2016-03-071-119/+0
| | | | | | | | | | Hyphens aren't allowed in python identifiers, so you shouldn't use them in module names or they are more difficult to import. (From OE-Core rev: e8f6db9436dfc923e236f2cbc08f357e3b24fd5d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: categorise and order subcommands in help outputPaul Eggleton2016-02-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The listing of subcommands in the --help output for devtool was starting to get difficult to follow, with commands appearing in no particular order (due to some being in separate modules and the order of those modules being parsed). Logically grouping the subcommands as well as being able to exercise some control over the order of the subcommands and groups would help, if we do so without losing the dynamic nature of the list (i.e. that it comes from the plugins). Argparse provides no built-in way to handle this and really, really makes it a pain to add, but with some subclassing and hacking it's now possible, and can be extended by any plugin as desired. To put a subcommand into a group, all you need to do is specify a group= parameter in the call to subparsers.add_parser(). you can also specify an order= parameter to make the subcommand sort higher or lower in the list (higher order numbers appear first, so use negative numbers to force items to the end if that's what you want). To add a new group, use subparsers.add_subparser_group(), supplying the name, description and optionally an order number for the group itself (again, higher numbers appear first). (From OE-Core rev: e1b9d31e6ea3c254ecfe940fe795af44761e0e69) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: allow specifying packages to add to imagePaul Eggleton2016-01-261-2/+9
| | | | | | | | | | | | | | | | Provide an option to devtool build-image to specify the list of packages instead of taking the list of packages produced by recipes in the workspace. Sometimes you don't want all of these packages; other times you want to add more. This is the most immediate fix for [YOCTO #8855], though it is a little crude so I would like to provide better means of customising the image contents later. (From OE-Core rev: b3a44951a74fe58714b72e71a7a558b67a71e1e3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: second fix for running from a different directoryMarkus Lehtonen2015-09-241-1/+1
| | | | | | | | | | | | | | | | | | Do not change change current working directory permanently, but, only for the duration of tinfoil initialization instead. The previous fix caused very unintuitive behavior where using relative paths were solved with respect to the builddir instead of the current working directory. E.g. calling "devtool extract zlib ./zlib" would always create create srctree in ${TOPDIR}/zlib, independent of the users cwd. (From OE-Core rev: 4c7f159b0e17a0475a4a4e9dc4dd012e3d2e6a1f) (From OE-Core rev: 05060699e63cd25d089e83e9aa56c11d5baa8fd8) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: delete bbappend at end of buildPaul Eggleton2015-09-231-30/+23
| | | | | | | | | | | | | | | Upon further reflection, it seems to me that this bbappend ought to just be deleted at the end of the build. This keeps things simple; you never have to remember to delete any files to get back to where you were before with the image. This means we can also drop the slightly awkward message reminding the user how to do that. I've also updated the test to look at the image manifest to determine if the command has worked instead of looking for the (now deleted) bbappend. (From OE-Core rev: f6b90bceaedf9bad3d111e6ca1fa79e59f472c73) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: improve image recipe handlingPaul Eggleton2015-09-231-3/+23
| | | | | | | | | | | * Make image optional for the extensible SDK (auto-determine it based on the targets the SDK was built for) * Check that specified recipe is in fact an image (From OE-Core rev: 8884875aacfedc69cc72898684e391e69fea00ba) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: tell user where to find output filesPaul Eggleton2015-09-231-5/+9
| | | | | | | | | | | If the user is running "devtool build-image" within the extensible SDK then they probably won't know where to find the resulting output files, so we should tell them explicitly. (From OE-Core rev: 9baf9fd7a53142a98c7f1cd49c7b001760af51f9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: fix recipe/package terminologyPaul Eggleton2015-09-231-21/+24
| | | | | | | | | | 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>
* devtool: make plugin_init optionalEd Bartosh2015-09-121-4/+0
| | | | | | | | | | | | | | | So far all devtool and recipetool plugins were expected to have plugin_init function. This function is empty in most of plugins as they don't require initialisation. Making plugin_init optional would allow not having empty plugin_init in every plugin. (From OE-Core rev: b99640c89f067866b264f4ee4030fae4c2f338c0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: add commentsEd Bartosh2015-08-311-0/+2
| | | | | | | | | Added couple of hopefully useful comments to the code. (From OE-Core rev: 72dfe5b58c637d74971e025aef3ce0a64dc8172c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: remove <image>.bbappendEd Bartosh2015-08-311-0/+5
| | | | | | | | | | | | Removed <image>.bbappend before generating it again as it may cause tinfoil to fail due to its wrong content. It's safe to do as <image>.bbappend is regenerated anyway. (From OE-Core rev: 82c6452ca953eb32e2919d9f9e64497a15212be5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: add extra loggingEd Bartosh2015-08-311-0/+6
| | | | | | | | | | Added logger calls to show if image is modified by the plugin or not. (From OE-Core rev: f719e956a6263784963b6ae9514030a1a1dc2aeb) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: generate notification callbackEd Bartosh2015-08-311-0/+9
| | | | | | | | | | Added notification callback to <image>.bbapend to notify user that image is modified by build-image plugin. (From OE-Core rev: 53cb00b8af58c326e2a045cd6f8a04a24dc4c1b5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: filter out recipesEd Bartosh2015-08-311-4/+21
| | | | | | | | | | | | | Filtered out non-target recipes and recipes with recipe name != package name in build-image plugin. Isolated all logic of getting recipes in _get_recipes function. (From OE-Core rev: efe685711ae6f4beec06ba591c74140ce56b96af) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: improve help and descriptionEd Bartosh2015-08-311-4/+6
| | | | | | | | | | Made parser help message and description more clear in build-image plugin. (From OE-Core rev: 39714557dde70c4b1ce8d08c7e1d21fd39a1d1a6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: rename LOG -> loggerEd Bartosh2015-08-311-2/+2
| | | | | | | | | | | | Used logger variable name instead of LOG as it is used the rest of the devtool code. Pylint complains about 'logger' being invalid constant name, but it's better to be consistent in naming. (From OE-Core rev: a1c811df93e831a198464008564ce33ec98a3049) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build-image: stop using add_md5Ed Bartosh2015-08-311-3/+1
| | | | | | | | | | | It doesn't make sense to use it as image recipe is not in workspace. It means that we can't do 'devtool reset' for the recipe, which is a main point of using add_md5. (From OE-Core rev: f69613ed9d56c6e6ba322d8c9db07b7ed802042a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: implement build-image pluginEd Bartosh2015-08-301-0/+56
Implemented new plugin to build image from workspace packages. Plugin creates <image>.bbappend file, adds all workspace packages to the image using IMAGE_INSTALL_append variable in bbappend file. After that it runs 'bitbake <image>'. (From OE-Core rev: 00bc43868da3ea2a4532215d3abef8e150c7b2e5) (From OE-Core rev: fc35c10fed382e385f00b76abcee94a0148b4aee) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>