Commit Graph

1402 Commits

Author SHA1 Message Date
Ed Bartosh 9b97a0693b wic: release 0.2.0
Major changes in 0.2.0:
- implemented UUID support
- fixed support of GPT partition tables
- implemented running bitbake from wic
- implemented image compressing
- started testing with oe-selftest. implemented 17 test cases
- used native tools (parted, mkfs, mtools, etc)
- usability and documentation fixes
- code clenup

(From OE-Core rev: a0f8cb7e0ffa15e101d39463c77707c821250203)

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 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
Ed Bartosh da0f5037b6 create-pull-request: cd to relative directory
create-pull-request -d path creates empty patches if directory
is specified as a path, i.e. ./bitbake or ./bitbake/ or full path.
It behaves expected way only if script is run with -d bitbake, i.e.
relative dir name doesn't contain '\'.

Fixed this unwanted behaviour by changing directory and running
git format-patch in it with --relative, without specifying
relative path as a parameter.

(From OE-Core rev: 3042956a86167f89beccc5d05f1fad1844e7c36a)

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
Richard Purdie 0968e3a68b runqemu: Handle device names like tapX@NONE
ip list can return devices in the form tapX@NONE. If it does so,
ensure we handle that case correctly. Newer distros appear to do
this in some cases.

[YOCTO #8129]

(From OE-Core rev: 6459dde380febce24d2c355d441d9cb3b14409b9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:58 -07:00
Richard Purdie 8020a9e44f runqemu: Add error handling for unexpected tap devices
In theory the code reduces the tap device number to an integer. This
patch adds error checking to ensure that does happen and that the script
exits if something unexpected happens.

(From OE-Core rev: 4238f3b6e320969aaf539e6afb1cb2bfd61bb28b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:58 -07:00
Patrick Ohly 8b847ffd04 combo-layer: fix action_pull for unknown branch
When reconfiguring the branch to something not already fetched,
action_pull fails with
   error: pathspec '<new branch name>' did not match any file(s) known to git.

It is the "git checkout" which fails like that. To solve this,
try the faster "git checkout + git pull" first and only if that fails,
fall back to the slow "git fetch + git checkout".

In the conf.hard_reset case, do the checkout always after the git fetch.

(From OE-Core rev: ad4d3b1da190cf08c6ac5f9a94a2a1c4980a184d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:57 -07:00
Patrick Ohly b2a0c2fbd1 combo-layer: enhance output in action_pull
The git operations can fail, for example when the branch is unknown
or misconfigured.

Better move the info message and extend it such that it is printed
first and provides the necessary context, because otherwise the
CalledProcessError exception gets dumped without mentioning for which
component it occurred.

(From OE-Core rev: 00d01468a692faf4272894dd328e8c532bcf8b49)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:57 -07:00
Dominic Sacré b5e9dbbe82 python3: remove 2to3 symlink from package python3-2to3
The 2to3 symlink conflicts with its Python 2 equivalent in package
python-2to3.
The Python 3 version of the tool is still available as 2to3-3.4.

(From OE-Core rev: ff3633fa6a379d502f65b20d6a57d30c59f09ab6)

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:18 +01:00
Dominic Sacré 0b69680a33 python3: remove package python3-robotparser
robotparser has been moved to urllib.robotparser in Python 3, and gets
packaged as part of python3-netclient alongside the rest of urllib.
This causes python3-modules to depend on an empty/missing
python3-robotparser package.

robotparser.py is relatively small and has no dependencies outside
urllib, so it makes more sense to eliminate the python3-robotparser
package than to alter the manifest for python3-netclient.

Part of the fix for [YOCTO #8048].

(From OE-Core rev: 9e01909f3239f0a88e20f12e65b6141e547b114a)

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:17 +01:00
Christopher Larson 84ad12ead0 devtool: add --bbpath argument
(From OE-Core rev: a459b230387b34479212d54edeb3abf2b6274196)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 22:24:12 +01:00
Ed Bartosh 90bc2f35d0 create-pull-request: Implement -d option
This options allows to generate patches against relative directory by
using git format-patch --relative option.
See more details about --relative option in git diff manual page.

For example generating bitbake patchsets from poky can be
done this way: create-pull-request -u contrib -d ./bitbake

(From OE-Core rev: 9b544125e1e3d2cc2db8f5d20d6fd0746f8cef5d)

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-01 07:34:06 +01:00
Paul Eggleton 9a672bd569 devtool: use tinfoil shutdown method
Tinfoil now has its own shutdown method, use it instead of calling into
cooker - not only is it the right thing to do from an API perspective,
it also ensures proper lock handling.

(From OE-Core rev: c1f58caad4ff45efd213bf1412304a72903abe7e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:03 +01:00
Alexander Kanevskiy 405bb5b588 combo-layer: fix AttributeError traceback.
Commit c908a423f85a84ddd8249abd00254f29d47df74b introduced a new
issue in combo-layer that leads to a traceback as
args.hard_reset is an unknown variable. This change defines an
appropriate destination for the command args parser and fixes the
reference.

(From OE-Core rev: ac4ef551d506a5767946cf2fb717c2fd7f86df9c)

Signed-off-by: Alexander Kanevskiy <kad@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 12:09:42 +01:00
Richard Purdie dab511c36d gcc: Add support for nativesdk-gcc
Being able to build a nativesdk gcc is useful, particularly in cases
where the host compiler may be of an incompatible version (or a 32
bit compiler is needed).

Sadly, building nativesdk-gcc is not straight forward. We install
nativesdk-gcc into a relocatable location and this means that its
library locations can change. "Normal" sysroot support doesn't help
in this case since the values of paths like "libdir" change, not just
base root directory of the system.

In order to handle this we do two things:

a) Add %r into spec file markup which can be used for injected paths
   such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
b) Add other paths which need relocation into a .gccrelocprefix section
   which the relocation code will notice and adjust automatically.

This patch adds tweaks to the relocation script to handle the
new section too.

(From OE-Core rev: cd3d874fced2ee4c950d9964d30c0588fd8772e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:37 +01:00
Paul Eggleton 67a3807c4c oe-selftest: add scripts/lib and bitbake/lib to path
In particular, this allows us to use code from bitbake's bb module
(such as tinfoil).

(From OE-Core rev: 5ca91cd0b56eb2da80c781fb46ae0b600c3f1eb9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Christopher Larson 51d760e2a7 oe-selftest: add libdirs from BBPATH to sys.path
This ensures that oeqa.selftest.* from layers are found.

[YOCTO #7625]

(From OE-Core rev: 182b8ed9f26ed8b6a8eb6dcaec82db9aca14b010)

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 d2023c34e4 oe-selftest: obey oeqa.selftest.__path__
This ensures that all paths that hold selftest tests will be checked
(oeqa.selftest is a namespace package).

[YOCTO #7625]

(From OE-Core rev: 3c60cbced7b101ee52ce4a0a0bce542fd38f1821)

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 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 da02f483c4 recipetool: parse global args early
This separates the argument parsing into two steps, which lets us apply global
settings like enabling debugging before the plugins load, so we can see the
paths where plugins are being loaded.

(From OE-Core rev: 899288a1b255052a6ee0f97d42f8c4f0ec3c3140)

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 71366782d9 recipetool: also load plugins from BBPATH
This makes it easier to extend, as a layer can add its own sub-commands.

The bitbake path setup is moved earlier, as it has to be done before
tinfoil_init.

[YOCTO #7625]

(From OE-Core rev: 5753f20acc31d4d8d93069e3daccce1fad27b7ac)

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 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 e28c4ba7bf recipetool: catch BBHandledException from parsing
This ensures that we don't see a traceback on parsing failures.

(From OE-Core rev: 22ba003f62a321c3b8405a03d6c9ee04dc0a62a6)

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
Ross Burton 94c50ef8a9 Revert "create-pull-request: Fix error on 2.0 versions of git"
This breaks create-pull-request for git <2, which is many people.

This reverts commit 7ee64ea60ede5477b2f9a355d93bdc556e6b7895.

(From OE-Core rev: 26766ea8ee0ef121e54ff9084c4637aa8df984f4)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-21 23:53:45 +01:00
Cristian Iorga 77cd461edb runqemu-internal: add temporary disk interface to qemuarm64
Starting with qemu 2.4, a disk needs be attached via a specified
interface, even if that interface is none. In case of qemuarm64
machine, the board is virtual, so a none interface it works
correctly.

(From OE-Core rev: 7151dc110ef87518034fdcd7d85cbebdc76013ab)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:25 +01:00
Ben Shelton 6e8313de40 create-pull-request: Fix error on 2.0 versions of git
On 2.0 versions of git, the create-pull-request script exits with the
warning "No match for commit... Are you sure you pushed 'HEAD' there?".

This is due to a change in behavior where git used to guess the branch
you meant, but no longer does.  See the thread at
http://www.spinics.net/lists/git/msg233050.html for more information.

To accommodate the new behavior, if the COMMIT_ID is set to the default
of "HEAD", make it point explicitly to $BRANCH instead.

(From OE-Core rev: 7ee64ea60ede5477b2f9a355d93bdc556e6b7895)

Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:21 +01:00
Markus Lehtonen b0079ec5e9 combo-layer: implement --hard-reset option
This option causes combo-layer to do git fetch and hard reset instead of
git pull in the component repositories. This makes sure that the local
component repositories are always in sync with the remote - tolerating
force pushes and overriding any locally made changes.

(From OE-Core rev: c908a423f85a84ddd8249abd00254f29d47df74b)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:17 +01:00
Markus Lehtonen d1a1dbb8a5 combo-layer: only allow fast-forward when pulling
Only allow fast-forward merges in the component repositories when doing
git-pull. This makes it possible to spot problems (i.e. rewriting of
history) in the component upstream . Also, this change prevents the
creation of local-only merge commits in the component repositories.
These merges cause "last_revision" field of the combo-layer config to
point to a git commit that is only present in the users local component
repository but nowhere in upstream.

(From OE-Core rev: 5207169b9c6c4b05c6b043745905a5498adca1a3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:17 +01:00
Ash Charles 3f79bf7f6c python-io: Add runtime dependency on contextlib
The python-io package includes ssl.py module which imports the
contextlib library.

This applied to Python 2.7.9 but not 3.3.

(From OE-Core rev: b6b9df15a630605619bff060d5073272685058d6)

Signed-off-by: Ash Charles <ashcharles@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:16 +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
Puustinen, Ismo daec53e977 combo-layer: modified to generate better commit messages.
This patch includes support for a global section in combo-layer.conf
called [combo-layer-settings]. Supported in this section is key
"commit_msg"; its value is the template for the git commit message
that updates the last_revision. The template can include substitution
for the updated component list: ${components}. The substituted value
will either be a comma-separated list of components or "all components",
if combo-layer was invoked without component list argument.

If the key is not present, the old default value is used for the commit
message.

Configuration file example:

[combo-layer-settings]
commit_msg = pulled in the latest changes for ${components}.

(From OE-Core rev: fe84747f961772b61031af59d44e54b178148379)

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:22 +01:00
Daniel Istrate 75fa966d7c scripts/oe-selftest: Added mechanism for including/removing bblayers.inc
When oe-selftest starts it includes bblayers.inc into bblayers.conf
When oe-selftest ends it deletes bblayers.inc and the included line
from bblayers.conf

(From OE-Core rev: cf7bf27f565b34fdcd2caa25aaef068c0970965e)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +01:00
Cristian Iorga 7e074c3641 runqemu-internal: correctly set format for root FS as raw
qemu guesses via probing the format of root FS, but
gives a warning and restricts write operations on block 0.
Fix it by setting correctly the format as raw for more
machines and non-KVM machines.
In some cases, replaced the way machine disk is set for qemu.

Fix for [YOCTO #7918]

(From OE-Core rev: 6f7144ebe2da4c72ef58280e034b2cc75331a471)

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-07-02 23:08:39 +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 335aa0fee8 wic: Fix confusing error message
Wic throws this message when any of the build artifacts are
not provided:
  Build artifacts not completely specified, exiting.
    (Use 'wic -e' or 'wic -r -b -k -n' to specify artifacts)
It was not clear which artifact was not specified.

Reworked the code to specify list of missed artifacts.
Now the message looks like this:
  The following build artifacts are not specified:
    bootimg-dir, kernel-dir, native-sysroot

[YOCTO #7912]

(From OE-Core rev: 98912687f15f6d7537746fb38499f739e1a47be9)

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