aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib
AgeCommit message (Collapse)Author
2015-09-23devtool: upgrade: use shutil.move instead of os.renameMarkus Lehtonen
Rename fails over filesystem boundaries. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23devtool: runqemu: avoid recipe parsePaul Eggleton
We only need the base configuration to get the variable values we want to get here, there's no need to parse recipes / load the cache. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23devtool: second fix for running from a different directoryMarkus Lehtonen
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) 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>
2015-09-22devtool: add search commandPaul Eggleton
Adds a subcommand to search to find the target recipe name providing some file or capability. This is implemented by searching on recipe name, package name, description, package contents (file names), and runtime file provides. For example: $ devtool search libGL mesa $ devtool search X11 xextproto libxxf86vm xf86driproto xf86vidmodeproto libxfixes xproto libx11 ... $ devtool search /bin/sed busybox sed This is particularly useful within the extensible SDK but is also made available in devtool alongside the build system. Note of course that because this searches pkgdata, useful results depend upon do_packagedata(_setscene) having executed for the recipe being searched for. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: add basic means of running runqemu within the extensible SDKPaul Eggleton
We ship the runqemu script and if we build QEMU itself within the extensible SDK, then it would be nice to be able to run it. This is a very thin wrapper around runqemu, supplying the machine and image name so the user doesn't need to. (This subcommand is only available within the extensible SDK since it only really makes sense there where it is otherwise hard to run runqemu directly.) Implements [YOCTO #6657]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool / recipetool: add handling for binary-only packagesPaul Eggleton
Add a means of creating recipes for package files or archives that contain a directory structure to be installed verbatim, for example an rpm file. (We mostly just re-use bin_package here and skip some of the normal build system checks.) This support is available in "recipetool create" and "devtool add" which wraps the former. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: build-image: delete bbappend at end of buildPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: build-image: improve image recipe handlingPaul Eggleton
* 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 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: build-image: tell user where to find output filesPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: build-image: fix recipe/package terminologyPaul Eggleton
We build recipes and include packages into the image, adjust the terminology used in code and messages accordingly. Also fix a few typos. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: add: move important "recipe created" message to the endPaul Eggleton
If we end up printing a message about the build directory being the same as the source, we should print that first and then print the message about the recipe file possibly needing to be edited to the end so that it has slightly more impact. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: add: set up fetched source as a git repository by defaultPaul Eggleton
If the fetched source isn't already a git repository, initialise it as one and then branch and tag, just as we do with "devtool modify". This makes it easier to make changes, commit them and then use the "devtool update-recipe" command to turn those commits into patches on the recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: better handling for recipes that don't unpack sourcePaul Eggleton
Some recipes don't extract any source (for example, opkg-keyrings). We were producing a traceback in this case because we weren't checking if the directory existed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: fix extracting source for work-shared recipesPaul Eggleton
Recipes that use work-shared (such as libgcc) are capable of unpacking the source, but it doesn't necessarily unpack to ${WORKDIR}/${BP}. Use the last part of the actual S value instead which is more likely to work. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: show proper error when extracting source for recipes with disabled ↵Paul Eggleton
unpack task If you try to use "devtool modify -x" or "devtool extract" on a recipe where do_unpack has been set as noexec (e.g. glibc-locale), then we get an error because the expected source wasn't ever unpacked. Do a check up front for noexec being set on do_unpack and error out with a reasonable message if that's the case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22recipetool: create: fix handling of URIs containing #Paul Eggleton
The # character in a URI denotes a fragment; we don't care about this since it is never supposed to be sent to the server, so remove it from the URI before actually trying to fetch it or use it in SRC_URI within the recipe. (This has come up because download links on pypi.python.org seem to have a fragment containing the md5sum of the download; without stripping this off the fetcher will choke on it.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22recipetool: create: fix creating empty shell functionsPaul Eggleton
The shell considers empty functions to be a syntax error, so for template shell functions that contain only comments (or no lines at all) then add a : to act as a no-op which avoids the syntax error. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: add: properly handle separate build directoryPaul Eggleton
When we were adding a recipe for software that would typically be built in the same directory as the source, we were always using a separate build directory unless the user explicitly specified not to, leading to errors for software that doesn't expect to be built that way (such as Python modules using distutils). Split out the code that makes this determination automatically from the "devtool modify" and "devtool upgrade" code and re-use that here so the behaviour is consistent. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool / lib/oe/recipeutils: ensure we can parse without bbappendsPaul Eggleton
These functions ostensibly allowed parsing a recipe without bbappends but this clearly hadn't been tested because a variable was unassigned in both of them in that case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: add: ensure --color=never turns off recipetool colour outputPaul Eggleton
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: check that source tree still existsPaul Eggleton
Sometimes, particularly if you extracted the source to /tmp which is on tmpfs, the external source tree that is being pointed to may no longer exist when you come to run "devtool build" or "devtool update-recipe" etc. Make all of the commands that need to check for a recipe being in the workspace call a single function and have that function additionally check the source tree still exists where appropriate. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22classes/populate_sdk_ext: drop work-config.incPaul Eggleton
This is not actually used for anything - I thought that we would need to use it within devtool to set global configuration, but we're able to do everything we need within the bbappends it creates, which also saves on parse time. If we're not going to use work-config.inc let's just drop it completely. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-21wic: fix partition size calculationEd Bartosh
It was wrongly assumed that part.size is meagured in Mb. In fact it's in Kb, so there is no need to convert bitbake variable ROOTFS_SIZE as it's also in Kb. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-09-16recipetool: add 'newappend' sub-commandChristopher Larson
This sub-command creates a bbappend for the specified target and prints the path to the bbappend. The -w argument, as with some of the other recipetool commands, will make a version-independent bbappend. Example usage: recipetool newappend meta-mylayer virtual/kernel [YOCTO #7964] Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12devtool: update-recipe: get srcuri parameters with decodeurl()Markus Lehtonen
Use already existing bb.fetch.decodeurl() for getting the parameters for a URI. This is more fault tolerant and maintainable. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12devtool: make plugin_init optionalEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-09devtool: add package plugin that lets you create package via devtoolBrendan Le Foll
Enables creating packages using devtool within the extensible SDK. (This is only enabled within the extensible SDK because it provides no advantage over just running bitbake directly there). Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: update-recipe: add a warning when recipe is inside the workspacePaul Eggleton
If a recipe has been added to the workspace via "devtool add" or "devtool upgrade" then the recipe file itself will be in the workspace layer; if you run "devtool update-recipe" particularly in the upgrade case you might think it would apply the upgrade to the original recipe, but it will not - in order to remain consistent it has to update the recipe that's in use which is the one in the workspace. Warn the user in this situation so that they know what they need to do when they are finished. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: update-recipe: better 'auto' modeMarkus Lehtonen
Enhance the logic behind the 'auto' mode a bit by only updating the SRCREV if the changes are already found upstream. The logic is simple: update SRCREV only if the current local HEAD commit is found in the remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to patching. This affects a couple of the oe-selftest tests so update those as well. [YOCTO #7907] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: Allow disabling make parallelism on build commandLeonardo Sandoval
Through -s/--disable-parallel-make, the user can turn off parallelism on the make tool. This can be useful when debuging race condition issues. In order to set PARALLEL_MAKE = "" a post-config file created and then passed into the build. [YOCTO #7589] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: Create a single file for the build devtool featureLeonardo Sandoval
The intention is to have a single file for each devtool feature so devtool can grow in a modular way. In this direction, this patch creates build.py, moving all related build features from standard.py to build.py. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: add upgrade featureLeonardo Sandoval
Upgrades a recipe to a particular version and downloads the source code into a folder. User can avoid patching the source code. These are the general steps of the upgrade function: - Extract current recipe source code into srctree and create a branch - Extract upgrade recipe source code into srctree and rebase with previous branch. In case the rebase is not correctly applied, source code will not be deleted, so user correct the patches - Creates the new recipe under the workspace [YOCTO #7642] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: improve modified file preservation to handle directory structuresPaul Eggleton
Allow the _add_md5() function to be called with a directory in order to recursively add the files under it. Additionally, we need to skip preserving empty directories (since directories aren't listed in the md5 file). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09scriptutils: split out simple fetching function from recipetoolPaul Eggleton
This will now also be used by "devtool upgrade". Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: modify: enable do_shared_workdir for kernelMarkus Lehtonen
Do not put 'do_shared_workdir' into SRCTREECOVEREDTASKS when creating bbappend for kernel packages. This will allow building packages that depend on the shared build artifacts of kernel. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09wic: round variable before converting to intEd Bartosh
Wic uses bitbake variable ROOTFS_SIZE to set correspondent partition size. This variable is a literal representing float value. Wic crashes trying to convert it to int with the error: invalid literal for int() with base 10: '10166.0' Fixed this by converting variable to float and rounding result. This should work for int and float literals. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07devtool: add mechanism for updating extensible SDKQi.Chen@windriver.com
Enable updating the installed extensible SDK from a local or remote server, avoiding the need to install it again from scratch when updating. (This assumes that the updated SDK has been built and then published somewhere using the oe-publish-sdk script beforehand.) This plugin is only enabled when devtool is used within the extensible SDK since it doesn't make sense to use it next to a normal install of the build system. E.g. devtool sdk-update /mnt/sdk-repo/ devtool sdk-update http://mysdkhost/sdk Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03devtool: run kernel dependenciesMarkus Lehtonen
The kernel package needs "kern-tools-native" in order for it's do_kernel_metadata. Thus, devtool extract for kernel in a pristine environment fails. With the current bb.tinfoil implementation it is not possible to run arbitrary bitbake commands - e.g. run "bitbake kern-tools-native -c populate_sysroot" in our case. This patch implements an ugly workaround for that problem, basically by hardcoding this dependency and running the required bitbake task(s) before tinfoil is initialized. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: extract: correct initial rev for kernel packagesMarkus Lehtonen
Change handling of kernel packages so that the "initial rev" is parsed correctly. Also, the devtool-specific git tags (devtool-base and devtoo-patched) are now generated for kernel packages as well. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: make required tasks be run in kernel buildMarkus Lehtonen
Set SRCTREECOVEREDTASKS appropriately in the workspace .bbappend file for kernel recipes. This tries to ensure that all needed tasks (esp. configure and patch) are run when building the kernel - tasks which would normally be disabled by externalsrc.bbclass. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-02wic: fix short variable namesEd Bartosh
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: get rid of listing propertiesEd Bartosh
Functionality of listing and using properties of wic images does not exist in the wic code. However, there are plenty of help and usage content about it, which is very confusing. Removed everything regarding image properties from wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning redefined-builtinEd Bartosh
Renamed variables named as Python builtin functions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning unused-variableEd Bartosh
Removed or reworked code with unused variables. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning no-memberEd Bartosh
Fixed pylint warning: Instance of 'ConfigMgr' has no 'create' member (no-member) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: use optparse instead of cmdlnEd Bartosh
cmdln.py https://pypi.python.org/pypi/cmdln was used in creator.py to parse image plugin options and arguments. There is no need in such a sofisticated API to do this simple task. Standard option parser optparse.OptionParser can do it just fine. Modified Creator class to work with option parser. Removed cmdln.py from the wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning multiple-statementsEd Bartosh
Fixed pylint warning: More than one statement on a single line (multiple-statements) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: get rid of wildcard importsEd Bartosh
Used explicit imports in partitions.py and wicboot.py Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix errors in partition.py moduleEd Bartosh
Fixed the followring errors found by pylint in partition.py: E: 42, 0: class already defined line 33 (function-redefined) E:429,63: Undefined variable 'fs' (undefined-variable) E:432,37: Undefined variable 'fs' (undefined-variable) E:481, 0: class already defined line 33 (function-redefined) E:488,22: Undefined variable 'OptionValueError' (undefined-variable) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: remove micboot.pyEd Bartosh
Moved functionaly of micboot.py Mic_Bootloader class to Wic_Bootloader class of wicboot.py module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>