aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib
AgeCommit message (Collapse)Author
2016-02-15wic: fix processing of --use-uuidEd Bartosh
Processing of this option was lost during recent change of wks parsting. It was discovered during the work on booting wic images under qemu. Now, when -use-uuid is fixed it's possible to specify root partition by partition uuid. This will be done in the following commit. (From OE-Core rev: b4882e0b84d7fd4c85ee95386e94722485eafc2b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool: create: set S when we set SRC_URI from local git repoPaul Eggleton
If you specify a local directory which happens to be a git repository with an origin remote (and it is in fact remote), we can use that for SRC_URI as implemented by OE-Core revision b143d414846854dc8b3e0a47358daf5646eded38, however we also need to set S if the recipe is going to be of any use fetching from that SRC_URI later. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool: create: convert http git URLs that don't end in .git but contain ↵Paul Eggleton
/git/ When recipetool create is given a URL that starts with http(s):// and contains /git/, such as the URLs at git.yoctoproject.org, it's fairly safe to assume it's a git repository and not something that should be fetched with wget, so rewrite the URL. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool: create: ensure URL parameters don't make it into the namePaul Eggleton
When auto-detecting the name for a recipe from the URL, strip off any parameters (";name=value...") before parsing the URL, otherwise this just ends up in the recipe name which is undesirable. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11devtool: add: fix adding from a local source directoryPaul Eggleton
Fix a regression introduced in in OE-Core revision aedfc5a5db1c4b2b80a36147c9a13b31764d91dd where specifying a local source tree without specifying a name resulted in a traceback. Fixes [YOCTO #9086]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11devtool: modify: make -x the default behaviourPaul Eggleton
It's going to be more common for users not to have the prepared source tree for a recipe already, so the default behaviour ought to be to extract it for them from the recipe. Change the default to extract (effectively making the -x option a no-op) and add a --no-extract/-n option to disable it. Later we can look at trying to be smart and reusing an existing source tree instead of erroring out if it exists; for now this is just the default reversal. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool: create: determine name/version from github/bitbucket URLsPaul Eggleton
Both BitBucket and GitHub provide "release" downloads that unfortunately don't include the actual project name. For recipetool this means we have to have special handling for these URLs or else the current code assumes the name of the project is something like "v0.9.1". Borrow and adapt some code from autospec to do this, and put it in its own function for clarity. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool: create: support cmake find_library directivePaul Eggleton
CMake supports a find_library() directive to find named libraries, so detect dependencies from this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11devtool: commit for extra tasks that modify source when extractingPaul Eggleton
When extracting source for a recipe, if there are additional custom tasks run that make changes to the source, create a commit in the generated git branch so they are contained. This is particularly useful for tasks that come before do_patch since otherwise the changes might get incorporated in the first applied patch, but otherwise it helps avoid the tree being dirty at any point. Fixes [YOCTO #7626]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11recipetool.newappend: add -e/--edit argumentChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-07isoimage-isohybrid.py: fix cpio working directoryIoan-Adrian Ratiu
Take `pwd` to be <initial-dir>. The %s path is relative to it. The value of %s is "output_folder/build". The current code works as follows: Changing directory to %s and finding the sources (after cd'ing) to cpio with output redirection to %s/initrd.cpio triggers the following error "Error: exec_cmd: cd output_folder/build/INITRD && find . | cpio -o -H newc >output_folder/build/initrd.cpio returned '1' instead of 0" This happens because after the cd, `pwd` is <initial-dir>/%s and by the redirect we write the result to to <initial-dir>/%s/%s/initrd.cpio which obviously does not exist. Fix this by getting the sources with "find %s" instead of "cd && find ." Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-06scripts/devtool: Add getVarFlag expand argumentRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04wic: isoimage-isohybrid: check for syslinux-nativeMihaly Varga
.iso image creation fails if during the image creation syslinux is baked and syslinux-native is not. Added new check to verify if both syslinux and syslinux-native are baked and bake them if these are not installed. Signed-off-by: Mihaly Varga <mihaly.varga@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-04wic: default to empty bootloader configMaciej Borzecki
A kickstart file for non-x86 boards may have no 'bootloader' stanza. It is the usual case if bootloader is setup using other mechanism than through wic, and is for instance a part of u-boot configuration. In such case the 'bootloader' field in the KickStart class will be uninitialized. Instead of adding an empty bootloader line in every kickstart file call the bootloader parser with empty argument list to get defaults namespace. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-26devtool: extract: use the correct datastore for builddirMarkus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-01-26devtool: add configure-help subcommandPaul Eggleton
When you need to set EXTRA_OECONF for a recipe, you need to know what options the configure script actually supports; the configure script however is only accessible from within a devshell and (at least in the case of autotooled software fetched from an SCM repository) may not actually exist until do_configure has run. Thus, provide a "devtool configure-help" subcommand that runs the configure script for a recipe with --help and shows you the output through a pager (e.g. less), prefaced by a header describing the current options being specified. There is basic support for autotools, cmake and bare configure scripts. The cmake support is a little hacky since cmake doesn't really have a concise help option that lists user-defined knobs (without actually running through the configure process), however that being a design feature of cmake there's not much I can think of to do about that at the moment. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26devtool: properly handle bb.build.FuncFailed when extracting sourcePaul Eggleton
When we run the tasks required to extract the source for a recipe (e.g. within "devtool modify" or "devtool extract") if one of those tasks fails you get a bb.build.FuncFailed exception; handle this properly so you don't see a traceback. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26devtool: add: warn if modified recipe found in attic directoryPaul Eggleton
If a recipe generated by "devtool add" has been modified since then when you run "devtool reset", it will be moved into the "attic" subdirectory of the workspace in case those modifications need to be preserved. It seems natural that if those modifications were worth preserving we should warn the user if such a file exists when they run "devtool add" to create the same recipe again, so they can pick up where they left off if they want to. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26devtool: build-image: allow specifying packages to add to imagePaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-26devtool: move edit-recipe to a separate modulePaul Eggleton
standard.py is getting a bit large; move the "utility" commands to another module. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22recipetool: create: better fix for fetch error handlingPaul Eggleton
I was a little bit hasty in OE-Core revision c2cc5abe34169eae92067d97ce1e747e7c1413f5 - it turns out BitBake's fetcher code is not consistent in whether it logs something useful or not; when fetching from an http URL it does but with a git repository it doesn't. In advance of any major reworking of fetch error handling in BitBake, let's just print the text of the exception and then we know we have shown something to the user. Additionally, we were only catching FetchException here but there are several other classes of exception that the fetcher can raise (e.g. MalformedUrl); catch the parent BBFetchException class instead so we avoid tracebacks for those other classes as well. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22recipetool: create: fix extraction of name from URLs ending in /Paul Eggleton
If the URL ends in a / then we want to strip that off the path we split out of the URL before calling os.path.basename() on it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22recipetool: create: extract SRC_URI from local git repositoriesPaul Eggleton
If you specify a local directory which happens to be a git repository with an origin remote (and it is in fact remote), we can use that for SRC_URI rather than leaving it blank in the recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22devtool / recipetool: support specifying a subdirectory within the fetched ↵Paul Eggleton
source Sometimes you don't want to build an entire project, just a subdirectory of it; add a --src-subdir option to make that easier. (We still look for a single subdirectory in what gets unpacked, e.g. what you might find within a tarball, so whatever you specify with this option is added onto the end of that.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22recipetool: create: strip quotes from values extracted from CMakeLists.txtPaul Eggleton
Quoting is optional in CMakeLists.txt and is occasionally used, so strip out quotes if they are present. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22devtool: add sdk-install subcommandPaul Eggleton
Add the ability to install additional pre-built items (from shared state) into the extensible SDK. This can already be done implicitly by adding something to DEPENDS within a recipe you're working on and then running "devtool build", but it's useful to be able to explicitly install things particularly if you're using the extensible SDK as a traditional toolchain. Note that for this command to be useful you need to have SSTATE_MIRRORS set in your SDK configuration, and that mirror needs to be populated with sstate artifacts for recipes you wish to be able to install. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22devtool: sdk-update: improve SDK update process robustnessPaul Eggleton
Make the following improvements to the SDK update process: * Use a manifest file with sha256sums to track files other than sstate and metadata that we need to update - e.g. conf files. This allows us to handle where files such as auto.conf may or may not be present, as well as the configuration changing without affecting task signatures - we still want the config files copied in that case rather than it saying nothing needs to be done. * Write the SSTATE_MIRRORS_append to site.conf rather than local.conf so that local.conf remains static (since we don't want to trigger an update every time). Also, If there is an SSTATE_MIRRORS value already set in the configuration we can skip this and assume it contains the needed packages. * Allow the update process to be run in any directory, don't assume we're already at the base of the SDK * Where practical, fetch remote files into a temporary location and then move them to the desired location at the end, to avoid a failed update leaving the SDK in a broken state. * Update all installed do_populate_sysroot / do_packagedata tasks instead of using the SDK targets. This ensures any item installed through dependencies after installation (e.g. when running "devtool build") won't go stale. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22devtool: sdk-update: improve temp directory handlingPaul Eggleton
* Use tempfile.mkdtemp() instead of hardcoding temp dir * Set a variable early for the temp locked sigs file and use that everywhere * Delete the temp dir at the end Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22devtool: build: ensure pkgdata is written outPaul Eggleton
When you run devtool build, you need to have the pkgdata written out at the end, so that if what you're adding is a library and the next thing you add is something that depends on that library, the necessary information to map the dependency back to the recipe is present. In practical terms all this means is we need do_packagedata to run in addition to do_populate_sysroot. This does mean that do_package needs to run which wasn't running before, and that means that the few package QA tests that run within do_package such as installed-vs-shipped will now be run. This may be a bit bothersome, and prompted a fix for one of our oe-selftest tests as a result, but I don't see an easy way around it. Ultimately if you care about using the recipe in an image you'll need to fix any such errors anyway. Fixes [YOCTO #8887]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-22classes/populate_sdk_ext: add option to bring in pkgdata for worldPaul Eggleton
Add a variable SDK_INCLUDE_PKGDATA which you can set to "1" to include pkgdata for all recipes in the world target. There are a couple of uses for this: 1) If you use "devtool add" to add a recipe that builds something which depends on anything in world, the dependency can then be correctly mapped to the recipe providing it and that recipe can be added to DEPENDS, since we have the pkg-config and shared library dependency data within pkgdata. 2) You'll be able to search for these recipes and any files they package for the target with "devtool search" since that also uses pkgdata This of course assumes you've tailored world through EXCLUDE_FROM_WORLD to only include recipes you'd want built in your distro, but I think that's a reasonable assumption; failing that there is a WORLD_PKGDATA_EXCLUDE variable that you can set to exclude any recipes you don't want. Note that this patch relies on functionality implemented in a recent BitBake patch and will not work without it. Implements [YOCTO #8600]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: pylinted ksparser moduleEd Bartosh
Added missing docstrings, fixed wrong indentation and long lines. Final pylint score is 9.89/10 Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: add help for 'include' commandEd Bartosh
Added description of 'include' parser command to the 'wic help kickstart' output. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: move parts of canned .wks into common.wks.incEd Bartosh
In order to give and example of 'include' feature of ks parser and for testing purposes common parts of 3 canned wks files were moved into common.wks.inc Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: implement search of includesEd Bartosh
Used custom argument type to implement search of include .wks files in canned wks paths. Include files can be specified either by full path or by name. [YOCTO #8848] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: refactor get_boot_configEd Bartosh
This function is going to be used by ks parser to find include .wks files. get_boot_config name is a bit confusing as function is quite generic. It looks if file is present in the canned wks directories. Renamed get_boot_config -> get_canned. Renamed parameter file_boot -> file_name. Updated description. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: ksparser: add support for includeEd Bartosh
Extended parser to support inclusion of .ks files: recursively called self._parse to parse included .ks Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: do not remove build dir in source pluginsEd Bartosh
Interesting bug was found during implementation of 'include' parser command. Build directory was removed in do_configure_partition method of bootimg- source plugins. This can cause removal of previously prepared partition images if /boot partition is mentioned after other partitions in .ks file. Moved work directory removal to direct.py before processing partitions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: use unique partition numberEd Bartosh
This is a preparation for 'include' support. Used unique counter instead of line number for partitions in .ks file. Line numbers can be equal for different .ks files, which can cause problems if one .ks file is included into another. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: move wks parsing code to KickStart._parseEd Bartosh
This is a preparation for implementation of include statement. Parser will be called recursively to parse included .wks files, so it should be available as a method. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: add a couple more license checksumsPaul Eggleton
I found these when I was looking at libftdi and they seem to be generic enough to show up in at least a couple of other packages so I figure I'll add them. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: add basic support for extracting dependencies from cmakePaul Eggleton
Add support for extracting dependencies from CMakeLists.txt. There's still a bunch of things missing that are outside the scope of OE-Core and we still lack a proper extension mechanism, but this is a good start. This also adds an oe-selftest test to exercise the new code a bit. Implements [YOCTO #7635]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: force GL libraries to virtual/*Paul Eggleton
We want to specify dependencies on virtual/* rather than whatever library is selected in the current configuration. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: move dependency mapping code to RecipeHandlerPaul Eggleton
Some refactoring to allow access to the library/header/pkg-config mappings and the DEPENDS / unmapped dependency output code from other classes than AutotoolsRecipeHandler. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: fix overzealous mapping of git URLsPaul Eggleton
The regex for detecting git URLs was unanchored, leading to it matching where it shouldn't have. An example of where this went wrong was http://taglib.github.io/releases/taglib-1.9.1.tar.gz. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: support additional autoconf macros from autoconf-archivePaul Eggleton
Support a number of macros from autoconf-archive when reading configure.ac to extract dependencies. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: detect flex/bison dependencyPaul Eggleton
There are a few different macros that can be used to pick up these tools, add support for them all. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: pick up boost macros in configure.acPaul Eggleton
The presence of BOOST_REQUIRE or AX_BOOST.* indicates that boost is a dependency. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19recipetool: create: improve extraction of pkg-config / lib depsPaul Eggleton
* The regexes for PKG_CHECK_MODULES / AC_CHECK_LIB were a bit too strict and thus we were skipping some macros. * Add support for PKG_CHECK_EXISTS * Avoid duplicates in warning on missing pkg-config dependencies * Ignore dependency on musl (since this may come up if it's the selected C library) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: rename kickstarter.py -> ksparser.pyEd Bartosh
kickstarter.py was not the best name for this module as previously there was a directory with the same name in scripts/lib/wic/. All files were removed from it, but .pyc files could still stay there causing imports from wic.kickstart to fail with ImportError: cannot import name KickStart. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: override ArgumentParser.errorEd Bartosh
Overriden error method to throw exception instead of printing usage error message. Exception is caught by KickStart code to add .ks file name and line number. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>