summaryrefslogtreecommitdiffstats
path: root/scripts/lib
AgeCommit message (Collapse)Author
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>
2014-11-12scripts: use '/usr/bin/env' in shebangs with pythonMartin Hundebøll
To support yocto on systems with python3 as default version, scripts should use /usr/bin/env python in the shebang, as this allows the use of a fake env to mimic python2 as default version. This patch simply replaces occurrences of #!/usr/bin/python with #!/usr/bin/env python and was done with this oneliner: git grep -lE '^#!/usr/bin/python' | xargs \ sed -i 's|/usr/bin/python|/usr/bin/env python|' Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Update bootimg-partition to use bootimg_dirTom Zanussi
Update bootimg-partition to use bootimg_dir instead of img_deploy_dir, to match similar usage in other plugins. As mentioned elsewhere, plugins should use the passed-in value for bootimg_dir directly if non-null, which corresponds to a user-assigned value specified via a -b command-line param, and only fetch the value from bitbake if that value is null. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Remove special-case bootimg_dirTom Zanussi
The first iterations of wic very shortsightedly catered to two specific use-cases and added special-purpose params for those cases so that they could be directly given their corresponding boot artifacts. (hdddir and staging_data_dir). As more use-cases are added, it becomes rather obvious that such a scheme doens't scale, and additionally causes confusion for plugin writers. This removes those special cases and states explicitly in the help text that plugins are responsible for locating their own boot artifacts. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30Revert "wic: set bootimg_dir when using image-name artifacts"Tom Zanussi
This reverts commit 7ce1dc13f91df70e8a2f420e7c3eba51cbc4bd48. This patch broke the assumption that a non-null boot_dir means a user-assigned (-b command-line param) value. Reverting doesn't break anything, since the case it was added for doesn't use the boot_dir for anything except debugging anyhow. Fixes [YOCTO #6290] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Update the help text to include -D (--debug)Tom Zanussi
The --debug option is missing from the wic help text; this adds it and at the same time rearranges the usage into a more logical arrangement. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Use overhead factor when creating partitions from rootfs directoriesTom Zanussi
When creating partitions sized to given rootfs directories, filesystem creation could fail in cases where the calculated target partition size was too small to contain the filesystem created using mkfs. This occurred in particular when creating partitions to contain very large filesystems such as those containing sdk image artifacts. This same limition is present in the oe-core image creation classes, which can be readily see by changing IMAGE_OVERHEAD_FACTOR from the default 1.3 to 1.0 and building a sato-sdk image. It should be possible to calculate required sizes exactly given the source rootfs and target filesystem types, but for now, to address the specific problem users are hitting in such situations, we'll just do exactly what oe-core does and define and use an IMAGE_OVERHEAD_FACTOR or 1.3 in those cases. Fixes [YOCTO #6863]. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Don't allow mkfs to fail silently in partition commandTom Zanussi
The return code from the mkfs command used by the partition creation command was being ignored, allowing it to silently fail and leaving users mystified as to why the resulting filesystem was corrupted. This became obvious when failures occurred when creating large e.g. sdk filesystems [YOCTO #6863]. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18wic/bootimg-pcbios.py: checking the existance of syslinuxHongxu Jia
While syslinux not existed in $bootimg_dir, there was a error: $ wic create directdisk -e core-image-minimal ... |Creating image(s)... |Error: exec_cmd: install -m 444 /home/jiahongxu/yocto/ build-20141010-yocto/tmp/deploy/images/qemux86-64/syslinux/ ldlinux.sys /var/tmp/wic/build/hdd/boot/ldlinux.sys returned '1' instead of 0 ... Add checking for the existance of syslinux to fix this issue. If syslinux didn't exist in anywhere, prompt user to build it. [YOCTO #6826] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-09-23wic: add sdimage-bootpart kickstart fileMaciej Borzecki
Add kickstart for generating a SD card image that should cover most use case scenarios. The layout is as follows: - 16MB vfat partition that IMAGE_BOOT_FILES will be copied to, 4k alignment - ext4 rootfs, 4k alignment 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-09-23wic: add new bootimg-partition pluginMaciej Borzecki
This patch implements 'bootimg-partition source plugin class for 'wic'. The plugin creates an image of boot partition, copying over files listed in IMAGE_BOOT_FILES bitbake variable. 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-09-23wic: set bootimg_dir when using image-name artifactsMaciej Borzecki
Running wic with -e to use artifacts from a named image, bootimg_dir was always passed as empty string to partition source plugins. The patch sets bootimg_dir to current value of DEPLOY_DIR_IMAGE, as bootloader artifacts end up in that location as well. 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-09-23wic: fix vfat partition sector count only if neededMaciej Borzecki
VFAT rootfs partitions sector count would get updated always even if there is no need. Since parition size in wic is expressed in MB, any sub MB change will cause the generated partition image to be larger than allocated space within the disk image. Fortunately, partitions sized in MB will most of the time have a proper sector count. 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-09-23wic: use IMAGE_EXTRA_SPACE for vfat rootfsMaciej Borzecki
Functions for generating rootfs use IMAGE_EXTRA_SPACE rather than BOOTDD_EXTRA_SPACE. The latter is used in boot image source plugins. 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-09-23wic: minor comment updateMaciej Borzecki
Update comment about types of generated partition images. 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-09-10wic: Completely remove all urlgrabber referencesTom Zanussi
The previous commit, 'wic: Remove 3rdparty/urlgrabber' didn't actually remove all references to urlgrabber - this does however. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23wic: do not realign aligned partitionsMaciej Borzecki
The change prevents additional realignment of already aligned partition. Previously, even already aligned partitions would be pushed forward by the amount of --align. 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-08-23wic: do not steal sectors from the first partitionMaciej Borzecki
In order to make up for space loss due to overhead located before the first partition, same amount of bytes was extracted from the first partition's size. This leads to unexpected change of first partition's size, and is not matched by similar adjustment at the time the partition image is generated. Thus it is possible that the first partition may partially overwrite contents of the following partition, as the partition image is larger than the allocated space. This is also problematic on certain platforms such as OMAP, where the first partition is required for have an even number of sectors (typically already expressed by --size in kickstart file). Subtracting an odd number of sectors lost for overhead, leads to an odd number of sectors assigned for partition, preventing the board, such as beaglebone, from booting correctly. 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-08-15wic: include partition label in fs image file nameMaciej Borzecki
Not including the label image but having multiple partitions of the same type, the image file of one partition would overwrite the other. 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-08-15wic: Add mkgummidisk kickstart fileTom Zanussi
This is the same as mkefidisk but uses gummiboot instead of grub-efi. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add sourceparams to mkefidisk.wksTom Zanussi
The bootimg-efi plugin now requires a loader param, so supply it to retain existing behavior. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add gummiboot support to bootimg-efiTom Zanussi
Add gummiboot support to bootimg-efi, which retains the existing grub-efi support (though requires an update to the .wks file). Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Parse and pass sourceparams to partition plugin methodsTom Zanussi
Add code to parse the sourceparams and pass them to the partition plugin methods. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add sourceparam param to partition plugin methodsTom Zanussi
The sourceparam param allows source plugins to be parameterized generically (via --sourceparams="key=val[,key=val], implemented previously). Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add utility function for parsing sourceparamsTom Zanussi
Parses strings of the form key1=val1[,key2=val2,...] and returns a dict. Also accepts valueless keys i.e. without =. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add '--sourceparams' partition optionTom Zanussi
To go along with '--source' as a way to parameterize source plugins. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11wic: Bump the version to 2.0Tom Zanussi
This represents a complete rework, and if we assume the previous version should have been 1.0 (instead of a silly .1x version), then this should be 2.0. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Rename /mic to /wicTom Zanussi
As well as any other stray instances of mic in the codebase that can be removed. We don't really need to carry around legacy naming, and the history is in git. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update Disk descriptionTom Zanussi
Remove obsolete comment. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Rename MountErrorTom Zanussi
wic doesn't mount anything, so can't have a mount error; rename it to something more appropriate. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Rename PartitionedMountTom Zanussi
It's actually a container for disks and partitions, and wic doesn't mount anything, so rename it to match what it really is. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update/rename configure-related codeTom Zanussi
The wic code inherited a basic image-creation flow based on image-configuration, but wic doesn't actually configure anything, so rename parts of the code dealing with configuration to something more appropriate. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update/rename install-related codeTom Zanussi
The wic code inherited a basic image-creation flow based on installing packages, but wic doesn't actually install anything, so rename parts of the code dealing with installing to something more appropriate. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update cleanup/unmount-related codeTom Zanussi
The wic code inherited a basic image-creation flow based on mounting loop devices, but wic doesn't actually mount or unmount anything, so get rid of unmount() and consolidate whatever it did do with cleanup(). Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update/rename/delete mount-related codeTom Zanussi
The wic code inherited a basic image-creation flow based on mounting loop devices, but wic doesn't actually mount anything, so rename parts of the code dealing with mounting to something more appropriate, and remove related unused code. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Remove Mount objectTom Zanussi
It doesn't do anything we need, so remove it and fix up callers/base classes. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Remove unused conf supportTom Zanussi
Also fix up users such as imager functions. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Update 'Background and Motivation' help sectionTom Zanussi
Remove help text regarding the source and future intentions of the wic codebase, since the code prompting those comments has now been mostly removed. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Remove unused command versioning supportTom Zanussi
The default is F16 and there's no reason to change that, so remove everything else. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Clean up CreatorTom Zanussi
wic doesn't use a lot of Creator, so remove it. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Clean up PartitionedMountTom Zanussi
wic doesn't use a lot of ParitionedMount, so remove it. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
2014-08-11wic: Clean up DirectImageCreatorTom Zanussi
Remove what wic doesn't use from DirectImageCreator. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>