Commit Graph

718 Commits

Author SHA1 Message Date
Ed Bartosh e7287e5157 wic: fix pylint warning unused-variable
Removed or reworked code with unused variables.

(From OE-Core rev: 3644b9f5ca25dfc61d4f5eda0f073c8a879b492b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:29 +01:00
Ed Bartosh e3a062ab1e wic: fix pylint warning no-member
Fixed pylint warning:
Instance of 'ConfigMgr' has no 'create' member (no-member)

(From OE-Core rev: 41e319730cdd9c320ae4d855df7aaff6f1679aaf)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:29 +01:00
Ed Bartosh e85f807b87 wic: use optparse instead of cmdln
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.

(From OE-Core rev: 1e5220f74830b99cf8340a4f6977399b5cf49871)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh f1bcf47ff4 wic: fix pylint warning multiple-statements
Fixed pylint warning:
More than one statement on a single line (multiple-statements)

(From OE-Core rev: fa43b8b482a9423208f5d2c12994fa15bcbddbb2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh 0fc551edb6 wic: get rid of wildcard imports
Used explicit imports in partitions.py and wicboot.py

(From OE-Core rev: 975d919a0f81b06a5e9f99096e92e34e7fbf4b90)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:28 +01:00
Ed Bartosh c9876833a4 wic: fix errors in partition.py module
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)

(From OE-Core rev: 83b1aa4b6480b625d1accee4c594162df2e84b96)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:27 +01:00
Ed Bartosh 90486ff047 wic: remove micboot.py
Moved functionaly of micboot.py Mic_Bootloader class to
Wic_Bootloader class of wicboot.py module.

(From OE-Core rev: 0be568537072d9b0027a0d3a532fc4696184453b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:27 +01:00
Ed Bartosh 282fb044d4 wic: remove micpartition.py
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.

(From OE-Core rev: eae139af81262b457cfb8ddf45a99523cc8a41cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:26 +01:00
Ed Bartosh 2e2ac0cb7a wic: fix typo
Fixed typo in tool name: mkswqp -> mkswap.

(From OE-Core rev: e21d4b442437fac450070922ec74029ee1d10208)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:26 +01:00
Ed Bartosh 7d4bb40905 wic: get rid of scripts/lib/image
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.

(From OE-Core rev: 5dc02d572794298b3362378cea3d7da654456c44)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:25 +01:00
Ed Bartosh 77561e7191 wic: use ext4 in canned .wks files
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.

(From OE-Core rev: d281a65a81f369fc8d75023b8f911ce4106969c1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:24 +01:00
Ed Bartosh 15526a8591 devtool: build-image: add comments
Added couple of hopefully useful comments to the code.

(From OE-Core rev: 72dfe5b58c637d74971e025aef3ce0a64dc8172c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:14 +01:00
Ed Bartosh 2dac49db87 devtool: build-image: remove <image>.bbappend
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.

(From OE-Core rev: 82c6452ca953eb32e2919d9f9e64497a15212be5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:14 +01:00
Ed Bartosh 96726242f0 devtool: build-image: add extra logging
Added logger calls to show if image is modified by the
plugin or not.

(From OE-Core rev: f719e956a6263784963b6ae9514030a1a1dc2aeb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:13 +01:00
Ed Bartosh 45ebff42af devtool: build-image: generate notification callback
Added notification callback to <image>.bbapend to notify
user that image is modified by build-image plugin.

(From OE-Core rev: 53cb00b8af58c326e2a045cd6f8a04a24dc4c1b5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:13 +01:00
Ed Bartosh 61ecb6ce47 devtool: build-image: filter out recipes
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.

(From OE-Core rev: efe685711ae6f4beec06ba591c74140ce56b96af)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:12 +01:00
Ed Bartosh 214dd950c9 devtool: build-image: improve help and description
Made parser help message and description more clear in
build-image plugin.

(From OE-Core rev: 39714557dde70c4b1ce8d08c7e1d21fd39a1d1a6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:12 +01:00
Ed Bartosh e9fbc7a2d2 devtool: build-image: rename LOG -> logger
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.

(From OE-Core rev: a1c811df93e831a198464008564ce33ec98a3049)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:11 +01:00
Ed Bartosh 7eb7dc861f Revert "devtool: make add_md5 a public API"
This reverts commit 69c63728da.

Moved add_md5 back to standard.py as it's not used in
any plugin anymore.

(From OE-Core rev: 3823b7abf8c1e82e0448d7283de95422fd262135)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:11 +01:00
Ed Bartosh 71fdc64b8a devtool: make 2 functions public
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.

(From OE-Core rev: f0e61a0d5597017c5f5d2dafb41118b79f505d9b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:10 +01:00
Ed Bartosh 906f885efe devtool: build-image: stop using add_md5
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.

(From OE-Core rev: f69613ed9d56c6e6ba322d8c9db07b7ed802042a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:10 +01:00
Ed Bartosh 7b421dccc1 wic: use bitbake variable ROOTFS_SIZE
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.

(From OE-Core rev: 173d440c14ee3140ae08c6a87decc9b2f4c9e391)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:26:26 +01:00
Ed Bartosh 5856f8ff96 wic: implement getting variables from .env files
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.

(From OE-Core rev: d21e4c1e56cab750ed4f6031d7f3dc5775a2c2cc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:22 +01:00
Ed Bartosh 95c6749af8 wic: add default_image attribute to BitbakeVars
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.

(From OE-Core rev: 38d0b3744b5829333148ac4fc97dc45a8d0ba3a5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh e1fe3479a6 wic: create new method _parse_line
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.

(From OE-Core rev: 49ef04d3c9eeb76cbbc89b27b4dd1570b7a2552b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh 58c393022f wic: add BitbakeVars class
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.

(From OE-Core rev: 3229d37993e315c9ca1902849746b9f50f35845c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 21:38:21 +01:00
Ed Bartosh 8313ceae26 wic: deferred call of hlp.get_wic_plugins_help()
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.

(From OE-Core rev: d401a8518fb4b0e8adeb34be8948fa780299870c)

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-30 12:36:08 +01:00
Ed Bartosh 31324ed0ea wic: rename variable
Renamed variable help -> hlp as 'help' is a name of Python
built-in function.

(From OE-Core rev: 94c85fdaec36bfda509be4a66082a0156bf76695)

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-30 12:36:08 +01:00
Ed Bartosh b41de121c6 wic: remove undescore from function name
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.

(From OE-Core rev: 3b400a06d755e3d437967f60842b1d9bd94f0814)

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-30 12:36:08 +01:00
Ed Bartosh b2c1e64ecd devtool: implement build-image plugin
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)

(From OE-Core rev: fc35c10fed382e385f00b76abcee94a0148b4aee)

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-30 12:35:50 +01:00
Ed Bartosh 69c63728da devtool: make add_md5 a public API
Moved _add_md5 function from standard.py to __init__.py to
be able to call it from other modules.

(From OE-Core rev: ee38bb20dc7ba21dac782d8d13383f81dfedef55)

(From OE-Core rev: b07da7d38bcefe8efdd6b22bb9251bef599ef040)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:35:49 +01:00
Paul Eggleton 15c8835445 yocto-bsp / yocto-layer: fix template recipes
* Drop PR = "r0"
* Use SUMMARY instead of DESCRIPTION

(From meta-yocto rev: 433044641e2500f40fbd72d91bbc38d5cb288c1e)

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>
2015-08-25 10:47:20 +01:00
Mihaly Varga 1308e30379 wic: add mkhybridiso kickstart file
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.

(From OE-Core rev: e8769d52d6d8c67ba18595ebd27f5022bd0e66c4)

Signed-off-by: Mihaly Varga <mihaly.varga@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:56 +01:00
Mihaly Varga de5bc1b758 wic: Add plugin for hybrid iso image
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.

(From OE-Core rev: 289c534b5d990e22e5547496f5f84cc9721ce3ee)

Signed-off-by: Mihaly Varga <mihaly.varga@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:55 +01:00
Paul Eggleton 0f23a3af8e lib/oe/recipeutils: avoid parsing in get_var_files()
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).

(From OE-Core rev: 6ba969f1ac5a1a0e277a21287fc5ae1622a6b14e)

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>
2015-08-19 18:05:40 +01:00
Paul Eggleton 677e8c8e97 devtool: fix handling of BBCLASSEXTENDed recipes
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].

(From OE-Core rev: b63fca00c2e24ad0c8b8b3c492d93ee4372fa92d)

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>
2015-08-19 18:05:39 +01:00
Paul Eggleton 48bb9eca79 devtool: extract: remove patches subdirectory when S == WORKDIR
Ensure that the "patches" subdirectory is removed from the right
location when S == WORKDIR (e.g. devtool extract makedevs).

(From OE-Core rev: 2062c88726400e09599aff51af95799a866b90c9)

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>
2015-08-19 18:05:39 +01:00
Paul Eggleton 5e880674a3 devtool: extract: prevent externalsrc from interfering with extraction
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).

(From OE-Core rev: 5be16d639d1b78d114755bfd552ac901d0fdf4a9)

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>
2015-08-19 18:05:38 +01:00
Cristian Iorga b7cd76810a canned-wks: added a qemux86* directdisk recipe for wic
qemu-directdisk.wks creates a raw disk image
that a qemux86* machine can boot from.

(From OE-Core rev: 3b1a2baa95fee7479e85379c0f6f4d54c0db2042)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:33 +01:00
Ed Bartosh 8ce8328901 wic: code cleanup: pylint misc.py
Fixed pylint warnings.
Increased pylint score from 8.02 to 9.40.

(From OE-Core rev: 26d8c70fb8a7cc8f6473ad1779b20b00616740c0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:02 -07:00
Ed Bartosh 8421e0e29f wic: code cleanup: remove unused code
Removed unused global variable wks_vars and 2 unused functions
get_wks_var and add_wks_var.

(From OE-Core rev: 7d87c821da6a5020e8dde3f1907fb8d6a023b110)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 87a846d588 wic: Report recipe name for native commands
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]

(From OE-Core rev: 1274379c91ee8e2fb9fbb34a6445cd5767eb4a35)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh daa8109314 wic: Improve 'wic help overview' content
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]

(From OE-Core rev: 68d391eaf4fe9fc37e3278255d5da170f98b8763)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:01 -07:00
Ed Bartosh 04c5307cf7 wic: improved usage text
Made command line specification less confusing.
Reformatted usage output.

[YOCTO #7938]

(From OE-Core rev: c4a44ad4c5aa65657b69b811e793f98418159348)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:14:00 -07:00
Christopher Larson 0eb40ba0de devtool: also load plugins from BBPATH
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]

(From OE-Core rev: f9bc3b27244a141ec7273445d3ea139a047e0ddf)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 89878f5906 recipetool.append: add extralines arg to appendsrc
This makes the function more reusable for other sub-commands.

(From OE-Core rev: c6feb6e97c9929560b1e3cec280c1d7976ecc030)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Christopher Larson c56cb31565 recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIR
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.

(From OE-Core rev: dc70cf470f18c97b6762cbf7aca723769b47bc7d)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Christopher Larson 5c080f71bf recipetool: appendsrcfile: use -D, not -d for destdir
-d is already taken for --debug.

(From OE-Core rev: fc174debb073c99a0cabf4f00e66ab36c7e93989)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Christopher Larson 023e9b2685 recipetool: appendsrcfile: fix duplicate SRC_URI check
(From OE-Core rev: e9986529d15220a8482f5a7a2fdbe86110ee35b5)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Richard Purdie ee69463f4e recipetool/append: Fix selftest failure with multilib
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.

(From OE-Core rev: c9821a56da9c6e341408ea21e0d8a4cc5291dba6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:38 +01:00
Ed Bartosh 8f8d3362b8 wic: Set default set of bitbake variables
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.

(From OE-Core rev: 18cc6d2ec4dc289bb0333dddc96df5a645ea53d0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-10 13:35:40 +01:00
Ed Bartosh 00020fada3 wic: Code cleanup: unused imports
Fixed pylint warning unused-import

(From OE-Core rev: e77fda5fb6cb0a35308e4620ca4602715a471fbe)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 34172ef805 wic: Code cleanup: long lines, identation and whitespaces
Fixed pylint warnings bad-continuation, bad-continuation and
line-too-long.

(From OE-Core rev: db43e59f41b6bc19152cd4743585a3217015e272)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh d88af4f518 wic: Remove __write_partition method
Moved code of __write_partition to 'assemble' method.
This way it should be more readable.

(From OE-Core rev: f7059362053c87f96ce68d1ab850962defb76540)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 0ef9cdd1ec wic: Refactor fstab update code
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.

(From OE-Core rev: e663b1857fd2975585003bfa4739f8f84c652708)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh a49a422700 wic: Add --uuid partition option
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.

(From OE-Core rev: c7ffe3785e61f3c57aeeebc34ec573685f0ea6a8)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:38 +01:00
Ed Bartosh 594dc7213f wic: Fix naming conflict
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 4023377bae wic: Remove duplicated code
Moved duplicated code of geting rootfs size
out of prepare_rootfs* methods.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh b5dce25ddc wic: Refactor prepare_empty_partition API
Moved code out of prepare_empty_partition* methods
to avoid code duplication.

(From OE-Core rev: 7dc4e007aa9f02162b3f24705e9d9dba7a1cf7ef)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 052c8198d7 wic: Call methods better way
Shortened code by using getattr to obtain a method to call for
prepare_empty_partition_* and prepare_rootfs_* methods.

(From OE-Core rev: 066f713f71828ff6f408448e5ea4fcd56faa423e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 73d0d23014 wic: Get rid of useless variable 'image_rootfs'
Removed useless variable 'image_rootfs' from 4 prepare_rootfs_* methods.

(From OE-Core rev: 4570412f70188d36312a5f9944d81df884302520)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 1e307c3b40 wic: Rename partition images
Renamed partition images into <final image>.p<partition number>
This should make output directory look more organized and easier
to understand.

(From OE-Core rev: c826939e4eeed034f39207089ec1a7ed87c1c493)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh e9237bf0fa wic: Refactor prepare_rootfs API
Moved code out of prepare_roots* methods to avoid code duplication.

(From OE-Core rev: ab1c845758d4f80c82ffcf481007803905e45c29)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:37 +01:00
Ed Bartosh 992f78939e wic: Turn off debug output for 'bitbake -e'
Switched debug level to 'normal' to prevent huge 'bitbake -e'
output to go into wic debug output. This should help to make
wic debug info much more clean and easier to read.

(From OE-Core rev: 71510c32d78ba24bf1172548f8eb4adfe621d2de)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh 9ca3472f4f wic: Remove annoing debug message
Wic tries to find plugins in every layer and prints a message
'Plugin dir is not a directory or does not exist' if layer
doesn't have plugin dir. It causes a lot of duplicated
messages in the debug output, which makes it hard to find
useful info there.

(From OE-Core rev: e6ed2e07d70eaa07d4c2ab9e484eacedd193323e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh 1cabf091fc wic: Include mount point into image report
Wic doesn't show any information for the partition if label is not set.
Fixed this by adding mount point to the report.

(From OE-Core rev: 36be9c1f7a6fded146a6f1c268455d826d78f97b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh aa470a1fcd wic: Refactor getting bitbake variables
Wic gets bitbake variables by parsing output of 'bitbake -e' command.

This implementation improves this procedure as it runs 'bitbake -e' only
when API is called and does it only once, i.e. in a "lazy" way. As parsing
results are cached 'bitbake -e' is run only once and results are parsed
only once per requested set of variables.

get_bitbake_var became the only API call. It replaces find_artifacts,
find_artifact, find_bitbake_env_lines, get_bitbake_env_lines,
set_bitbake_env_lines and get_line_val calls making API much more clear.

(From OE-Core rev: 3abe23bd217315246ec2d98dc9c390b85cfe6a92)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh b42d7d26e1 wic: Test rootfs plugin using image recipes
Added canned wks and testcase to create multi-rootfs images referring
bitbake image recipes.

(From OE-Core rev: 723ed56eda0e64b9678b846ef2001465b15e0c1b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:35 +01:00
Christopher Larson b428f88bc1 recipetool: add appendsrcfile(s) sub-commands
This adds the `appendsrcfile` and `appendsrcfiles` sub-commands, which let the
user add or replace one or more files in the recipe sources, either in a path
relative to `S` or `WORKDIR`. Each file gets added to `SRC_URI` as a file://
URI, using the subdir= parameter to specify the destination directory.

Examples:

    # Adds our defconfig as file://defconfig. If it's already in SRC_URI, it
    # won't be duplicated.
    recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig
    recipetool appendsrcfiles --workdir meta-mylayer linux-mel defconfig

    # Does the same, handling the different local filename
    recipetool appendsrcfile --workdir meta-mylayer linux-mel defconfig.mine defconfig

    # Adds our device tree files to the source tree
    recipetool appendsrcfiles --destdir arch/arm/boot/dts meta-mylayer linux-mel *.dts

Of course, for the latter example to be of use, the new dts files would need
to be added to `KERNEL_DEVICETREE` as well, and depending on the kernel,
`DEFCONFIG` or `KERNEL_DEFCONFIG` may need to be set.

Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: 8227172d05fb394d79ff83d3c36f5208ebebf92c)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Christopher Larson 49a089f8e1 recipetool.append: use argparse types for validation
This validates the arguments early, when argparse is parsing the arguments, in
a consistent way.

Cc: Paul Eggleton <paul.eggleton@linux.intel.com>
(From OE-Core rev: bec92899f5324a4423b4ee70365eaa5dfb6891a6)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Ed Bartosh a04ebe7246 wic: Make code more pythonic
Used more pythonic way to make a list.

(From OE-Core rev: 42b86a1654452348036c5d348d2fa5fe27e98245)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:49 +01:00
Ed Bartosh 34766858cd wic: Implement image compressing
Implemented compressing result image with specified compressor.
Updated reporting code to show compressed image.

[YOCTO #7593]

(From OE-Core rev: 31791fa7a168e6b6fb030aeb338c8233b4735af1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:49 +01:00
Ed Bartosh 597cba650c wic: Add new argument to direct plugin
Added 'compressor' argument to Direct plugin API to
pass a name of compressor utility.

(From OE-Core rev: 34c583274c2908351e3a84dd629302f1975f2f0d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:49 +01:00
Ed Bartosh 40349f1325 wic: Add new argument to wic_create function
Added 'compressor' argument to wic_create to pass a name of
compressor utility to the wic engine.

(From OE-Core rev: 33d38aefb06f8849b46c5f9f6c1db73b4dccd985)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:49 +01:00
Ed Bartosh 13427e1598 wic: Add --compress-with command line option
Added -c/--compress-with command line option to 'wic create'
subcommand. This option is used to specify compressor
utility to compress the image produced by wic. gzip, bzip2 and
xz compressors are supported in this implementation.

(From OE-Core rev: 8425ef0a67aa5ca7b2dbf4c461004af555aa0c96)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:49 +01:00
Richard Purdie e8c50a2b7f lib/devtool/standard: Fix patch cleanup
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 rev: de6e0f3af5e858960676ea291036e59105fd806f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:30 +01:00
Ed Bartosh 81e469b030 wic: removed unused command line option
Removed -i/--infile wic command line option.
Removed properties_file and properties arguments of
wic_create function.

(From OE-Core rev: 6b81c89878236b2ef8d8b8217f2e33286b49dab6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:36 +01:00
Ed Bartosh a4da21d92f wic: code cleanup: superfluous-parens
Removed unncecessary parents after 'if' 'del' and 'print' keywords.
Fixed pyling warning: Unnecessary parens after 'xxx' keyword

(From OE-Core rev: a64604d11f75973b4c2347fa2669da9889e44013)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:36 +01:00
Ed Bartosh 40764a309d wic: Return error code when wic fails to invoke command
Return 1 if command doesn't exist or wic is called without
any commmand.
Return result of invoke_command as wic return code.

Added tests for unsupported command and no command.

Fixed typo in test case test02_createhelp spotted by this fix.

[YOCTO #7856]

(From OE-Core rev: ebd9f7b1da8ed556e98aab4d5f4e81707ac44b27)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:34 +01:00
Ed Bartosh 5daadf85ed wic: Integrated plugin docstrings into 'wic help plugins' output
Added mechanism to show docstrings of plugin classes as a part of
plugins help page.
For missing plugins the following warning message is shown:
<class '<plugin class spec>'> is missing docstring.

[YOCTO #7118]

(From OE-Core rev: 0997208266686473d23aed0fab58a1fd7c5d8cae)

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-06-23 11:47:33 +01:00
Ed Bartosh cfe64126c8 wic: Add missing docstrings to plugin classes
Docstings from plugin classes are used as part of
output of 'wic help plugins'. Adding them makes help page
more informative.

(From OE-Core rev: d4414b45c81ab539f75a7bb16fc6412c30dfc45f)

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-06-23 11:47:33 +01:00
Ed Bartosh 553f332265 wic: Code cleanup: bad-classmethod-argument
Fixed wrong name for the first argument in class methods.
Pylint complains about the issue this way:
    Class method should have 'cls' as first argument

(From OE-Core rev: cd7c72d6d5a5110173d0d3f60f2991b1dc30fc26)

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-06-23 11:47:32 +01:00
Ed Bartosh 9286213688 wic: Document creation of empty partition
Added short explanation of how to create empty pattition
to the 'wic help kickstart' output.

[YOCTO #7131]

(From OE-Core rev: d92cda72ef605bf2f45437667c1fc36c76629d47)

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-06-23 11:47:31 +01:00
Paul Eggleton 2054b29dd7 devtool: deploy: fix preservation of symlinks and permissions/ownership
It turns out that scp can't be used to copy symlinks because it follows
them instead of copying them, and this is by design (since it emulates
rcp which also behaved this way); the unfortunate result is that
symlinks that point to valid files on the host translate into the host
file being copied to the target (yuck).  The simplest alternative that
does not have this undesirable behaviour is to use tar and pipe it over
ssh.

At the same time, it would be even better if we properly reflect file
permissions and ownership on the target that have been established
within the pseudo environment. We can do this by executing the copy
process under pseudo, which turns out to be quite easy with access to
the pseudo environment set up by the build system.

Fixes [YOCTO #7868].

(From OE-Core rev: 69adaed0e982d627ebfa57b360b0ee049ea7a276)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Paul Eggleton 32ed5f5769 recipetool: appendfile: fix file command error handling
* It turns out that not all versions of the file command support the -E
  option - the version in Ubuntu 14.04 doesn't support it for example.
  This option is supposed to force file to return an error if the file
  can't be opened - since we can't rely upon it then fall back to
  looking at the output instead. (The results of this issue were simply
  that we didn't notice if the file was executable and give a warning,
  which tripped an oe-selftest failure - so it was minor.)
* If we receive an error there's not much point looking at the output to
  see what type was returned because there wasn't one.

(From OE-Core rev: 7bf9dccef1aa626adc9c45addcd066fed69cace9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Paul Eggleton 44e036904c recipetool: appendfile: clarify help text
Add a long description and tweak some of the argument descriptions so
that it's clearer what the appendfile subcommand does and how it works.

(From OE-Core rev: a0a595307d28d0350c3752293ab8ebf499ee416f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Markus Lehtonen 07f76656d9 devtool: use DevtoolError for error handling
Use DevtoolError exception more widely for handling error cases. This
exception is now caught in the main script and raising it can be used to
exit with an error. This hopefully simplifies error handling. The
change also makes exit codes more consistent, always returning '1' when
an error occurs.

(From OE-Core rev: 2e4f1dcade7ccb581c7a390c32163ea3deeac6d5)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Markus Lehtonen 5648a7909f devtool: remove some unused return values
(From OE-Core rev: 30fd41bd06a61e9df47263d49119fb8e193cdf68)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:05 +01:00
Markus Lehtonen 60278094cc devtool: split out 'patch' update mode into a separate function
Continue refactoring of update_recipe() by splitting out the 'patch'
mode into a separate function.

(From OE-Core rev: cdcfedec5489a5d8d0df56bbe100e5fc2cca03af)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:05 +01:00
Markus Lehtonen 18efa996c6 devtool: split out 'srcrev' update mode into a separate function
Refactor update_recipe() (i.e. the implementation of the update-recipe
command)  by splitting out the 'srcrev' into a distinct function.

(From OE-Core rev: 5da26bfd8b34af9075b9b900d353df555d8f2ef0)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:05 +01:00
Markus Lehtonen f5ea48cb12 devtool: slight simplification of path splitting logic
(From OE-Core rev: 762ca3e8d78d4dd22f7be045082052ad20b71e50)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:05 +01:00
Markus Lehtonen 962f8a499e devtool: simplify few conditionals a bit
Just refactor the code.

(From OE-Core rev: 06f6b20f040d2e4eee577bb2111351523ee97af2)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:05 +01:00
Markus Lehtonen 1f4830734a devtool: simplify the logic of determining patches to be removed
A slight simplification of the code.

(From OE-Core rev: aff88bcebe335b0277df660ac22eeed28d65da44)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:04 +01:00
Markus Lehtonen 5d7437ea86 devtool: update-recipe: do rev parsing in a separate function
Split out the logic of determining "initial rev" and "update rev" into a
separate function.

(From OE-Core rev: 17206934822aab31d93318bffea8099bf9965112)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:04 +01:00
Markus Lehtonen f0ab93f177 devtool: refactor bb task execution into a separate class
(From OE-Core rev: bd93a75ec0537fc82ac84ccc5701473d76877bcb)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:04 +01:00
Markus Lehtonen 6e039bf7c0 devtool: fix wrong indentation
(From OE-Core rev: 551638c44215a35238f22aba575d571572046cd0)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:04 +01:00
Ed Bartosh d59d876f44 wic: Move validation of --ptable option to wks parser
bootloader --ptable option has two valid choices: gpt and msdos
Moved this check to wks parser by changing option type to 'choice'.

Removed similar checks from 5 other places.

(From OE-Core rev: b812d0f40423bc56394cc8b6fc92eb1f477dba1b)

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-06-11 23:59:13 +01:00
Ed Bartosh 69bbf80c8d wic: Add help for --part-type and --use-uuid options
Added help for two wks partition options specific to
GUID partition table and globally unique identificators (GUID).

(From OE-Core rev: e21e31b48b20bf2f8a7733c52b436a65c27de8aa)

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-06-11 23:59:13 +01:00
Ed Bartosh b71f4d0dd0 wic: Use partition UUID in directdisk-gpt
Used --use-uuid option for root partition in directdisk-gpt.wks
This is useful to have example of image with UUID support.

(From OE-Core rev: b7ae24c9ee52cf1e7eed8cc7e2c081cda7147376)

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-06-11 23:59:12 +01:00
Ed Bartosh 708ce3f3b7 wic: Set type GUID and UUID for partition
Set type GUID and UUID for partition using sgdisk utility.

Type GUID can be specified for partition in .wks with
--part-type option.

UUID is generated when --use-uuid option is specified for
partition.

[YOCTO #7716]

(From OE-Core rev: c3cb9eb31570b2a92c8081a6b3716cb7443b1506)

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-06-11 23:59:12 +01:00
Ed Bartosh 9f40e6a5e8 wic: Add parameter 'uuid' to Image.add_partition method
With this parameter it's possible to pass generated UUID
into Image class to set it for partition when it's created.

(From OE-Core rev: e4bc71fa78b0d7a60aa85b8eb09a053545b61b84)

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-06-11 23:59:12 +01:00
Ed Bartosh c3148c6199 wic: Refactored getting root device name
Replaced DirectImageCreator._get_boot_config private method
with a 'rootdev' property.
Simplified the code and API.
Used 'uuid' property instead of incorrectly used 'part_type'.

(From OE-Core rev: 4a303007149ea1205bbd454e70810e7dfa343d4c)

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-06-11 23:59:12 +01:00
Ed Bartosh 5b4ab4e4be wic: Fix format string
wic crashes with "TypeError: %d format: a number is required, not str"
Due to incorrect format used for Wic_PartData.extra_size attribute.
Using %s instead of %d should fix the crash.

(From OE-Core rev: 2cae0473971ff3983c7e423c23215b342c7dad1d)

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-06-11 23:59:12 +01:00
Ed Bartosh 0510591058 wic: Generate random uuid for partition
'uuid' attribute of partition object is set to generated uuid
when --use-uuid option is used for partition in .wks file.

(From OE-Core rev: 4bfe81a88653f4851ec24eef9e5ee51960cb101b)

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-06-11 23:59:12 +01:00
Ed Bartosh 8535185235 wic: Add --use-uuid partition option
Added --use-uuid option to the configuration of wks parser.
Processing of this option will be implemented in the following
commits.

(From OE-Core rev: b2b6ff9dcf8c8b1c01ddf13894b8318becf4a8d0)

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-06-11 23:59:11 +01:00
Ed Bartosh 0e364973a4 wic: pylinted partitionedfs.py
Fixed some pylint findings in partitionedfs.py

(From OE-Core rev: fcb891a391a34fad15d99edfea6b0f022fc0d1c9)

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-06-11 23:59:11 +01:00
Ed Bartosh 4f9fe5b616 wic: replaced __run_parted with exec_native_cmd
There is no need for yet another wrapper around exec_native_cmd.

(From OE-Core rev: f0f163e55865dc10d2a4188b5f2d759836c13f68)

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-06-11 23:59:11 +01:00
Ed Bartosh dec9156ce8 wic: move checks to exec_native_cmd
Checked for return code and output of native commands
inside exec_native_cmd.

Removed similar code from a lot of places where
exec_native_cmd is called.

(From OE-Core rev: 9e3e933321d58c04619a585326fb291dbf2748f5)

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-06-11 23:59:11 +01:00
Ed Bartosh 77e9243210 wic: removed exec_cmd_quiet and exec_native_cmd_quiet
These functions are not used anywhere.

(From OE-Core rev: 7467fd446d08704881325577b7035b6128db6151)

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-06-11 23:59:11 +01:00
Ed Bartosh ebc6936315 wic: create directdisk-gpt.wks
directdisk-gpt is the same as directdisk with only one difference:
it uses GPT partition table.

(From OE-Core rev: 3d3dad40f3f51070a33e2ba28c0fc14ffcc3c2a5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

 create mode 100644 scripts/lib/image/canned-wks/directdisk-gpt.wks
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:11 +01:00
Ed Bartosh 9682d8f21e wic: Make _ptable_format public
Names with one leasding underscore considered protected in Python.
_ptable_format is accessed outside of its class.
Made it public by removing underscore.

This pylint warning should be fixed now:
Access to a protected member _ptable_format of a client class

(From OE-Core rev: 72599b5500ebdd0c418a0ef1e2c93c833bd31d75)

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-06-11 23:59:10 +01:00
Ed Bartosh 179fb20603 wic: Use gptmbr.bin MBR for gpt partitions
Used proper syslinux MBR gptmbr.bin for GPT partitons.
Added check for unsupported partition formats.

(From OE-Core rev: 6174983e20bd24422e5cee57e78dce9c92cb3c15)

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-06-11 23:59:10 +01:00
Ed Bartosh 76f503535f wic: Add gpt to the list of supported partition table formats
Only msdos partition table format was supported by wic source
plugins.

(From OE-Core rev: 0e119d469796a19fbeae61a7162fd70660c936a5)

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-06-11 23:59:10 +01:00
Ed Bartosh b7b3e4642c wic: check if part_type is set only for msdos partition table
Specifying partition type(GUID) makes sense for gpt partition table.

Current code checks if part-type is specified and throws exception
if it is. This makes sense to do only for msdos partition table.

(From OE-Core rev: 52dcccbead0c57d1a3f4afd2f9c7a38a985301ec)

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-06-11 23:59:10 +01:00
Ed Bartosh 0a13707513 wic: set legacy_boot flag for gpt partitions
This flag is used to tell special purpose software that
the GPT partition may be bootable.

(From OE-Core rev: 3ec5e2892c5ee312c44f4425096450a1914ce44a)

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-06-11 23:59:10 +01:00
Ed Bartosh 346ef9245d wic: refactored processing of wic exceptions
All wic exceptions are now inherited from new base exception
class WicError. It makes them easy to maintain and catch.

Processing of exceptions is done this way:
    Known wic exceptions cause wic to print error message to stdout.
    Unknown exceptions are not catched anymore and produce standard
    python traceback.

(From OE-Core rev: e5e2c18ce4344c14d9e52ece916333bd0a619281)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:14 +01:00
Ed Bartosh 74c7efb2af wic: Make sure file exists before removing it
Bunch of os.remove calls were added to the partition.py lately.
They're causing wic to fail with OSError: [Errno 2] No such file or directory
if file doesn't exist.

Added check for file existence to all recently added calls of
os.remove. That should fix this regression.

(From OE-Core rev: 75162b05b5ad9aac307f7911caecb2b8a017acbf)

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-05-24 07:19:19 +01:00
Paul Eggleton 7539c1f889 devtool: update-recipe: add option to write changes to bbappend
Quite often what you want to do having made customisations to a piece of
software is to apply those customisations in your own layer rather than
in the original recipe. Thus, add a -a/--append option to the
update-recipe subcommand which allows you to specify the layer to write
a bbappend into. The bbappend will be created at the appropriate path
within the specified layer directory (which may or may not be in your
bblayers.conf) or if one already exists it will be updated
appropriately.

(This re-uses code written for recipetool appendfile.)

Implements [YOCTO #7587].

(From OE-Core rev: 87d487ea4fdfb6cd30e3b3fad47732db12e86f23)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.

Fairly extensive oe-selftest tests are also provided.

Implements [YOCTO #6447].

(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton 3d0418a331 devtool / recipetool: ensure bb.note() gets printed
Most of the time when bb.note() gets called we want to see the output,
so ensure the level is set appropriately depending on the command line
options instead of being fixed at warning. (We don't want to see the
notes for fetch/unpack/patch though as they are too verbose).

(From OE-Core rev: 69f426a2d966a2228cbdc708b9ddab31005c6d96)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:03 +01:00
Alexandre Belloni c2bb6022fe wic: remove intermediate partitions
Remove intermediate partitions that may have been created by a previous
wic invocation. Those partitions are causing issues on some systems. In
particular vfat partition creation is hanging on mcopy execution on
Fedora.

(From OE-Core rev: 8d2587d87601a7ff0fad840dabc07d66363b2810)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:37:25 +01:00
Paul Eggleton 293c82baa4 devtool: deploy-target: use tinfoil instead of bitbake -e
Using tinfoil here is quicker and tidier than shelling out to
bitbake -e and interpreting its output.

(From OE-Core rev: 986ad99aee98dd5b7f30d59098dd9275097b8276)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Paul Eggleton 1bab18f26f devtool: fix build env command execution error handling
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 rev: 98a716d79bfc5434a5b42d3ca683eab3eea30a41)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Markus Lehtonen 18114bb8a6 devtool: deploy plugin: fix bad indentation
(From OE-Core rev: 6866b3027babcc390130f0cba4990c0f769cdb6a)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Markus Lehtonen 7883af3097 devtool: add missing docstrings
(From OE-Core rev: 07b2e731a378c56852e2715f6c001097b81abe46)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:50 +01:00
Markus Lehtonen c977cdf3d8 devtool: rename unused variables
(From OE-Core rev: 92b84d54292518a387460ee1ec5a994023eb26fc)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:50 +01:00
Markus Lehtonen 87fba31ad7 devtool: remove unused imports / re-imports
(From OE-Core rev: e3de8aca33f612f2dd124ff712fb6758bf32a573)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:50 +01:00
Markus Lehtonen 89fb8c58c1 devtool: extract: remove patches when S=WORKDIR
Before this change, all files from the recipe (SRC_URI), including
patches, were added to to srctree repository when S==WORKDIR. The patch
files are useless as they are automatically applied on top of the
srctree by devtool.

This change causes devtool extract to not commit these unnecessary (and
possibly confusing) patch file(s) into srctree repository.

[YOCTO #7602]

(From OE-Core rev: 3e0ffff619e49b1f0c13e5f6a663455be3ed26af)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:50 +01:00
Paul Eggleton 1f15117404 devtool: fix for rename of gcc-source
After OE-Core commit 67db7182faf6742b0d971d61d8c5ba34f69d2e12, PV is
appended to the end of the gcc-source PN, thus we need to handle that in
devtool and the corresponding test.

Part of the fix for [YOCTO #7729].

(From OE-Core rev: 440029dc229a566b9bead1481215d5e5760c5fe6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 14:59:43 +01:00
Adrian Freihofer 4255b32738 wic: Add plugin for single partition disk
The wic plugin creates a disk image containig one ext2/3/4 partition.
No additional boot partition is required. Syslinux is installed into
the image. The target device is a legacy BIOS PC.

Purpose of this plugin:
Other avaliable plugins create a fat partition for /boot and an ext
partition for rootfs. Current linux-yocto kernel packages are not
compatible with this disk layout. The boot partition is not mounted
by default, hence the kernel is installed into rootfs and not into
boot partition. A kernel update ends up in a bricked device. The old
kernel which is still in boot likely does not even boot with updated
kernel modules from /. Even if the boot partition is mounted during
the kernel update the update will fail. The kernel package installs
a symbolic link which is not supported by the fat partition.
Creating just one ext partition for boot and rootfs solves all issues
related to package based kernel updates on the device.

The plugin depends on syslinux-nomtools a user space installer for
syslinux on ext filesystems.
Thanks to Robert Yang who implemented syslinux-nomtools and supported
the implementation of this plugin.

(From OE-Core rev: 4a7bd79b5100a496c9b1597b57d6dc18ba2b9c83)

Signed-off-by: Adrian Freihofer <adrian.freihofer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03 11:43:49 +01:00
Paul Eggleton fa61a9468b recipetool: allow specifying SRCREV via rev= in URI
Provide a means to set SRCREV immediately by using rev= in the URI; if
it is specified then it is removed before setting SRC_URI and SRCREV is
set to the same value instead.

(From OE-Core rev: c9304fcb0a2b81700d0ed5c13b4d976bd4230ce3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:50 +01:00
Paul Eggleton 4502daefb8 devtool: add: use the appropriate file naming and versioning for SCM recipes
* Recipes that fetch from git, svn or hg by OpenEmbedded convention
  should normally be named with this as a suffix, since PV is meant to
  be set appropriately within the recipe, so follow this. In order to
  make this work we need to be able to have the version independent from
  the file name, so add a -V option to recipetool create to allow this
  to be specified.
* If -V is specified on the devtool add command line, ensure at PV gets
  set to include this version.

(From OE-Core rev: 2b997c41c6476a13bf516586d56a9051aceb93ec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:50 +01:00
Paul Eggleton 266ea28183 devtool: add: add an option to fetch remote source
Add a -f/--fetch option to fetch a remote URI (into the already
specified source tree path) and set this as SRC_URI within the recipe.
This simply wraps around the existing functionality in recipetool.

Implements [YOCTO #7644].

(From OE-Core rev: f22fd77e735fc5f4a3434e3d1f567a9d7d191cf4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:50 +01:00
Paul Eggleton a4fca1d523 recipetool: ensure git clone is standalone when extracting
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 rev: fc47e8652ef32e7399f57c80593df90dc52d8b84)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:50 +01:00
Paul Eggleton 24e5ad268c recipetool: avoid second-level subdir when extracting
When -x was specified, we were getting the normal unpack subdirectory
which we don't really want - if there's only one subdirectory unpacked
then we should effectively copy just it to the extraction path, not as a
subdirectory under it.

(From OE-Core rev: 0eeecce96a0aa757c2c4c4ac4d82e3bcbf0f982c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:49 +01:00
Paul Eggleton 216d26aac2 devtool: update-recipe: check if source tree is a git repository
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 rev: eb2147aa8facd4ef33a0749e9ae660ec686dad48)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Paul Eggleton d6cd355def devtool: update-recipe: handle unversioned bbappends
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 rev: 3332d68ef7b2a300ce8dcf5021497d98e5b17baa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Paul Eggleton 1d4069255b devtool: reset: avoid errors in case file no longer exists
If you manually delete files in the workspace layer (which you really
shouldn't) it was possible to get yourself into the situation where you
couldn't reset because we were attempting to check if the file had been
modified and erroring out if it couldn't be opened. If the file's not
there anymore there's not much point checking if it needs to be
preserved, just skip it.

(From OE-Core rev: d2d352f7b747a97a54df9d20eb1455d166aa1ee3)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Paul Eggleton e8db1ccef3 devtool: add: use correct bbappend file name with -V option
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 rev: bdbeff0cd342e31053d7203d78fc5dda611052b1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Markus Lehtonen ca1f4d7279 devtool: include bbappends in recipe parsing
In order to get correct metadata, SRCREV for example.

Fixes [YOCTO #7648].

(From OE-Core rev: 8b1794559dd7fd956716179d628e61cffdce1686)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Markus Lehtonen 240b4ef3c6 devtool: modify: implement --no-same-dir
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 rev: 5cc348c0a3016e4ccc1e80d099e2e197b3b38bd2)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:51 +01:00
Markus Lehtonen ee0ff82b56 devtool: modify: use B=S if that is the default for the recipe
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 rev: 6ac5692426956e276ba2119f917b0f30791e6cd6)

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>
2015-04-27 15:05:51 +01:00
Ed Bartosh f2a0a98523 wic: code cleanup: wildcard imports
Here is what PEP8(Style Guide for Python Code) says about this:

Wildcard imports (from <module> import *) should be avoided, as they
make it unclear which names are present in the namespace, confusing
both readers and many automated tools.

(From OE-Core rev: 13416c1941f5dc8abcdb0073f2104a89eae2d6f1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:55 +01:00
Ed Bartosh 1d0c3387e8 wic: code cleanup: undefined variables
Fixed forgoten imports Wic_PartData and ImageError.
Removed unused and undefined variable syslinux_conf.

(From OE-Core rev: db0903ad89dcb655c0eec5ac6dce96aae26533da)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:55 +01:00
Paul Eggleton 5b1a6abcde devtool: force use of bash when running build within extensible SDK
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)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24 11:06:54 +01:00
Markus Lehtonen d7a9b5ea55 devtool: call parse_recipe with correct arguments
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 rev: 7d2b918019b0afe215a6489dad697afac34f73e9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-19 13:34:43 +01:00
Ed Bartosh e9fcc57071 wic: Print bitbake error output
Added bitbake error output to wic error message to make it
more descriptive.

[YOCTO #6911]

(From OE-Core rev: f68576d4c9cecbe7122325d7fc78c9b27ff07a8e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-14 12:38:50 +01:00
Ed Bartosh ea07f0325c wic: use native parted
Used exec_native_cmd instead of find_binary_path to run parted.
Got rid of find_binary_path as it's not used anywhere else.

There are several tools wic is trying to find not only in sysroot,
but also in host root. Parted is a special as on some distros it's
installed in /usr/sbin, which is not in the user's PATH. This makes
wic to fail with error "External command 'parted' not found, exiting."

[YOCTO #7122]

(From OE-Core rev: 76adf38c0d8e0faf04a5ecb3fcfbe831c85bb81f)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-14 12:38:49 +01:00
Ed Bartosh d0d0ab85c4 wic:code cleanup: No space allowed
Fixed pylint warning
  'No space allowed around keyword argument assignment'

(From OE-Core rev: e07dd9b9c71960fbeded162ed52fbce06de620e9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13 22:33:20 +01:00
Ed Bartosh 16d8c895a4 wic: make error message more informative
Included name of the missing program into the error message produced
by exec_native_cmd when program is not found.

Removed mentioning of the host programs as this API is not running
them anymore.

(From OE-Core rev: 7d1599cf6a55d3624d2b90c1f55e14c4df73e570)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:26 +01:00
Ed Bartosh 024514037d wic: don't use host paths when looking for native tools
exec_native_cmd should not use host paths in $PATH to
avoid finding and using host tools.

[YOCTO: #6204]

(From OE-Core rev: fa263f238bbddb00c9953994fb69cc358170e2ec)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:26 +01:00
Ed Bartosh 2dc30249ba wic: Implement --build-rootfs command line option
-f/--build-rootfs option makes wic to run bitbake <image> to
produce rootfs. This option requires image name to be specified
with -e/--image-name.

(From OE-Core rev: 75ae0b7cf3863eb2857a2b6a7073beea626f751d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:53 +01:00
Alexandre Belloni 939fca9de2 wic: support ontrackdm6aux3 partitions
ontrack dm6 aux3 is a type of partition required to be able to boot a Freescale
mxs based platform.

(From OE-Core rev: aa2d05c58992810a5f816eef8078facf03a07e3c)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:52 +01:00
Alexandre Belloni 8bf5afb118 wic: rawcopy: ensure comparison is done on int
The size comparison may fail because it is done on strings rather than
integers.

(From OE-Core rev: 2ef885329cfd0351f551a33dcf3f42e25f38dea7)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:52 +01:00
Ed Bartosh dd6a1525ec wic: code cleanup: unused imports
Fixed pylint warning 'Unused import'

(From OE-Core rev: dfde8bdae3ae151ffed5777b920d24c774e5da2c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09 07:43:52 +01:00
Tom Zanussi 369932178f yocto-bsp: Update templates to 3.19 kernel
Add 3.19 kernel support and remove 3.10 and 3.17 support.

'Fixes' [YOCTO #7391].

(From meta-yocto rev: fe9b3c567230e815f528431f1098626669a9568f)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-24 10:06:03 +00:00
Paul Eggleton 0a45ccb253 recipetool: fix duplicate licenses being picked up
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.

(From OE-Core rev: 58316a2890782d206e9b9472ba483367f7560109)

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>
2015-03-20 11:27:49 +00:00
Paul Eggleton 8123b4aa62 devtool: deploy-target: add dry-run option
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>
2015-03-20 11:27:47 +00:00
Paul Eggleton 3d7777f061 devtool: deploy-target: add an option to disable quiet mode
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>
2015-03-20 11:27:46 +00:00
Paul Eggleton 3f370f8f6f devtool: deploy-target: detect and error if D is empty
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>
2015-03-20 11:27:45 +00:00
Paul Eggleton ad57dab31f devtool: deploy-target: allow disabling host key checking
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>
2015-03-20 11:27:45 +00:00
Paul Eggleton cb4b07838c devtool: modify/extract: prevent usage with incompatible recipes
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>
2015-03-20 11:27:45 +00:00
Paul Eggleton 221705f014 devtool: modify: get correct initial revision from previously extracted 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>
2015-03-20 11:27:44 +00:00
Paul Eggleton 9adae67e71 devtool: reset: add ability to reset entire workspace
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>
2015-03-20 11:27:44 +00:00
Paul Eggleton e3cfb80f1e devtool: name command line parsers appropriately
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>
2015-03-20 11:27:43 +00:00
Paul Eggleton 4424440f42 devtool: deploy-target: fix deploying to previously deployed machine
* 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>
2015-03-20 11:27:43 +00:00
Ed Bartosh 35fbb0f470 wic: Consider PSEUDO_* environment variables
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
(From OE-Core rev: cd121c06e9de8951d507998be443f95f0edc246a)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:03:45 +00:00
Alexandre Belloni 1aa32a115a wic: rawcopy: support skipping
Add support for skipping the beginning of a file with the rawcopy
plugin.

(From OE-Core rev: 89db37c85ac0d0035dbeb9643d7802ca28681e76)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-10 10:47:42 +00:00
Alexandre Belloni 5e2dd63d2b wic: add fsimage plugin
The fsimage plugin allows to add an already existing filesystem image in
the partition layout.

(From OE-Core rev: b49e5af8c6ef0abaabce36e5e7d8ddc399e02f53)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-10 10:47:41 +00:00
Alexandre Belloni 0393438b94 wic: fix fstab generation
Commit 0a6668f6e60b4195ff4163c00fc972bacdb27b4b still included some
debug and is not working properly as the new fstab is generated too
late.

(From OE-Core rev: eea80d25c0902bb16ed3425888857d3cc5486376)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-10 10:47:41 +00:00
Paul Eggleton 122ee11bd1 devtool: fix broken clones of git recipes
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>
2015-02-23 17:35:29 +00:00
Paul Eggleton e7744de454 devtool: support source extraction for recipes that use a shared workdir
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>
2015-02-23 17:35:29 +00:00
Paul Eggleton 62a41b412f devtool: modify: handle recipes that use a shared workdir
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>
2015-02-23 17:35:29 +00:00
Paul Eggleton e2ce29fef2 devtool: prevent extract/modify use with image recipes
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>
2015-02-23 17:35:29 +00:00
Paul Eggleton efedd4323b devtool: update-recipe: add handling for git recipes
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>
2015-02-23 17:35:29 +00:00
Paul Eggleton e5bf4ed333 devtool: build: run do_populate_sysroot instead of do_install
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>
2015-02-23 17:35:28 +00:00
Paul Eggleton 845efa450c devtool: reset: run bitbake -c clean on recipe
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>
2015-02-23 17:35:28 +00:00
Paul Eggleton 8e7437b3f0 devtool: add/modify: add option to build in same directory
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>
2015-02-23 17:35:28 +00:00
Paul Eggleton 5eb9ffe1e0 recipetool: fix regression caused by previous commit
Option was renamed in the setup code but not in the code that used it.

(From OE-Core rev: 4b4f2d4f2869d6d5d564cc1b2d733f41ab5a3b9b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-23 17:35:27 +00:00
Tom Zanussi b4a936a938 wic: Fix kernel dir location
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].

(From OE-Core rev: 453d0a9823665870e273a37657d6e27fb788d72e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21 22:05:35 +00:00
Alexandre Belloni 8102bd0172 wic: add GPT support
Add GPT partition table support.

(From OE-Core rev: a3479ab45d89273b4474ca54517554fc5346da32)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:59 +00:00
Alexandre Belloni fa818fbb7b wic: properly label filesystems
Use the partition label option, when available, to label the filesystem.

(From OE-Core rev: 93e2de4f4b71775d70ac2ccb7e2d26ca95b96186)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:59 +00:00
Alexandre Belloni 5c056356bc wic: fix empty btrfs partitions
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.

(From OE-Core rev: 2624f30dd2d2a8f7fd97117c77a4d6aa2ba6f1f9)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:59 +00:00
Alexandre Belloni 4dce5c44ab wic: remove useless calls to __write_fstab
__write_fstab() is already iterating over parts. There is now need to
call it fort each parts.

(From OE-Core rev: 0a6668f6e60b4195ff4163c00fc972bacdb27b4b)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:59 +00:00
Alexandre Belloni cf3e21e71e wic: allow to configure overhead factor per partition
Introduce a new option --overhead-factor to replace
IMAGE_OVERHEAD_FACTOR.

(From OE-Core rev: 20fe0c7202724187dbe80eb2101d8ef69e86b94e)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni d84742c39f wic: allow to configure extra space per partition
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.

(From OE-Core rev: 9f7fe71a10bcdd1864d2f838f3510e96810ef42e)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni 605627bc9d wic: add rawcopy source plugin
(From OE-Core rev: 5f237238a1fab87668068d042ac86b67d2c5224b)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Alexandre Belloni 0b156dac83 wic: allow creation of partitions not in table
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.

(From OE-Core rev: 233b631ece5ee14d057932c146327065064b5196)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-14 08:40:58 +00:00
Paul Eggleton a3dfb70b62 recipetool: improve command-line help
Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com>

(From OE-Core rev: 2c59b2b20c32577085645056e4cbf4f9c259e4d7)

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>
2015-02-08 08:00:27 +00:00
Paul Eggleton 943353707b devtool: improve command-line help
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>
2015-02-08 08:00:27 +00:00
Alexandre Belloni eba9f8a16d wic: bootimg-partition: Stop removing whole workdir
Stop removing the whole working directory as this is also removing
eventual previously created partition images, leading to image creation
failures.

(From OE-Core rev: 2d3c9f89852bd009fc7accee495ede2fbcadc3bb)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:27 +00:00
Alexandre Belloni 080e3e4f58 wic: print partition alignment when available
When printing a partition, the --align parameter was shown when present
but not its value.

(From OE-Core rev: 26280cf0199abb3266d620c8dee1194504a5a829)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:27 +00:00
Alexandre Belloni 602d90d57a wic: use kB for the partitions size
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.

(From OE-Core rev: 3d4da9186016d54b76ad2fa710646de253f0f063)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:27 +00:00
Maciej Borzecki 09fba50cf3 wic: bail out on kickstart parse errors
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.

(From OE-Core rev: 0aa1221c16e65b3daac4aa9a9cfe1d5e9e6106c0)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:26 +00:00
Maciej Borzecki 6b19a93f38 wic: fix extended/logical partition layout
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.

(From OE-Core rev: a8b85f7878726503dbfa2e9ea86bd6fd961bf03b)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-08 08:00:24 +00:00
Tom Zanussi 02a1e01c00 yocto-bsp: Add branch to SRC_URI for custom kernels
Without 'branch' in the SRC_URI, a SRCREV specified for a non-master
KBRANCH will result in a fetch failure since the branch tested by the
fetcher will default to master, which doesn't contain the SRCREV.
This fixes the problem by adding branch=KBRANCH to the SRC_URI.

Fixes [Yocto #6518].

(From meta-yocto rev: 29a36d4c1146f38b4d204b5b4b89bd002074d47d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-07 13:34:00 +00:00
Tom Zanussi bf6f35b214 yocto-bsp: Add missing conf dir to arm template
The /conf dir for arm was missed when committing the changes for the
'removing strange characters' patchset; this restores it.

(From meta-yocto rev: 0fe51b37c32569bd5a3e24c43dc4d16ab7b6d4e9)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-07 13:33:59 +00:00
Paul Eggleton 3f739a86a9 recipetool: replace version in S value
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.

(From OE-Core rev: 0b3c81ed5bcce9b608c4f804496d769288fe8c04)

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>
2015-02-03 14:53:50 +00:00
Christopher Larson 1b7b58ac97 recipetool: add python dependency scanning support
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.

(From OE-Core rev: cb093aca3b78f130dc7da820a8710342a12d1231)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:28 +00:00
Christopher Larson e490d79fb7 recipetool: add python buildsystem support
- Handles distutils & setuptools.
- Supports pulling metadata from PKG-INFO, .egg-info, & setup.py (via two
  different mechanisms).
- Doesn't handle python 3 yet.

(From OE-Core rev: 6ff693c71d97b4bcfde198c84cf9fac7185cccfd)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-23 11:36:28 +00:00
Maciej Borzecki 052c67c845 wic: account for mmcblk device partition naming
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.

(From OE-Core rev: e2664f563921467fe38bb74f4dd2a41eb004ee9f)

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-25 08:18:13 +00:00
Junchun Guan 0d686ccc7c scripts/devtool: Support deploy/undeploy function
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>
2014-12-23 10:18:16 +00:00
Paul Eggleton cd5ca4a11d scripts/devtool: add development helper tool
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>
2014-12-23 10:18:16 +00:00
Paul Eggleton b7d53f2ebb scripts: add scriptutils module
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.

(From OE-Core rev: a8f90528981127fbace3e901c6e3dfe8b45b98ab)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23 10:18:15 +00:00
Paul Eggleton 5638ca2b94 scripts/recipetool: Add a recipe auto-creation script
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]

(From OE-Core rev: fa07ada1cd0750f9aa6bcc31f8236205edf6b4ed)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23 10:18:15 +00:00
Maciej Borzecki cff6c481aa wic: add globbing support in IMAGE_BOOT_FILES entries
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.

(From OE-Core rev: 2c9635bdb97ddc80750c11d356e153a99d61cf09)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19 18:08:02 +00:00
Maciej Borzecki 90487dfbbb wic: IMAGE_BOOT_FILES format checks in bootimg-partition source
Check for malformed entries in IMAGE_BOOT_FILES, fail early if such
entries were found.

(From OE-Core rev: e56072aaaad6cfa222853a4e9e68dd8aa861de18)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-19 18:08:02 +00:00
Tom Zanussi fb760054d4 yocto-bsp: Get rid of 'strange' filenames in x86_64 templates
For the x86_64 templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: d478b11db66795040009e9b7d7751300d4385018)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:09:01 +00:00
Tom Zanussi 82e8b73d78 yocto-layer: Get rid of 'strange' filenames in templates
For the yocto-layer templates, give all the 'strange' template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: 0aa76b36ccb8262a7eec62845361c3d4b73ceb46)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:09:00 +00:00
Tom Zanussi 4b4eca1359 yocto-bsp: Get rid of 'strange' filenames in powerpc templates
For the powerpc templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: c21329385f93bd876ef675ee453627910b4d5dec)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:59 +00:00
Tom Zanussi debb440be5 yocto-bsp: Get rid of 'strange' filenames in mips64 templates
For the mips64 templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: 8bc26cbfe2da0d6ffd08ecdce36fd50622bb1fad)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:59 +00:00
Tom Zanussi 4b82dab822 yocto-bsp: Get rid of 'strange' filenames in arm templates
For the arm templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: fb533fd98678671d319e52fc288783bbd0368218)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:58 +00:00
Tom Zanussi 6a103322f8 yocto-bsp: Get rid of 'strange' filenames in mips templates
For the mips templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: afa61438aa31fbc5c87991c8b3ec88c228b9d2d1)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:57 +00:00
Tom Zanussi 37a6affc48 yocto-bsp: Get rid of 'strange' filenames in x86 templates
For the x86 templates, give all the 'strange' yocto-bsp template
filenames 'normal' names, adding new yocto-bsp-filename and
yocto-bsp-dirname tags for the new filename processing pass where
needed.

(From meta-yocto rev: 9fa30ad9cf1291a37d365515ec8d969fb4fd4aef)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:56 +00:00
Tom Zanussi cac5446989 yocto-bsp: Get rid of 'strange' filenames
Give all the 'strange' yocto-bsp template filenames 'normal' names,
adding new yocto-bsp-filename and yocto-bsp-dirname tags for the new
filename processing pass where needed.

(From meta-yocto rev: c66a5b2acb2e243b857e5eb31c1427af296b4c9d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:37 +00:00
Tom Zanussi ed99aeeb68 yocto-bsp: Add a processing pass to get rid of 'strange' filenames
Operating systems that can't handle filenames containing anything but
uppercase letters don't like to see 'strange' characters in filenames
such as the file and directory names yocto-bsp uses as part of its
templating mechanism.  To fix this, we essentially add another level
of metadata into the template files themselves rather than into their
names, and add a processing pass that internally gives us what we had
before.  Specifically:

  - strange characters in filenames are moved inside the files they
    apply to, to the first line of the file prepended with '#
    yocto-bsp-filename {{...}} filename | this'

  - strange characters in directory names are moved inside a new file
    of the same name but ending in .noinstall and with the first (and
    only) line of the file prepended with '# yocto-bsp-dirname {{...}}
    dirname'

If the new filename contained in the yocto-bsp-* tag is 'this', the
filename is the existing name of the file.  For a dirname, this would
be the filename with .noinstall removed.

"Fixes" [YOCTO #5312].

(From meta-yocto rev: 3dad2decbd682713f717950fc39fa0f63f1b8c98)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-18 10:08:37 +00:00
Tom Zanussi bf0ec70284 yocto-bsp: Add mips64 support
mips64 support was recently added to the core BSPs; we should also
support it in yocto-bsp.  [YOCTO #5314]

(From meta-yocto rev: 3f3d29e2df6462c915d0763ab07f3be3c739ca4d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:00:22 +00:00
Tom Zanussi 0cc9a12ff8 yocto-bsp: Update templates to 3.17 kernel
Add 3.17 kernel support.

(From meta-yocto rev: cdebafc6f87ae635769cf93787c97caa8e58e13e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-05 18:00:21 +00:00
Martin Hundebøll c0dafd3101 scripts: use '/usr/bin/env' in shebangs with python
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|'

(From OE-Core rev: 6d3de22a19657a413e01d7bb5fd74d16c00dc696)

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-11-12 15:38:29 +00:00
Tom Zanussi fcf56083b9 wic: Update bootimg-partition to use bootimg_dir
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.

(From OE-Core rev: 3822f8a7b33da56ecd9144b4bcae50734fb1af81)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:41 +00:00
Tom Zanussi 42d0334aa8 wic: Remove special-case bootimg_dir
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.

(From OE-Core rev: 6ba3eb5ff7c47aee6b3419fb3a348a634fe74ac9)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:41 +00:00
Tom Zanussi 38400617fe Revert "wic: set bootimg_dir when using image-name artifacts"
This reverts commit 7ce1dc13f9.

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]

(From OE-Core rev: db90f10bf31dec8d7d7bb2d3680d50e133662850)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:41 +00:00
Tom Zanussi d1f8b8f5d0 wic: Update the help text to include -D (--debug)
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.

(From OE-Core rev: cf5144ef241d8f4ccaa3461ae5c9f89c2cf2f8d1)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:40 +00:00
Tom Zanussi 005d81da2b wic: Use overhead factor when creating partitions from rootfs directories
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].

(From OE-Core rev: bbaef3ff5833fc1d97b7b028d7770834f62789da)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:40 +00:00
Tom Zanussi 334f83a146 wic: Don't allow mkfs to fail silently in partition command
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].

(From OE-Core rev: 8cef3b06f7e9f9d922673f430ddb3170d2fac000)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30 13:03:40 +00:00
Hongxu Jia 9c218a319e wic/bootimg-pcbios.py: checking the existance of syslinux
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]

(From OE-Core rev: c2d4364d9fbbda64598f0a3eb0b0890932bb7742)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18 16:14:03 +02:00
Maciej Borzecki 7291691d3f wic: add sdimage-bootpart kickstart file
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

(From OE-Core rev: bb01a6be7b32aa675f5003a6012a60a081212e8c)

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-23 20:35:56 +01:00
Maciej Borzecki 6b03fc214f wic: add new bootimg-partition plugin
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.

(From OE-Core rev: 4a3200d710d953956064c28188577fbd461d093d)

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-23 20:35:56 +01:00
Maciej Borzecki 7ce1dc13f9 wic: set bootimg_dir when using image-name artifacts
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.

(From OE-Core rev: d7f69e6f0932a927b6ce289fb47ba575d7aaa1c8)

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-23 20:35:56 +01:00
Maciej Borzecki 48ff3fa3a5 wic: fix vfat partition sector count only if needed
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.

(From OE-Core rev: 99bee4cb489800d74dea4d2158ff834413685f04)

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-23 20:35:56 +01:00
Maciej Borzecki 0b3f477616 wic: use IMAGE_EXTRA_SPACE for vfat rootfs
Functions for generating rootfs use IMAGE_EXTRA_SPACE rather than
BOOTDD_EXTRA_SPACE. The latter is used in boot image source plugins.

(From OE-Core rev: 44abf447f8e4ed11cbbe53a4fb0ecf10a20f0f9e)

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-23 20:35:55 +01:00
Maciej Borzecki c94d8e93db wic: minor comment update
Update comment about types of generated partition images.

(From OE-Core rev: ba1503f77e0c03fe6c715b61983008b7a534ae20)

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-23 20:35:55 +01:00
Tom Zanussi 5bef32283f wic: Completely remove all urlgrabber references
The previous commit, 'wic: Remove 3rdparty/urlgrabber' didn't actually
remove all references to urlgrabber - this does however.

(From OE-Core rev: b4367af770611174d9de82c63c697d4347e30dcf)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10 11:33:25 +01:00
Maciej Borzecki 50fbf19a93 wic: do not realign aligned partitions
The change prevents additional realignment of already aligned
partition. Previously, even already aligned partitions would be pushed
forward by the amount of --align.

(From OE-Core rev: 92a1b83d928173a58280ca019ca81fdeb5ba72b5)

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-23 09:26:09 +01:00
Maciej Borzecki 5686b2d5a7 wic: do not steal sectors from the first partition
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.

(From OE-Core rev: c3251d4191fb0b7c3477a3579e542729598f6aad)

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-23 09:26:09 +01:00
Maciej Borzecki f12ac6101c wic: include partition label in fs image file name
Not including the label image but having multiple partitions of the same
type, the image file of one partition would overwrite the other.

(From OE-Core rev: acf2fb7c6dfa3217ffcbf9483c190057d9f41bbf)

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-15 18:21:53 +01:00
Tom Zanussi 072657ce98 wic: Add mkgummidisk kickstart file
This is the same as mkefidisk but uses gummiboot instead of grub-efi.

(From OE-Core rev: 5979409ebfab0bb07b3c2b2fcf14a722c441f07b)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi 32a5799b78 wic: Add sourceparams to mkefidisk.wks
The bootimg-efi plugin now requires a loader param, so supply it to
retain existing behavior.

(From OE-Core rev: ccef1385cb51ce2b9b75493b314e38599a8ae10e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi 6e328c94ae wic: Add gummiboot support to bootimg-efi
Add gummiboot support to bootimg-efi, which retains the existing
grub-efi support (though requires an update to the .wks file).

(From OE-Core rev: f1a81fcefa493540a9faac549fdd513b86f8f497)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi 8d0185f4f8 wic: Parse and pass sourceparams to partition plugin methods
Add code to parse the sourceparams and pass them to the partition
plugin methods.

(From OE-Core rev: 769a6f920fb672c50d76bd4bdea4a65fdc18a7b3)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi e00e902fc7 wic: Add sourceparam param to partition plugin methods
The sourceparam param allows source plugins to be parameterized
generically (via --sourceparams="key=val[,key=val], implemented
previously).

(From OE-Core rev: 2abbcc843ba888782f6d68748d930c81e6ae7040)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi ef700ea11f wic: Add utility function for parsing sourceparams
Parses strings of the form key1=val1[,key2=val2,...] and returns a
dict.  Also accepts valueless keys i.e. without =.

(From OE-Core rev: 36f258ee6e60c26fd44b9bc71c318363cec71f42)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi 3c90ee9bc2 wic: Add '--sourceparams' partition option
To go along with '--source' as a way to parameterize source plugins.

(From OE-Core rev: f5b9ef65453b3f66282c49f5e2584ad33ac6d2d7)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:52 +01:00
Tom Zanussi d942d2220c wic: Bump the version to 2.0
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.

(From OE-Core rev: d263cb055333e6432454a13403eda471c514a3e6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi d8f9d05bae wic: Rename /mic to /wic
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.

(From OE-Core rev: 598b120406dc1d2b7e377bd1ab6f0acbef034b22)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi a43c1f9420 wic: Update Disk description
Remove obsolete comment.

(From OE-Core rev: d39c76f24a50c9359840c0959fb50fc6da0960cd)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi ff1aa2358e wic: Rename MountError
wic doesn't mount anything, so can't have a mount error; rename it to
something more appropriate.

(From OE-Core rev: e1edee656fc9c0a791c0eb62796d1afa483be34e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi 312479cf07 wic: Rename PartitionedMount
It's actually a container for disks and partitions, and wic doesn't
mount anything, so rename it to match what it really is.

(From OE-Core rev: 28c5249b4df46ba3ac227d0c4dc6e545b40dbaf3)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi 28453ae63c wic: Update/rename configure-related code
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.

(From OE-Core rev: 58dc8879bba31542e2386aaaa70034621b2b1e4e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi d02c91fe4d wic: Update/rename install-related code
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.

(From OE-Core rev: b4232041534a79236eb8d8ab5c0024a0ef4da649)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:12 +01:00
Tom Zanussi 467bf7e68f wic: Update cleanup/unmount-related code
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().

(From OE-Core rev: 1b103bf4a7c7527d4fc57bad1bbd1d5a5bbddb4a)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi 4d1f5ee6d1 wic: Update/rename/delete mount-related code
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.

(From OE-Core rev: 94e15c18c011b0d7d71276cd4566be2417c2c6be)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi bd0dd4489e wic: Remove Mount object
It doesn't do anything we need, so remove it and fix up callers/base
classes.

(From OE-Core rev: fb2a162d8756ab69c9c29a0715b033f18620341d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi d74e7d3fa6 wic: Remove unused conf support
Also fix up users such as imager functions.

(From OE-Core rev: eb77b9c11bd9b8dc90aacfbd5b5bc5568a233525)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi 554feeebe0 wic: Update 'Background and Motivation' help section
Remove help text regarding the source and future intentions of the wic
codebase, since the code prompting those comments has now been mostly
removed.

(From OE-Core rev: dfa8626700269141f8d2f5be12c8758db7ca6473)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi 02ebd15c62 wic: Remove unused command versioning support
The default is F16 and there's no reason to change that, so remove
everything else.

(From OE-Core rev: e0ec12d012e568c9943614fc1190c143912180b3)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi 8678a6eb02 wic: Clean up Creator
wic doesn't use a lot of Creator, so remove it.

(From OE-Core rev: ef6bc7a3b58ba8b9c94f4c1e41c0f6d7d51c0bf5)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi f12336aa4a wic: Clean up PartitionedMount
wic doesn't use a lot of ParitionedMount, so remove it.

(From OE-Core rev: 0f793ff0767b0cce032c20b677974806c65610d6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:11 +01:00
Tom Zanussi 1601821636 wic: Clean up DirectImageCreator
Remove what wic doesn't use from DirectImageCreator.

(From OE-Core rev: dbbe6d04f6c606c94ff17151aee1214e4e24ce7d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi 6c6c96afb6 wic: Clean up BaseImageCreator
wic doesn't use a lot of BaseImageCreator, so remove it.

(From OE-Core rev: 6bd95c24b44fa80ac9d5950bf2d925f18f671290)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi df42125f2c wic: Remove unused plugin and error code
wic doesn't use it, so remove it.

(From OE-Core rev: b818e5a1ed047940fda533da73fc50a099e1aa3f)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi 946dbec4eb wic: Remove gpt_parser
wic doesn't currently use it, so remove.

(From OE-Core rev: d3a490d5421405bf9e002c6c65ffb831ea6b767e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi 5a8bcfb562 wic: Remove unused 3rdparty/commands
wic doesn't use anything but partition and bootloader, so remove the
rest.

(From OE-Core rev: b6ae106b5d28180a5890e837c87f3e91e5917638)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi c9b5ea0873 wic: Remove 3rdparty/urlgrabber
wic doesn't use it, so remove it.

(From OE-Core rev: 00dcdb29c89634ab267d328eb00f8eb70c696655)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi ba19b60fd2 wic: Remove unused misc code
wic doesn't use it, so remove it.

(From OE-Core rev: 84e1e13ce3af216e304f61c7ea6e5e9338f94bc6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:10 +01:00
Tom Zanussi f0499a07b5 wic: Remove unused fs_related code
wic doesn't use it, so remove it.

(From OE-Core rev: e18d5393a556e1ff4826c1e5b1a75f4ac998b10e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi 93a60f7e99 wic: Remove rpmmisc
wic doesn't use it, so remove it.

(From OE-Core rev: a49b39ddf18b1b058c0a892e1a7450239eea66ce)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi ac2d312f81 wic: Remove proxy support
wic doesn't use proxy support, so remove it.

Also remove anything related to proxies in misc and conf, and while
we're at it, remove all the obviously unneeded code from those files -
it's easier to just remove it than to figure out the callchain to the
proxy code usages.

Basically the extra stuff relates to packaging, images, and config
files we don't use.

(From OE-Core rev: 041f9e2ca52681cd6f5c2fb804dd45f05358c9f9)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi 29fb556a88 wic: Remove grabber implementation
wic doesn't need to grab any urls, so remove it.

(From OE-Core rev: 55f8df07d82724b6d7ed694158ca6e9a5266cbc4)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi d9096a659e wic: Remove fiemap support
wic doesn't use it, so remove it.

(From OE-Core rev: b732ad616ca20dfc4adb845b68ae3378624a0a4d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi aac322317a wic: Remove bmap support
wic doesn't use it, so remove it.

(From OE-Core rev: 69f16c7582660a3bcf4106668e548b4c789ae251)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi a9351096db wic: Remove mic package managers
wic doesn't use the yum or zypp package managers, remove them.

(From OE-Core rev: ef70b961b6b8f3a004036f84b608665db2085215)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi f1dbd46e7e wic: Remove rt_util
More package-related stuff we don't need.

(From OE-Core rev: 167cb99af427510bb6d72e89478c62a804db125c)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:09 +01:00
Tom Zanussi c0aa6cb8fe wic: Remove mic chroot
mic chroot allows users to chroot into an existing mic image and isn't
used by wic, so remove it.

Removing chroot.py leads in turn to various plugin-loading failures
for a number of plugins that wic doesn't use either, so remove those
as well.

The existing source plugins refer to chroot but don't use it, so fix
those up.

(From OE-Core rev: d73230306b827972cdc99f21d247c54d5d7c0b6d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:08 +01:00
Tom Zanussi d2120000df wic: Remove mic bootstrap
packaging bootstrap, not needed

(From OE-Core rev: 980c8faf01fa59ce3922cbad3363a6c2f759d30e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:08 +01:00
Tom Zanussi bd9b9345dd wic: Remove packaging, config commands
Remove commands related to repos, packaging, configuration

(From OE-Core rev: 2b002ab75473578f06f161be0b48670fba26994e)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:08 +01:00
Tom Zanussi 36f4edec65 wic: Remove unused custom commands
installer, repo, desktop-related stuff

(From OE-Core rev: 26e909682fffb8ae6062d1e8295b6421f1f716ad)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:08 +01:00
Tom Zanussi 68e6adf2df wic: Make exec_cmd() error out instead of warn
The reason exec_cmd() warns but doesn't error out (broken parted)
doesn't really make sense, since the parted invocations don't even use
exec_cmd().  It really should just fail since by not doing so it's
actually enabling invalid images in some cases.

Also, since the return code is now always zero, there's no point in
having a return code, so remove it.  This represents a change in the
API, so we also need to update all callers.

(From OE-Core rev: a10bbd39eee29cc49d258bf08aaec279c3115c66)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:08 +01:00
Tom Zanussi 463c9f4d3a wic: Various typo/grammar fixes to wic help text
This is a set of miscellaneous help text updates noticed while
transcribing wic help for the dev manual.

(From OE-Core rev: d4b350fcdedf29692673e09a0c1850cdbbe29739)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:13 +01:00
Tom Zanussi b7528a4bc1 wic: Add squashfs to --fstypes documentation
squashfs support was recently added to wic, so document it.

(From OE-Core rev: c04043e143932fe2ea38f87d2faa8beed007671b)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:13 +01:00
Tom Zanussi dcf7d981a2 wic: Add documentation for --fsoptions
--fsoptions support was recently added to wic, so document it.

(From OE-Core rev: e2d87ad57f8aa74e748ba95f6a801a2ca665ecc4)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:13 +01:00
Tom Zanussi 3e237b177b wic: Fix plugin help text
Fix various typoes and grammar problems noticed while transcribing for
the dev manual.

(From OE-Core rev: 79fb7d9b5a28810e3adfaf5cba0c2298810253e9)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:13 +01:00
Maciej Borzecki 09def7a78c wic: do not overwrite autogenerated /etc/fstab with original too early
DirectImageCreator.__write_fstab() generates new /etc/fstab in sysroot
with rootfs contents. The fstab entries are generated base on the
initialn contents of /etc/fstab, plus any extra (other than / or
/boot) partitions listed in *.wks. A backup of original /etc/fstab is
done in a temp location. Subsequent call to __restore_fstab() restores
the backup copy, replacing the autogenerated one.

Calling __restore_fstab() before Wic_PartData.prepare() brings back the
original fstab before the partition image file actually is created. As
such, the autogenerated /etc/fstab will not make it to the partition.

(From OE-Core rev: a9e59d7b1fa1ed33ce9678fb77a367800d7a8f87)

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-07-26 09:01:05 +01:00
Maciej Borzecki 73ce04eb6d wic: squashfs partition support
It is possible to instruct wic to create a squashfs partition by setting
--fstype=squashfs in *.wks. For now this is only useable for rootfs
partitions (note that you must have squashfs support in the kernel). An
attempt to create an empty partition will produce a warning.

(From OE-Core rev: 30266a0be946bd0ce76d6920e7afe840c6c3bf80)

Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-25 16:54:43 +01:00
Maciej Borzecki 5e7de54d3d wic: --fsoptions handling
Add handling of --fsoptions in parition definition. If no options are
specified, 'defaults' is used.

(From OE-Core rev: e91c0db15db74237606fae96c9b7d21936519a86)

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-07-25 16:54:43 +01:00
Tom Zanussi 063ee04d47 wic: Remove fstype from mkefidisk canned wks
The bootimg-efi plugin specifies the fstype internally, so remove it
from the partition definition.

(From OE-Core rev: e9365e9d9e8a8696849fda182ec260398059089a)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 21:59:16 +01:00
Tom Zanussi aec05b6bf8 wic: Add help entry for wic kickstart
Previous patches added help for 'wic kickstart' but forgot to add an
entry in the main help page showing its availability.  Add an entry
for it.

(From OE-Core rev: 5aa212f990c3d9b90a4f06cea346b82fc5d376ba)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 21:59:16 +01:00
Tom Zanussi a0e7d58bc1 wic: Fix bad directory name in bootimg-efi
The original move of the mkefidisk code to the bootimg-efi plugin
resulted in a bad hdddir - fix it.

(From OE-Core rev: ab337705521d8734f12be612709e70a163111fe3)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-23 21:59:16 +01:00
Tom Zanussi eca8a56a4e wic: Error on zero-sized partitions
It doesn't make sense to create zero-sized partitions so assume user
error and notify the user they should be using a non-zero --size for
partitions that don't specify a --source.

(From OE-Core rev: 3231562c3c9f8173ddcc0812001aadf0988c8892)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:48 +01:00
Tom Zanussi d08c2ce0d6 wic: Add kickstart reference to help system
Add a 'wic kickstart' help section to make it easy for users to access
the kickstart reference without having to go to an external website.

(From OE-Core rev: 136137ec1c124aee89d2120abded60a5cf0562b0)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:48 +01:00
Tom Zanussi d8b65a55d2 wic: Add wic overview to help system
Add a general overview of wic to the help system as 'wic overview',
along with some introductory examples.

(From OE-Core rev: fa108caaa53878152e4856d32ce1ab7fe3802287)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:48 +01:00
Tom Zanussi 83e5c09d2f wic: Add vfat support
Add vfat as a supported rootfs type (in addition to the current
ext2/3/4 and btrfs support).

vfat partitions can now be created using --source rootfs along with
--fstype=vfat, or without --source but specifying a --size.

(From OE-Core rev: d9efc110fd73822629b2a3326761f2256b9f23b0)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:48 +01:00
Tom Zanussi f3986878ed wic: Error on parted non-zero error code
The current code uses msger.debug() to note errors, effectively
squelching them if --debug isn't used.  Apparently this is because it
can return non-zero for some loop device failures.  We don't care
about loop devices, and not paying attention to the error code
actually results in invalid images, so error out on parted failures as
we should be.

(From OE-Core rev: b1c68e5446080f0743f7f8a530f3b00f90c8717d)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-16 10:20:48 +01:00
Tom Zanussi d8ef35557e wic: Add general 'plugins' help topic
Add a category for help topics with an initial help topic discussing
source plugins.

(From OE-Core rev: a3dbe46dd28a6fd9e6c21f6bbb6a12578df9dff3)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:34 +01:00
Tom Zanussi b5dceca436 wic: Print error if a partition specifies an invalid --source
If a partition specified in a .wks file specifies a nonexistent
--source, print an error to that effect and exit.  The error text also
points the user to a command listing valid sources, and help on adding
a new source plugin.

(From OE-Core rev: 4dff6945d2606cebc0ab26e877c5d8c7b457e179)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:34 +01:00
Tom Zanussi 1908751b32 wic: Add help text for 'wic list source-plugins'
Add both short and long text for the new 'wic list source-plugins'
command.

(From OE-Core rev: 4f20acc10b18c7353bd73f253943372dacd957ca)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:34 +01:00
Tom Zanussi 40769b7cc0 wic: Add command to list available source plugins
Add a 'wic list source-plugins' command enabling users to get a list
of valid partition --sources.  This is useful not only for determining
sources to use in .wks partition statements, but also for making sense
of errors in .wks partition processing.

(From OE-Core rev: 37db9423e7872012fabde67e8858db5b512832f6)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-10 17:38:34 +01:00
Richard Purdie 359f08766f yocto-bsp: Drop GLIBC_ADDONS setting
This has been copied and pasted around and is not needed, simply drop it.
The defaults in the recipe work just fine.

(From meta-yocto rev: 037bce9a5f196df3cded9dfe6200188c1dd1d84a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-04 09:12:35 +01:00
Richard Purdie 05c47cc68e yocto-bsp: Update qemu inclusion lists
Update qemu tune definitions to match changes in main qemu machines.

[YOCTO #6482]

(From meta-yocto rev: 0d78ffd509c6caba6c74c6e75c485fb8d923cd31)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-04 09:12:35 +01:00
Robert Yang 1adedecc0d scripts: fix no newline at end of file
Add a '\n' to the last line of the file to fix:

No newline at end of file

(From meta-yocto rev: 58cc5c502bd0309feed65ab7836ed8fbaab6ced9)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-07-03 13:57:12 +01:00