summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool
Commit message (Collapse)AuthorAgeFilesLines
* lib/devtool/standard: Fix patch cleanupRichard Purdie2015-07-081-1/+2
| | | | | | | | | | | | | | | | | | | | If patches fail to apply with git, quilt it used as a fallback. If that happens, the code in this class is meant to handle cleanup of these patch files. In the case where ${S} is a subdir of the git tree, the code doesn't correctly set the patches directory. This change correctly sets the patches directory (which is different to the location of the git repository). [YOCTO #7911] (From OE-Core master rev: de6e0f3af5e858960676ea291036e59105fd806f) (From OE-Core rev: 03dbc60c165a511894d1ae10ac1d90c1fadcc268) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix build env command execution error handlingPaul Eggleton2015-06-282-7/+24
| | | | | | | | | | | | | | | | | If we execute an external command, we ought to prepare for the possibility that it can fail and handle the failure appropriately. We can especially expect this to happen when running bitbake in this scenario. Ensure we return the appropriate exit code to the calling process. Fixes [YOCTO #7757]. (From OE-Core master rev: 98a716d79bfc5434a5b42d3ca683eab3eea30a41) (From OE-Core rev: 2791fe9236f7173e6b998cf9b40fe238566ed8ee) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: ensure git clone is standalone when extractingPaul Eggleton2015-06-281-6/+2
| | | | | | | | | | | | | | | If -x is specified and the specified URI was a git repository, we need to ensure that the resulting clone is a sandalone and not one that has pointers into the temporary fetch location or DL_DIR (since the git fetcher does a local clone with -s). Split out the code from devtool that already does this for "devtool modify -x" and reuse that. (From OE-Core master rev: fc47e8652ef32e7399f57c80593df90dc52d8b84) (From OE-Core rev: d8f151b6a385f81abead65624ba15d42cbd90e11) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: update-recipe: check if source tree is a git repositoryPaul Eggleton2015-06-281-5/+11
| | | | | | | | | | | | | If you've done "devtool add" (or "devtool modify" without -x) then it's possible that the external source tree is not a git repository, so we should handle that case here instead of printing a traceback. (From OE-Core master rev: eb2147aa8facd4ef33a0749e9ae660ec686dad48) (From OE-Core rev: c5dc3e819c1bb224e3cb667381faa5abf1888362) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: update-recipe: handle unversioned bbappendsPaul Eggleton2015-06-281-7/+7
| | | | | | | | | | | | | | Use the proper bbappend file name, don't just assume it will have a version suffix (because it won't if the original recipe doesn't). Fixes [YOCTO #7651]. (From OE-Core master rev: 3332d68ef7b2a300ce8dcf5021497d98e5b17baa) (From OE-Core rev: 3d5ea16a1f53c12d86c4e8df6af864964541cf02) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: add: use correct bbappend file name with -V optionPaul Eggleton2015-06-281-1/+1
| | | | | | | | | | | | | | | | | We weren't adding the version into the bbappend file name when -V was specified which meant that building or resetting failed. Also adjust one of the tests so that we're testing devtool add both with and without this option. Fixes [YOCTO #7647]. (From OE-Core master rev: bdbeff0cd342e31053d7203d78fc5dda611052b1) (From OE-Core rev: 0b9e8817fc8ba375a1045a66d04b3fd2b498427b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: include bbappends in recipe parsingMarkus Lehtonen2015-06-281-13/+22
| | | | | | | | | | | | | In order to get correct metadata, SRCREV for example. Fixes [YOCTO #7648]. (From OE-Core master rev: 8b1794559dd7fd956716179d628e61cffdce1686) (From OE-Core rev: becbd5d50a091fe4a980361d9c99efa01f43edcc) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: implement --no-same-dirMarkus Lehtonen2015-06-281-2/+7
| | | | | | | | | | | | | This option can be used to have a separate build directory, in order to keep the srctree directory clean for packages that do not need to be built in the source directory. (From OE-Core master rev: 5cc348c0a3016e4ccc1e80d099e2e197b3b38bd2) (From OE-Core rev: a7316a4c564901b30af740ece6631a6f68355bb4) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: use B=S if that is the default for the recipeMarkus Lehtonen2015-06-281-5/+12
| | | | | | | | | | | | | | | | | Makes the build succeed for packages which do not support separate build directory, e.g. zlib. The same outcome could be achieved with the --same-dir option, but, it's generally hard to tell if a random package would need that option. The negative side effect of this patch is that dev srctree (of some packages that build fine without this modification) gets dirtied by build artefacts. (From OE-Core master rev: 6ac5692426956e276ba2119f917b0f30791e6cd6) (From OE-Core rev: 97078c56e8b8a235e923d964253775e20112a36f) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: call parse_recipe with correct argumentsMarkus Lehtonen2015-06-281-2/+3
| | | | | | | | | | | | | | Give the correct data object ("config data" instead of "recipe data") as an argument to oe.recipeutils.patch_recipe() Fixes [YOCTO #7595] (From OE-Core master rev: 7d2b918019b0afe215a6489dad697afac34f73e9) (From OE-Core rev: f8427fe565e44e46246146bdaae66a5d83ae8c9d) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: force use of bash when running build within extensible SDKPaul Eggleton2015-05-151-0/+5
| | | | | | | | | | | | | | | | | | | | | Ubuntu's default dash shell causes oe-init-build-env to behave a bit differently - (a) it can't pick up the OE root directory and (b) it can't see any build directory specified as a command-line argument (since dash doesn't pass through any arguments specified to sourced scripts). We could work around these but doing so requires some internal knowledge of the script; a much simpler fix is just to force running the command under bash since it's expected to be installed on every distro. Thanks to Chen Qi <Qi.Chen@windriver.com> for this fix. Fixes [YOCTO #7614]. (From OE-Core rev: 27942f546e6b08cdf9f2dbda2e24d237cde7f5f5) (From OE-Core rev: f83f108f83766d4c141946084b7c4be730c2865e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: add dry-run optionPaul Eggleton2015-03-201-0/+16
| | | | | | | | | | | | Add a dry-run option to the deploy-target and undeploy-target subcommands so you can see the list of files to be deployed or un-deployed before actually carrying out the operation. (From OE-Core rev: b9625581f3fe72fc402632be2d87cf889301c6a2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: add an option to disable quiet modePaul Eggleton2015-03-201-3/+12
| | | | | | | | | | | | | | The -q option to scp does stop the progress being shown, which is mostly superfluous, however it also stops errors from ssh being shown - if there's a problem, you'll just get "lost connection" which really isn't that helpful. As a compromise, add a -s/--show-status option and advertise this when the command fails. (From OE-Core rev: 5cbb026212b4c8f5206a07d70b94f57edeee0839) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: detect and error if D is emptyPaul Eggleton2015-03-201-2/+6
| | | | | | | | | | | If you haven't built the recipe yet or if the output directory (${D}) is empty, then we should tell the user rather than have scp error out. (From OE-Core rev: 3fd9ac277393bef5c646f16b9d8f30c277881d70) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: allow disabling host key checkingPaul Eggleton2015-03-201-4/+13
| | | | | | | | | | | | | | | | | | | | | | If you're testing with multiple images/devices that have the same IP address / hostname then it can be annoying to deal with host key mismatches all of the time. As a MITM attack is unlikely in the local test environment, provide a command line option to pass the appropriate options to scp/ssh to disable the host key checking. Note: if you wish to apply this permanently, the best way is to do it through your ssh configuration e.g. by adding the following to your ~/.ssh/config: Host 192.168.7.2 UserKnownHostsFile=/dev/null StrictHostKeyChecking no (From OE-Core rev: 81dd1319112a99bc38b7a7ced0663918ac5b09a4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify/extract: prevent usage with incompatible recipesPaul Eggleton2015-03-201-13/+35
| | | | | | | | | | | | Consolidate code for checking compatible recipes and consider meta and packagegroup recipes as well as package-index and gcc-source to be incompatible. (From OE-Core rev: 4be9bf637583b341a89af1b9924752abc7d49c94) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: get correct initial revision from previously extracted ↵Paul Eggleton2015-03-201-2/+13
| | | | | | | | | | | | | | | source tree If you point devtool modify to a source tree previously created by devtool modify or devtool extract, then we need to try to pick up the correct initial revision so that devtool update-recipe knows where to start looking for commits that match up with patches in the recipe. (From OE-Core rev: c20e10543e268ebb43074a3f8d6e7ed991e54ec8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: reset: add ability to reset entire workspacePaul Eggleton2015-03-201-19/+33
| | | | | | | | | | | Add a -a/--all option to allow you to quickly reset all recipes in your workspace. (From OE-Core rev: 0c83788b111a761f6f500b86780cc51aed255402) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: name command line parsers appropriatelyPaul Eggleton2015-03-201-22/+22
| | | | | | | | | | No functional changes, just use a unique name for each parser. (From OE-Core rev: 5fabc59d6221c3fe7137b70e31ec2761a4276a6c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: fix deploying to previously deployed machinePaul Eggleton2015-03-201-1/+3
| | | | | | | | | | | * Pass correct arguments to undeploy() function * If an error occurs during undeploy(), exit instead of continuing (From OE-Core rev: c938dee4b28af7e6296c86347dfa533f85605033) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix broken clones of git recipesPaul Eggleton2015-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | Because we move the workdir when extracting source, then move the source and delete the temporary workdir, you lose the indirection symlink pointed to by the alternates file (which is created when the fetcher clones it from DL_DIR with -s) and the resulting repository is broken. In any case, for a source repo that the user may put their own changes into, we can't really rely on a clone made with -s in case the original goes away - because of cleanall, DL_DIR disappearing, etc. So repack the repository so that it is a complete, non-shared clone after unpacking. (While I'm at it, add a test for devtool modify with a git recipe which verifies that this works.) (From OE-Core rev: dccdde4321c48a571677995a4e1dfc583e899cbe) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: support source extraction for recipes that use a shared workdirPaul Eggleton2015-02-231-5/+14
| | | | | | | | | | Enable source extraction used by devtool extract / devtool modify -x for recipes that use a shared workdir (e.g. the kernel and gcc). (From OE-Core rev: 73a5bdc7921791b954ca717293e76c7e3091a19e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: modify: handle recipes that use a shared workdirPaul Eggleton2015-02-231-4/+6
| | | | | | | | | | | If S is outside of WORKDIR then we shouldn't try to get the relative path in order to work out where the source subdirectory is as we do by default. (From OE-Core rev: 7392ecd559ef71241405c704a65da171ee216ca1) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: prevent extract/modify use with image recipesPaul Eggleton2015-02-231-0/+8
| | | | | | | | | | There wouldn't be any point to using these with an image recipe, so disallow it. (From OE-Core rev: 611c27182a6e52e159a1ce1b5bac054405c611d2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: update-recipe: add handling for git recipesPaul Eggleton2015-02-231-86/+144
| | | | | | | | | | | | | When updating git-based recipes, in a lot of cases what you want is to push the changes to the repository and update SRCREV rather than to apply patches within the recipe. Updating SRCREV is now the default behaviour for recipes that fetch from git, but this can be overridden in both directions using a new -m/--mode option. (From OE-Core rev: 654792bb87610ee3569d02a85fa9ec071bf8ab6d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: build: run do_populate_sysroot instead of do_installPaul Eggleton2015-02-231-2/+3
| | | | | | | | | | | | If you want to be able to make use of libraries in conjunction with devtool then we need to install them into the sysroot for other recipes to use. Make it a configuration option in case it needs to be changed at runtime. (From OE-Core rev: 94f517ad8e55edfbe6f06afd963bcfeb849626ff) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: reset: run bitbake -c clean on recipePaul Eggleton2015-02-231-0/+6
| | | | | | | | | | | If you've added a new recipe, you want the output cleaned when you do devtool reset, otherwise cruft from building the recipe may remain which could interfere with future builds. (From OE-Core rev: 664d1a7fe8f8288fabc582d00f6e36ab29496ec5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: add/modify: add option to build in same directoryPaul Eggleton2015-02-231-2/+9
| | | | | | | | | | | The default behaviour is to build in a separate directory to the source, however some projects can't be built this way, so add an option to do that (or override the automatic behaviour in the case of modify). (From OE-Core rev: cf094ed2f616a581eb07d78db4366c83a441fde5) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: improve command-line helpPaul Eggleton2015-02-081-3/+10
| | | | | | | | | | Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com> (From OE-Core rev: ec3378f3a7013e289daa0f5c52329488b861f99c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/devtool: Support deploy/undeploy functionJunchun Guan2014-12-231-0/+100
| | | | | | | | | | | | | | | | Deploy recipe output files to live target machine using scp Store the files list and target machine info in localhost if deployment is done Undeploy recipe output files in target machine using the previous deployment info [YOCTO #6654] (From OE-Core rev: cc10751aa3121218b21ec2058358f3ea02a4500a) Signed-off-by: Junchun Guan <junchunx.guan@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/devtool: add development helper toolPaul Eggleton2014-12-232-0/+623
Provides an easy means to work on developing applications and system components with the build system. For example to "modify" the source for an existing recipe: $ devtool modify -x pango /home/projects/pango Parsing recipes..done. NOTE: Fetching pango... NOTE: Unpacking... NOTE: Patching... NOTE: Source tree extracted to /home/projects/pango NOTE: Recipe pango now set up to build from /home/paul/projects/pango The pango source is now extracted to /home/paul/projects/pango, managed in git, with each patch as a commit, and a bbappend is created in the workspace layer to use the source in /home/paul/projects/pango when building. Additionally, you can add a new piece of software: $ devtool add pv /home/projects/pv NOTE: Recipe /path/to/workspace/recipes/pv/pv.bb has been automatically created; further editing may be required to make it fully functional The latter uses recipetool to create a skeleton recipe and again sets up a bbappend to use the source in /home/projects/pv when building. Having done a "devtool modify", can also write any changes to the external git repository back as patches next to the recipe: $ devtool update-recipe mdadm Parsing recipes..done. NOTE: Removing patch mdadm-3.2.2_fix_for_x32.patch NOTE: Removing patch gcc-4.9.patch NOTE: Updating recipe mdadm_3.3.1.bb [YOCTO #6561] [YOCTO #6653] [YOCTO #6656] (From OE-Core rev: 716d9b1f304a12bab61b15e3ce526977c055f074) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
OpenPOWER on IntegriCloud