summaryrefslogtreecommitdiffstats
path: root/scripts/lib
AgeCommit message (Collapse)Author
2015-04-08wic: code cleanup: unused importsEd Bartosh
Fixed pylint warning 'Unused import' Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20recipetool: fix duplicate licenses being picked upPaul Eggleton
If a license file matched more than one of the specifications (e.g. COPYING.GPL) then it was being added to LIC_FILES_CHKSUM more than once. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: deploy-target: add dry-run optionPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: deploy-target: add an option to disable quiet modePaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: deploy-target: detect and error if D is emptyPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: deploy-target: allow disabling host key checkingPaul Eggleton
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 Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: modify/extract: prevent usage with incompatible recipesPaul Eggleton
Consolidate code for checking compatible recipes and consider meta and packagegroup recipes as well as package-index and gcc-source to be incompatible. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: modify: get correct initial revision from previously extracted ↵Paul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: reset: add ability to reset entire workspacePaul Eggleton
Add a -a/--all option to allow you to quickly reset all recipes in your workspace. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: name command line parsers appropriatelyPaul Eggleton
No functional changes, just use a unique name for each parser. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20devtool: deploy-target: fix deploying to previously deployed machinePaul Eggleton
* Pass correct arguments to undeploy() function * If an error occurs during undeploy(), exit instead of continuing Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-20wic: Consider PSEUDO_* environment variablesEd Bartosh
Used default values of PSEUDO_* environment variables only if variables are not set. This allows to set custom PSEUDO_PREFIX and other pseudo variables in order to use pseudo database from non-standard locations. Change-Id: I0bc1af5e521121d1f96d590cb6edb23cf0cb0b83 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-09wic: rawcopy: support skippingAlexandre Belloni
Add support for skipping the beginning of a file with the rawcopy plugin. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-09wic: add fsimage pluginAlexandre Belloni
The fsimage plugin allows to add an already existing filesystem image in the partition layout. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-03-09wic: fix fstab generationAlexandre Belloni
Commit 0a6668f6e60b4195ff4163c00fc972bacdb27b4b still included some debug and is not working properly as the new fstab is generated too late. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-23devtool: fix broken clones of git recipesPaul Eggleton
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.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: support source extraction for recipes that use a shared workdirPaul Eggleton
Enable source extraction used by devtool extract / devtool modify -x for recipes that use a shared workdir (e.g. the kernel and gcc). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: modify: handle recipes that use a shared workdirPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: prevent extract/modify use with image recipesPaul Eggleton
There wouldn't be any point to using these with an image recipe, so disallow it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: update-recipe: add handling for git recipesPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: build: run do_populate_sysroot instead of do_installPaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: reset: run bitbake -c clean on recipePaul Eggleton
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23devtool: add/modify: add option to build in same directoryPaul Eggleton
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). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23recipetool: fix regression caused by previous commitPaul Eggleton
Option was renamed in the setup code but not in the code that used it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21wic: Fix kernel dir locationTom Zanussi
With the recent kernel staging changes, STAGING_KERNEL_DIR no longer points to the kernel image, which can be found however in DEPLOY_DIR_IMAGE. This updates find_artifacts() to look there instead. Fixes [YOCTO #7307]. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: add GPT supportAlexandre Belloni
Add GPT partition table support. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: properly label filesystemsAlexandre Belloni
Use the partition label option, when available, to label the filesystem. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: fix empty btrfs partitionsAlexandre Belloni
btrfs emtpy partition creation is currently not working because of the usage of the non existant variables rootfs ans extra_imagecmd. It also as an incorrect size. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: remove useless calls to __write_fstabAlexandre Belloni
__write_fstab() is already iterating over parts. There is now need to call it fort each parts. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure overhead factor per partitionAlexandre Belloni
Introduce a new option --overhead-factor to replace IMAGE_OVERHEAD_FACTOR. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure extra space per partitionAlexandre Belloni
Introduce a new option --extra-space instead of using IMAGE_EXTRA_SPACE. This is useful for boot partitions where the extra space is often useless or for huge partition where 10MiB may not be enough. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: add rawcopy source pluginAlexandre Belloni
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow creation of partitions not in tableAlexandre Belloni
For some architectures it is necessary to reserve space on disk without it being present in the partition table. For example, u-boot on i.mx is placed at an offset of 1kB on the sdcard. While it would be possible to create a partition at that offset and place u-boot there, it would then be necessary to update the default u-boot environment to use partition 2 on the mmc instead of partition 1. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07recipetool: improve command-line helpPaul Eggleton
Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07devtool: improve command-line helpPaul Eggleton
Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: bootimg-partition: Stop removing whole workdirAlexandre Belloni
Stop removing the whole working directory as this is also removing eventual previously created partition images, leading to image creation failures. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: print partition alignment when availableAlexandre Belloni
When printing a partition, the --align parameter was shown when present but not its value. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: use kB for the partitions sizeAlexandre Belloni
Use kB instead of MB for the partition size to get a better granularity. This is needed on some SoC (i.mx, omap) where it is necessary to create partitions as small as 64kB. Keep the backward compatibility by assuming MB when no unit is provided. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: bail out on kickstart parse errorsMaciej Borzecki
Kickstart file errors are not emitted by the parser. In case errors, the current code will continue to execute possibly creating a faulty or incomplete image. The patch enables the parser to emit all encountered errors. The error message is shown for the user and further execution is ceased. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-07wic: fix extended/logical partition layoutMaciej Borzecki
The patch fixes an issue in laying out extended and logical partitions by wic. The original code produced disk images in which the size 3rd partition as described in MBR was incorrect. Depending on the type of file system used for that partition and size of the partition, it would be impossible to mount the partition correctly. For instance, kickstart file in which the 3rd partition had size of 1GB and used ext4 fs, would result in an image with an umountable partition. The root cause is reservation of sectors for EBR through stealing of last sector from the last primary partition. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-03recipetool: replace version in S valuePaul Eggleton
If a versioned recipe filename is specified, replace the version in the value of S with ${PV} just as we do with SRC_URI to make future upgrades of the recipe easier. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-23recipetool: add python dependency scanning supportChristopher Larson
This uses a standalone python script named `pythondeps` which now lives in scripts. It supports scanning for provided packages and imported modules/packages, the latter via the python ast. It's not perfect, and obviously conditional imports and try/except import blocks are handled naively, listing all the imports even if they aren't all used at once, but it gives the user a solid starting point for the recipe. Currently `python_dir` from setup.py isn't being handled in an ideal way. This is easily seen when testing the python-async package. There, the root of the project is the async package, so the root has __init__.py and friends, and the python provides scanning currently just assumes the basedir of that dir is the package name in this case, which is not correct. Forthcoming patches will resolve this. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-01-23recipetool: add python buildsystem supportChristopher Larson
- Handles distutils & setuptools. - Supports pulling metadata from PKG-INFO, .egg-info, & setup.py (via two different mechanisms). - Doesn't handle python 3 yet. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-24wic: account for mmcblk device partition namingMaciej Borzecki
MMC block device partitions are named differently than other block devices and use the scheme: mmcblk<devnum>p<partnum>, ex: mmcblk0p1, mmcblk0p2. The current code generates incorrect parition names missing 'p' infix for fstab entries. The patch resolves this problem. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21scripts/devtool: Support deploy/undeploy functionJunchun Guan
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] 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>
2014-12-21scripts/devtool: add development helper toolPaul Eggleton
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] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21scripts: add scriptutils modulePaul Eggleton
Add a utility module for scripts. This is intended to provide functions only really useful before bitbake has been found (or only of particular interest to scripts). At the moment this includes functions for setting up a logger and for loading plugins. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21scripts/recipetool: Add a recipe auto-creation scriptPaul Eggleton
Add a more maintainable and flexible script for creating at least the skeleton of a recipe based on an examination of the source tree. Commands can be added and the creation process can be extended through plugins. [YOCTO #6406] Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19wic: add globbing support in IMAGE_BOOT_FILES entriesMaciej Borzecki
Adding glob support for entries in IMAGE_BOOT_FILES. Files picked up by glob are by default installed under their basename, as this is likely most common use case. Target name for globbed entries specifies the name of directory in which files will be installed withing the partition. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-19wic: IMAGE_BOOT_FILES format checks in bootimg-partition sourceMaciej Borzecki
Check for malformed entries in IMAGE_BOOT_FILES, fail early if such entries were found. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>