aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib
AgeCommit message (Collapse)Author
2015-09-02wic: remove micpartition.pyEd Bartosh
Moved functionality of Mic_Partition and Mic_PartData classes from micpartition.py to Wic_Partition and Wic_PartData classes of partition.py module. Reduced level of inheritance. Removed confusing mic legacy names. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix typoEd Bartosh
Fixed typo in tool name: mkswqp -> mkswap. 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 scripts/lib/imageEd Bartosh
Moved content of scripts/lib/image/ to scripts/lib/wic as one directory with the same name as a tool is self-explanatory and less confusing than two. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: use ext4 in canned .wks filesEd Bartosh
Latest kernel doesn't have ext3 compiled in. Wic images produced from canned .wks can't boot because of that. Switching to ext4 fixes this issue. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31devtool: build-image: add commentsEd Bartosh
Added couple of hopefully useful comments to the code. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: remove <image>.bbappendEd Bartosh
Removed <image>.bbappend before generating it again as it may cause tinfoil to fail due to its wrong content. It's safe to do as <image>.bbappend is regenerated anyway. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: add extra loggingEd Bartosh
Added logger calls to show if image is modified by the plugin or not. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: generate notification callbackEd Bartosh
Added notification callback to <image>.bbapend to notify user that image is modified by build-image plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: filter out recipesEd Bartosh
Filtered out non-target recipes and recipes with recipe name != package name in build-image plugin. Isolated all logic of getting recipes in _get_recipes function. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: improve help and descriptionEd Bartosh
Made parser help message and description more clear in build-image plugin. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: rename LOG -> loggerEd Bartosh
Used logger variable name instead of LOG as it is used the rest of the devtool code. Pylint complains about 'logger' being invalid constant name, but it's better to be consistent in naming. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31Revert "devtool: make add_md5 a public API"Ed Bartosh
This reverts commit 69c63728dae38d5b1cc9874268f235a07e04d3db. Moved add_md5 back to standard.py as it's not used in any plugin anymore. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: make 2 functions publicEd Bartosh
Moved standard.py:_parse_recipe -> __init__.py:parse_recipe and standard.py:_get_recipe_file -> __init__.py:get_recipe_file to be able to call them from other modules. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31devtool: build-image: stop using add_md5Ed Bartosh
It doesn't make sense to use it as image recipe is not in workspace. It means that we can't do 'devtool reset' for the recipe, which is a main point of using add_md5. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-30wic: use bitbake variable ROOTFS_SIZEEd Bartosh
If bitbake image is referenced in .ks file and --size is not used there wic uses ROOTFS_SIZE variable to set minimum partition size. ROOTFS_SIZE is calculated in meta/lib/oe/image.py when rootfs is created. The calculation is done using other image parameters: IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT, IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30wic: implement getting variables from .env filesEd Bartosh
Added functionality of getting variables from <image>.env files to BitbakeVars class. env files will be parsed if the directory with env files is known, i.e. when vars_dir attribute is set. Otherwise 'bitbake -e' output will be parsed. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30wic: add default_image attribute to BitbakeVarsEd Bartosh
New attribute is used when bitbake variable is requested without specifying image name. The attribute should be set from outside, for example when wic is called with '-e <image>' option. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30wic: create new method _parse_lineEd Bartosh
Moved code that parses one line of 'bitbake -e' output to separate method _parse_line. This method will be also used later to parse lines of .env files. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30wic: add BitbakeVars classEd Bartosh
Moved code of getting bitbake variables into separate class. Created singleton object of this class in the module namespace. Preserved existing API get_bitbake_var. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30wic: deferred call of hlp.get_wic_plugins_help()Ed Bartosh
If get_wic_plugins_help is called from wic main module it calls git_bitbake_var at some point. This fails when wic is called from bitbake as 'bitbake -e' can't be run. Moved call of this method to help.py in order to call it later, when BitbakeVariables singleton is properly initialized to get variables from .env files. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30wic: rename variableEd Bartosh
Renamed variable help -> hlp as 'help' is a name of Python built-in function. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30wic: remove undescore from function nameEd Bartosh
Renamed __exec_cmd -> _exec_cmd as double underscores cause strange behaviour when function is called in class method. Python complains that __exec_cmd method(!!!) of the same class doesn't exist. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30devtool: implement build-image pluginEd Bartosh
Implemented new plugin to build image from workspace packages. Plugin creates <image>.bbappend file, adds all workspace packages to the image using IMAGE_INSTALL_append variable in bbappend file. After that it runs 'bitbake <image>'. (From OE-Core rev: 00bc43868da3ea2a4532215d3abef8e150c7b2e5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30devtool: make add_md5 a public APIEd Bartosh
Moved _add_md5 function from standard.py to __init__.py to be able to call it from other modules. (From OE-Core rev: ee38bb20dc7ba21dac782d8d13383f81dfedef55) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24wic: add mkhybridiso kickstart fileMihaly Varga
Add kickstart file for generating a hybrid bootable iso image using isoimage-isohybrid plugin, the output image is HYBRID_ISO_IMG-cd.iso, the label is HYBRIDISO, and the rootfs.img file is an image with ext3 file system, and uses grub as bootloader for EFI boot and syslinux for legacy boot. Signed-off-by: Mihaly Varga <mihaly.varga@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-24wic: Add plugin for hybrid iso imageMihaly Varga
This plugin creates a hybrid, legacy and EFI bootable ISO image. The generated image can be used on optical media as well as USB media. Legacy boot uses syslinux and EFI boot uses grub or gummiboot (not implemented yet) as bootloader. The plugin creates the directories required by bootloaders and populates them by creating and configuring the bootloader files. The plugin adds an image file to the iso which contains the directory tree of the rootfs folder specified by the --rootfs argument or by the IMAGE_ROOTFS bitbake variable. Using the isohybryd tool, the created .iso image is enhanced by a MBR for booting from disk storage devices, consequently the provided iso image could be copyed directly by dd comand onto USB drive or could be burned to an optical media by using a suitable image burner. The plugin depends on parted, e2fstools, syslinux, grub, cdrtools, dosfstools and mtools program. Some of the functions in this plugin were inspired from bootimg-efi.py and bootimg-pcbios.py plugins implemented by Tom Zanussi. Signed-off-by: Mihaly Varga <mihaly.varga@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-19lib/oe/recipeutils: avoid parsing in get_var_files()Paul Eggleton
Let's have the caller do this and then the function is a bit more flexible (e.g. we can choose to parse with bbappends or not); fix up calls to this function appropriately (of which there are only two, both within devtool). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-19devtool: fix handling of BBCLASSEXTENDed recipesPaul Eggleton
If a recipe is BBCLASSEXTENDed (e.g. to -native), its PN value and the name of the bbappend will be different; we were assuming them to be the same when reading in the workspace, leading to us seeing the base recipe name everywhere afterwards. Also add a test so we ensure this doesn't regress in future. Fixes [YOCTO #8157]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-19devtool: extract: remove patches subdirectory when S == WORKDIRPaul Eggleton
Ensure that the "patches" subdirectory is removed from the right location when S == WORKDIR (e.g. devtool extract makedevs). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-19devtool: extract: prevent externalsrc from interfering with extractionPaul Eggleton
In case the user has set up externalsrc outside of devtool, force EXTERNALSRC to blank for the recipe when extracting so that the original source URI is still in SRC_URI and we're still able to extract it. (This isn't a problem with devtool itself because the bbappends within the workspace layer that apply externalsrc are explicitly filtered out when devtool parses a recipe). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-19canned-wks: added a qemux86* directdisk recipe for wicCristian Iorga
qemu-directdisk.wks creates a raw disk image that a qemux86* machine can boot from. Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-09wic: code cleanup: pylint misc.pyEd Bartosh
Fixed pylint warnings. Increased pylint score from 8.02 to 9.40. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: code cleanup: remove unused codeEd Bartosh
Removed unused global variable wks_vars and 2 unused functions get_wks_var and add_wks_var. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: Report recipe name for native commandsEd Bartosh
exec_native_cmd was modified to report recipe to build native programs. Pairs executable->recipe are hardcoded as it's not possible to obtain this information automatically. [YOCTO #7631] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: Improve 'wic help overview' contentEd Bartosh
Included full console output and example of the .wks file into the 'wic help overview' content. Used qemux86-64 machine instead of crownbay to make example working without cloning additional layers. [YOCTO #7940] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09wic: improved usage textEd Bartosh
Made command line specification less confusing. Reformatted usage output. [YOCTO #7938] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27devtool: also load plugins from BBPATHChristopher Larson
This makes it easier to extend, as a layer can add its own sub-commands. Argument parsing is also separated into two steps, the same way it's done in recipetool, as we need access to the global command-line arguments early, before plugins are loaded, both for debugging arguments and for the bitbake path (we need to load the bitbake module to get tinfoil, which is now needed to load the plugins). Rather than constructing tinfoil once and passing it through into sub-commands for their use, we have to construct it for configuration metadata, use it, and then shut it down, as some sub-commands call out to recipetool, which needs its own tinfoil instance, and therefore needs to acquire the bitbake lock. If we're still holding the lock at that point, that's clearly a problem. [YOCTO #7625] Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27recipetool.append: add extralines arg to appendsrcChristopher Larson
This makes the function more reusable for other sub-commands. Signed-off-by: Christopher Larson <kergoth@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-22recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIRChristopher Larson
When determining the path from WORKDIR to the extracted sources, we're using S, but if S is in work-shared, that's problematic and won't give us good results, so assume 'git' for that case, warning when appropriate. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22recipetool: appendsrcfile: use -D, not -d for destdirChristopher Larson
-d is already taken for --debug. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22recipetool: appendsrcfile: fix duplicate SRC_URI checkChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12recipetool/append: Fix selftest failure with multilibRichard Purdie
If you have multilib enabled, it finds lib32-base-files instead of base-files for test_recipetool_appendfile_basic causing a test failure. Add a fix for this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-10wic: Set default set of bitbake variablesEd Bartosh
Set default set of bitbake variables to the set of variables for the first parsed image. This allows wic to find proper bitbake varibale values if it's called with '-e <image>' even without specifying image in the call of get_bitbake_var. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02wic: Code cleanup: unused importsEd Bartosh
Fixed pylint warning unused-import Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Code cleanup: long lines, identation and whitespacesEd Bartosh
Fixed pylint warnings bad-continuation, bad-continuation and line-too-long. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Remove __write_partition methodEd Bartosh
Moved code of __write_partition to 'assemble' method. This way it should be more readable. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Refactor fstab update codeEd Bartosh
Made the code to backup and restore fstab only if it's modified. Cleaned up the code. Made it more pythonic. Improved code readability by moving code from several tiny methods into one place. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Add --uuid partition optionEd Bartosh
Added --uuid option to the configuration of wks parser. This option specifies partition UUID. The code to process it is already in place. It was implemented for --use-uuid option. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-07-02wic: Fix naming conflictEd Bartosh
Image file name is not unique for the partitions without label. This causes image being rewritten and used as a source for all partitions without label. Wic produces broken or incorrect result images because of that. Added wks line number to the image name to make it unique.
2015-07-02wic: Remove duplicated codeEd Bartosh
Moved duplicated code of geting rootfs size out of prepare_rootfs* methods.