summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2015-09-03devtool: run kernel dependenciesMarkus Lehtonen
The kernel package needs "kern-tools-native" in order for it's do_kernel_metadata. Thus, devtool extract for kernel in a pristine environment fails. With the current bb.tinfoil implementation it is not possible to run arbitrary bitbake commands - e.g. run "bitbake kern-tools-native -c populate_sysroot" in our case. This patch implements an ugly workaround for that problem, basically by hardcoding this dependency and running the required bitbake task(s) before tinfoil is initialized. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: extract: correct initial rev for kernel packagesMarkus Lehtonen
Change handling of kernel packages so that the "initial rev" is parsed correctly. Also, the devtool-specific git tags (devtool-base and devtoo-patched) are now generated for kernel packages as well. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-03devtool: make required tasks be run in kernel buildMarkus Lehtonen
Set SRCTREECOVEREDTASKS appropriately in the workspace .bbappend file for kernel recipes. This tries to ensure that all needed tasks (esp. configure and patch) are run when building the kernel - tasks which would normally be disabled by externalsrc.bbclass. [YOCTO #6658] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2015-09-02Fix recursive mode -st on BUILDDIR setupAlex Franco
Removing recursive option from chmod -st on BUILDDIR as it would take very long on existing build directories [YOCTO 7669] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix short variable namesEd Bartosh
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". 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 listing propertiesEd Bartosh
Functionality of listing and using properties of wic images does not exist in the wic code. However, there are plenty of help and usage content about it, which is very confusing. Removed everything regarding image properties from wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning redefined-builtinEd Bartosh
Renamed variables named as Python builtin functions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning unused-variableEd Bartosh
Removed or reworked code with unused variables. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning no-memberEd Bartosh
Fixed pylint warning: Instance of 'ConfigMgr' has no 'create' member (no-member) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: use optparse instead of cmdlnEd Bartosh
cmdln.py https://pypi.python.org/pypi/cmdln was used in creator.py to parse image plugin options and arguments. There is no need in such a sofisticated API to do this simple task. Standard option parser optparse.OptionParser can do it just fine. Modified Creator class to work with option parser. Removed cmdln.py from the wic codebase. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning multiple-statementsEd Bartosh
Fixed pylint warning: More than one statement on a single line (multiple-statements) 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 wildcard importsEd Bartosh
Used explicit imports in partitions.py and wicboot.py Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix errors in partition.py moduleEd Bartosh
Fixed the followring errors found by pylint in partition.py: E: 42, 0: class already defined line 33 (function-redefined) E:429,63: Undefined variable 'fs' (undefined-variable) E:432,37: Undefined variable 'fs' (undefined-variable) E:481, 0: class already defined line 33 (function-redefined) E:488,22: Undefined variable 'OptionValueError' (undefined-variable) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: remove micboot.pyEd Bartosh
Moved functionaly of micboot.py Mic_Bootloader class to Wic_Bootloader class of wicboot.py module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-31Fix mode +st on TMPDIR when creating itAlex Franco
A sanity check fails when TMPDIR has setuid, setgid set. It was proposed to fix this on TMPDIR creation instead of failing with a sanity test only. This patch handles removal of those special bits (and additonally, the sticky bit) from BUILDDIR and TMPDIR when these directories are created. [YOCTO #7669] Signed-off-by: Alex Franco <alejandro.franco@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 --vars optionEd Bartosh
This option is used to point wic to the directory with .env files containing list of bitbake variables and their values. If this option is used wic will get bitbake variables from files instead of parsing 'bitbake -e' output. The main reason for this is to support new mode, when bitbake runs wic to produce wic images. In this case wic can't run bitbake again as it's locked, so it will get variables from .env files. 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: set default imageEd Bartosh
Set BitbakeVars.default_image when wic is called with -e option. This makes get_bitbake_var API to use provided image as a default source of variables. 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-30runqemu-internal: Fixes unary operator expected in new TCPSERIAL_PORTNUMAníbal Limón
If $TCPSERIAL_PORTNUM is empty string causes an error because expands the expresion to, $TCPSERIAL_PORTNUM == "" -> == "" Signed-off-by: Aníbal Limón <anibal.limon@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-29runqemu-internal: Make sure tcpserial is always lastRandy Witt
If this is not the case, sometimes the additional tcpserial will be enumerated as ttyS0, which is not what we want. Because then it would be the console, and qemurunner would not log things properly. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24runqemu: Add a tcpserial optionRandy Witt
The option was added so that the qemurunner could start a second tcp serial port without adding machine conditional logic to qemurunner. The issue that made this necessary was that when "virt" is passed to qemu-system-aarch64, the normal mechanism for specifying a tcp serial port does not work. This is because the hardware for the "virt" machine is hardcoded in the device tree blob and the addition devices must be virtio devices. So runqemu can specify virtio for qemuarm64 whereas it seems all other qemu machines work with the "-serial tcp*" option. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24scripts/create-recipe: dropPaul Eggleton
We have "recipetool create" (or "devtool add" which wraps it) instead which works pretty well now, is written in Python and thus can call into BitBake/OE code easily, and can do things that create-recipe can't; any future improvements should go into recipetool and therefore I think we'd rather people used it instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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>