Commit Graph

718 Commits

Author SHA1 Message Date
Leonardo Sandoval f2933cc5f9 yocto-bsp: Update templates to 4.1 kernel
Add 4.1 kernel support. Old bbapends were not removed, so user still
have the option for 3.14/3.19 kernels.

(From meta-yocto rev: f47ea7224765a3c3da3a9e0a989173b2b1950cfc)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:39 +01:00
Leonardo Sandoval 8283a57db8 scrips/lib/bsp/engine: List properties to stdout when output parameter is omitted
When user wants to output the list of properties for a corresponding architecture
and the output parameter is given (--o/-outfile), there is no need to show the
properties into the console.

(From meta-yocto rev: bd133e2a6e626b4158f5a303d85205de9c66e8f2)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Markus Lehtonen 5b629a962d devtool: modify: make bitbake use local files from srctree
This change makes it possible to have local files (non-remote SRC_URI
files, i.e. files that are located in the "recipe space") under the
srctree even if S!=WORKDIR. The files must be placed under the
'local-files' subdirectory.

Complements the previous patch that imports local files into srctree.

[YOCTO #7602]

(From OE-Core rev: b7ab82485e4514e07ab8a76e554da27ddc92e6c0)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:32 +01:00
Markus Lehtonen e9bae506e5 devtool: better support for local source files
* extract: Copy all local source files (i.e.  non-compressed/non-arcived
  SRC_URI files that have file:// URI prefix) - excluding patches - to
  the srctree repository. The files will be placed in a subdirectory
  called 'oe-local-files'. The oe-local-files directory is not committed
  to the Git repository, but, marked to be ignored by a .gitignore file.
  The developer can manually add and commit the files to Git if the
  changes to them need to be tracked.

  Before this patch, local source files (were copied (and committed) to
  the srctree repository only in some special cases (basically when
  S=WORKDIR) when doing devtool-extract. For most of the packages local
  files were not copied at all.

* update-recipe: This patch causes the local files to be 'synced' from
  the srctree (i.e. from the 'oe-local-files' subdirectory) to the
  layer.  Being 'synced' means that in addition to copying modified
  files over the original sources, devtool will also handle removing and
  adding local source files and updating the recipe accordingly.  We
  don't want to create patches against the local source files but rather
  update them directly.  Thus, 'oe-local-file' directory is ignored in
  patch generation when doing update-recipe, even if committed to Git.
  This functionality is only enabled if the 'oe-local-files' directory
  is present in srctree.

[YOCTO #7602]

(From OE-Core rev: a3bb5bd25b72bd1bcc156dabd0ffa2d9184bb160)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:32 +01:00
Markus Lehtonen a74fa38365 devtool: file mover function that creates target dir
Helper function for replacing a pattern like:
  target_dir = os.path.dirname(target)
  bb.utils.mkdirhier(target_dir)
  shutil.move(source, target)

(From OE-Core rev: c09e5b11225a673534594c3642ceead3eb5653a3)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen 109c09b58f devtool: update_recipe: refactor patch generation
Implement new function that handles patch file generation. The new
function also does the discovery of new, updated and deleted patches.

(From OE-Core rev: 183812e60e1dce09c77b41a5a927ab7fb6fdcf9d)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen c976028529 devtool: update-recipe: add new patches in correct order
When adding multiple new patches append them to SRC_URI in correct order
so that they apply correctly.

(From OE-Core rev: 819680092c1b49c16f4ab01d135d44311a9dacca)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen bdbd8b4fef devtool: upgrade: use shutil.move instead of os.rename
Rename fails over filesystem boundaries.

(From OE-Core rev: 479c8eb6547c311123ea30c9f06f2d44c6365473)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:25 +01:00
Paul Eggleton 346784b24b devtool: runqemu: avoid recipe parse
We only need the base configuration to get the variable values we want
to get here, there's no need to parse recipes / load the cache.

(From OE-Core rev: 84172ff7b325f081dba6430fd27f12e3745838b5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:25 +01:00
Markus Lehtonen 85d8b4a92f devtool: second fix for running from a different directory
Do not change change current working directory permanently, but, only
for the duration of tinfoil initialization instead. The previous fix
caused very unintuitive behavior where using relative paths were solved
with respect to the builddir instead of the current working directory.
E.g. calling "devtool extract zlib ./zlib" would always create create
srctree in ${TOPDIR}/zlib, independent of the users cwd.

(From OE-Core rev: 4c7f159b0e17a0475a4a4e9dc4dd012e3d2e6a1f)

(From OE-Core rev: 05060699e63cd25d089e83e9aa56c11d5baa8fd8)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:24 +01:00
Paul Eggleton 6c0066c145 devtool: add search command
Adds a subcommand to search to find the target recipe name providing
some file or capability. This is implemented by searching on recipe
name, package name, description, package contents (file names), and
runtime file provides. For example:

$ devtool search libGL
mesa

$ devtool search X11
xextproto
libxxf86vm
xf86driproto
xf86vidmodeproto
libxfixes
xproto
libx11
...

$ devtool search /bin/sed
busybox
sed

This is particularly useful within the extensible SDK but is also made
available in devtool alongside the build system.

Note of course that because this searches pkgdata, useful results depend
upon do_packagedata(_setscene) having executed for the recipe being
searched for.

(From OE-Core rev: 48cbde0ea77ed20126eceba5feb37c42a9229500)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:21 +01:00
Paul Eggleton 0613301c88 devtool: add basic means of running runqemu within the extensible SDK
We ship the runqemu script and if we build QEMU itself within the
extensible SDK, then it would be nice to be able to run it. This is a
very thin wrapper around runqemu, supplying the machine and image name
so the user doesn't need to. (This subcommand is only available within
the extensible SDK since it only really makes sense there where it is
otherwise hard to run runqemu directly.)

Implements [YOCTO #6657].

(From OE-Core rev: abca7a0cac7068ffe6a6b873d0842f804388b621)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:20 +01:00
Paul Eggleton c4181c6e7e devtool / recipetool: add handling for binary-only packages
Add a means of creating recipes for package files or archives that
contain a directory structure to be installed verbatim, for example an
rpm file. (We mostly just re-use bin_package here and skip some of the
normal build system checks.) This support is available in "recipetool
create" and "devtool add" which wraps the former.

(From OE-Core rev: 9e0a6b2e6f16185f8032d36b77d40802bc388987)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:20 +01:00
Paul Eggleton 76084cdfa6 devtool: build-image: delete bbappend at end of build
Upon further reflection, it seems to me that this bbappend ought to just
be deleted at the end of the build. This keeps things simple; you never
have to remember to delete any files to get back to where you were
before with the image. This means we can also drop the slightly awkward
message reminding the user how to do that. I've also updated the test to
look at the image manifest to determine if the command has worked
instead of looking for the (now deleted) bbappend.

(From OE-Core rev: f6b90bceaedf9bad3d111e6ca1fa79e59f472c73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton ef197f9b99 devtool: build-image: improve image recipe handling
* Make image optional for the extensible SDK (auto-determine it based on
  the targets the SDK was built for)
* Check that specified recipe is in fact an image

(From OE-Core rev: 8884875aacfedc69cc72898684e391e69fea00ba)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton 8f67bb7990 devtool: build-image: tell user where to find output files
If the user is running "devtool build-image" within the extensible SDK
then they probably won't know where to find the resulting output files,
so we should tell them explicitly.

(From OE-Core rev: 9baf9fd7a53142a98c7f1cd49c7b001760af51f9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Paul Eggleton afb9340fc6 devtool: build-image: fix recipe/package terminology
We build recipes and include packages into the image, adjust the
terminology used in code and messages accordingly. Also fix a few typos.

(From OE-Core rev: 866f6e2de20b7022803e53c4de3ff341521b4db5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:18 +01:00
Paul Eggleton d7365185fe devtool: add: move important "recipe created" message to the end
If we end up printing a message about the build directory being the same
as the source, we should print that first and then print the message
about the recipe file possibly needing to be edited to the end so that
it has slightly more impact.

(From OE-Core rev: 97398d14c444fe2408dd6101ef46a0a406924bb5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:18 +01:00
Paul Eggleton 3bd0f33505 devtool: add: set up fetched source as a git repository by default
If the fetched source isn't already a git repository, initialise it as
one and then branch and tag, just as we do with "devtool modify". This
makes it easier to make changes, commit them and then use the
"devtool update-recipe" command to turn those commits into patches
on the recipe.

(From OE-Core rev: 2dd865086c37c9eff63c6d0bbfa9f2e909f9fffe)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton e759b0b75d devtool: better handling for recipes that don't unpack source
Some recipes don't extract any source (for example, opkg-keyrings). We
were producing a traceback in this case because we weren't checking if
the directory existed.

(From OE-Core rev: 087ca0c644aad19e6e7d3921f99f3056471deb65)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton a34f733d3a devtool: fix extracting source for work-shared recipes
Recipes that use work-shared (such as libgcc) are capable of unpacking
the source, but it doesn't necessarily unpack to ${WORKDIR}/${BP}. Use
the last part of the actual S value instead which is more likely to
work.

(From OE-Core rev: 0bab8086fdef93b88d5ec6b88b07ccc921dd786f)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:17 +01:00
Paul Eggleton 5bc437b985 devtool: show proper error when extracting source for recipes with disabled unpack task
If you try to use "devtool modify -x" or "devtool extract" on a recipe
where do_unpack has been set as noexec (e.g. glibc-locale), then we get
an error because the expected source wasn't ever unpacked. Do a check up
front for noexec being set on do_unpack and error out with a reasonable
message if that's the case.

(From OE-Core rev: 39a93c85e798e72edd6ab3c05f8adbb1a97e893e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton 210d959023 recipetool: create: fix handling of URIs containing #
The # character in a URI denotes a fragment; we don't care about this
since it is never supposed to be sent to the server, so remove it from
the URI before actually trying to fetch it or use it in SRC_URI within
the recipe.

(This has come up because download links on pypi.python.org seem to have
a fragment containing the md5sum of the download; without stripping this
off the fetcher will choke on it.)

(From OE-Core rev: 58dc726808817210764eab963a4d453dc4ff49aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton a35ad723ce recipetool: create: fix creating empty shell functions
The shell considers empty functions to be a syntax error, so for
template shell functions that contain only comments (or no lines at all)
then add a : to act as a no-op which avoids the syntax error.

(From OE-Core rev: ff14d9e5b935b99b2efde479515e54c02ba58f6e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:16 +01:00
Paul Eggleton 30c7e7ac41 devtool: add: properly handle separate build directory
When we were adding a recipe for software that would typically be built
in the same directory as the source, we were always using a separate
build directory unless the user explicitly specified not to, leading to
errors for software that doesn't expect to be built that way (such as
Python modules using distutils). Split out the code that makes this
determination automatically from the "devtool modify" and "devtool
upgrade" code and re-use that here so the behaviour is consistent.

(From OE-Core rev: 320585b7ff6340df0b0dbc63f95ed3ca8fc3a993)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:15 +01:00
Paul Eggleton 99fc284545 devtool / lib/oe/recipeutils: ensure we can parse without bbappends
These functions ostensibly allowed parsing a recipe without bbappends
but this clearly hadn't been tested because a variable was unassigned in
both of them in that case.

(From OE-Core rev: d2bb9f08303bb120e811c03af2f5339e8f262cfa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:15 +01:00
Paul Eggleton 5d1a117f44 devtool: add: ensure --color=never turns off recipetool colour output
(From OE-Core rev: 670bd063a5e0cdf89ea8d1f763af980d7e63d38a)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:14 +01:00
Paul Eggleton ae788fbd46 devtool: check that source tree still exists
Sometimes, particularly if you extracted the source to /tmp which is on
tmpfs, the external source tree that is being pointed to may no longer
exist when you come to run "devtool build" or "devtool update-recipe"
etc. Make all of the commands that need to check for a recipe being in
the workspace call a single function and have that function additionally
check the source tree still exists where appropriate.

(From OE-Core rev: 0c3f289576a2ab35b1d1d8854d6763553cc3bf09)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:14 +01:00
Paul Eggleton 0dc9299774 classes/populate_sdk_ext: drop work-config.inc
This is not actually used for anything - I thought that we would need to
use it within devtool to set global configuration, but we're able to do
everything we need within the bbappends it creates, which also saves on
parse time. If we're not going to use work-config.inc let's just drop it
completely.

(From OE-Core rev: 84a1f82acd3b6ebb3c073aae6b996d2203dad2ce)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:12 +01:00
Ed Bartosh dd7726f0bc wic: fix partition size calculation
It was wrongly assumed that part.size is meagured in Mb. In fact it's
in Kb, so there is no need to convert bitbake variable ROOTFS_SIZE as
it's also in Kb.

(From OE-Core rev: 3703ecb4aa5267e6d7330e7978cc7c3bb2250ead)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:54 +01:00
Christopher Larson d18612a8a9 recipetool: add 'newappend' sub-command
This sub-command creates a bbappend for the specified target and prints the
path to the bbappend. The -w argument, as with some of the other recipetool
commands, will make a version-independent bbappend.

Example usage: recipetool newappend meta-mylayer virtual/kernel

[YOCTO #7964]

(From OE-Core rev: ac053163c7823e482ca1af2962342e64a54bfb52)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:30 +01:00
Markus Lehtonen 06cde90f9f devtool: update-recipe: get srcuri parameters with decodeurl()
Use already existing bb.fetch.decodeurl() for getting the parameters for
a URI. This is more fault tolerant and maintainable.

(From OE-Core rev: cd201664b827e37fcabca272262016b171e997d9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:46 +01:00
Ed Bartosh 9485888656 devtool: make plugin_init optional
So far all devtool and recipetool plugins were expected
to have plugin_init function. This function is empty in
most of plugins as they don't require initialisation.

Making plugin_init optional would allow not having empty
plugin_init in every plugin.

(From OE-Core rev: b99640c89f067866b264f4ee4030fae4c2f338c0)

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-09-12 22:48:30 +01:00
Brendan Le Foll 7b1f670ca3 devtool: add package plugin that lets you create package via devtool
Enables creating packages using devtool within the extensible SDK. (This
is only enabled within the extensible SDK because it provides no
advantage over just running bitbake directly there).

(From OE-Core rev: 6dc0269bca3e874582d61b40dbf0d495331fb96a)

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:53 +01:00
Paul Eggleton 6d50a5e0ed devtool: update-recipe: add a warning when recipe is inside the workspace
If a recipe has been added to the workspace via "devtool add"
or "devtool upgrade" then the recipe file itself will be in the
workspace layer; if you run "devtool update-recipe" particularly in the
upgrade case you might think it would apply the upgrade to the original
recipe, but it will not - in order to remain consistent it has to update
the recipe that's in use which is the one in the workspace. Warn the
user in this situation so that they know what they need to do when they
are finished.

(From OE-Core rev: 4801b64243e57e554a593f0857dd53621d8f52e5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Markus Lehtonen 3dd9fc39ab devtool: update-recipe: better 'auto' mode
Enhance the logic behind the 'auto' mode a bit by only updating the
SRCREV if the changes are already found upstream. The logic is simple:
update SRCREV only if the current local HEAD commit is found in the
remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to
patching.

This affects a couple of the oe-selftest tests so update those as well.

[YOCTO #7907]

(From OE-Core rev: 9b9733b7d74032aef4979bec553019421e77da14)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Leonardo Sandoval 0d0e50810a devtool: Allow disabling make parallelism on build command
Through -s/--disable-parallel-make, the user can turn off parallelism
on the make tool. This can be useful when debuging race condition issues.
In order to set PARALLEL_MAKE = "" a post-config file created and then
passed into the build.

[YOCTO #7589]

(From OE-Core rev: 0bf2e4b3edfc43e7a2e8d3387a9370d110533b7c)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Leonardo Sandoval 1a721815ed devtool: Create a single file for the build devtool feature
The intention is to have a single file for each devtool feature
so devtool can grow in a modular way. In this direction, this patch creates
build.py, moving all related build features from standard.py to build.py.

(From OE-Core rev: 61bb1759f7ecb8b404f7d97573c61aef31f2f109)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:51 +01:00
Leonardo Sandoval 8be95c5fbe devtool: add upgrade feature
Upgrades a recipe to a particular version and downloads the source code
into a folder. User can avoid patching the source code.

These are the general steps of the upgrade function:

   - Extract current recipe source code into srctree and create a branch
   - Extract upgrade recipe source code into srctree and rebase with
     previous branch. In case the rebase is not correctly applied, source
     code will not be deleted, so user correct the patches
   - Creates the new recipe under the workspace

[YOCTO #7642]

(From OE-Core rev: 4020f5d91b3e4d011150d5081d36215f8eab732e)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:51 +01:00
Paul Eggleton 7cde0ebd59 devtool: improve modified file preservation to handle directory structures
Allow the _add_md5() function to be called with a directory in order to
recursively add the files under it. Additionally, we need to skip
preserving empty directories (since directories aren't listed in the md5
file).

(From OE-Core rev: 9383af78adc854a6f6de8b1520edf3cea0c477a6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Paul Eggleton ee0c11d988 scriptutils: split out simple fetching function from recipetool
This will now also be used by "devtool upgrade".

(From OE-Core rev: 0d0b8425eaf74a6d7f3d9f6471e6edca1a273c06)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Markus Lehtonen 3690281efb devtool: modify: enable do_shared_workdir for kernel
Do not put 'do_shared_workdir' into SRCTREECOVEREDTASKS when creating
bbappend for kernel packages. This will allow building packages that
depend on the shared build artifacts of kernel.

[YOCTO #6658]

(From OE-Core rev: 2355ccc627c0003a14693d1a023a003b7b44ea53)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:50 +01:00
Ed Bartosh 4031de53f4 wic: round variable before converting to int
Wic uses bitbake variable ROOTFS_SIZE to set correspondent
partition size. This variable is a literal representing
float value. Wic crashes trying to convert it to int with
the error: invalid literal for int() with base 10: '10166.0'

Fixed this by converting variable to float and rounding result.
This should work for int and float literals.

(From OE-Core rev: 3479e299b5f11dfcd3f5f97c4ad3e0449f6c6d6a)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:45 +01:00
Qi.Chen@windriver.com ee428e27fe devtool: add mechanism for updating extensible SDK
Enable updating the installed extensible SDK from a local or remote
server, avoiding the need to install it again from scratch when
updating. (This assumes that the updated SDK has been built and then
published somewhere using the oe-publish-sdk script beforehand.)

This plugin is only enabled when devtool is used within the extensible
SDK since it doesn't make sense to use it next to a normal install of
the build system.

E.g.
devtool sdk-update /mnt/sdk-repo/
devtool sdk-update http://mysdkhost/sdk

(From OE-Core rev: 32cbd4c57fc8ca097a18929fc404c07322ef36dd)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:43 +01:00
Markus Lehtonen 2b6218d449 devtool: run kernel dependencies
The kernel package needs "kern-tools-native" in order for it's
do_kernel_metadata. Thus, devtool extract for kernel in a pristine
environment fails. With the current bb.tinfoil implementation it is not
possible to run arbitrary bitbake commands - e.g. run
"bitbake kern-tools-native -c populate_sysroot" in our case. This patch
implements an ugly workaround for that problem, basically by hardcoding
this dependency and running the required bitbake task(s) before tinfoil
is initialized.

[YOCTO #6658]

(From OE-Core rev: a9eb80de164fb8a464e29bf1cc6c7cf397f36662)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:51 +01:00
Markus Lehtonen 3b3f9bbc30 devtool: extract: correct initial rev for kernel packages
Change handling of kernel packages so that the "initial rev" is parsed
correctly. Also, the devtool-specific git tags (devtool-base and
devtoo-patched) are now generated for kernel packages as well.

[YOCTO #6658]

(From OE-Core rev: 65fe3e45b10c5578446c758f66840891c62cd774)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:51 +01:00
Markus Lehtonen 9e9fd091d5 devtool: make required tasks be run in kernel build
Set SRCTREECOVEREDTASKS appropriately in the workspace .bbappend file
for kernel recipes. This tries to ensure that all needed tasks (esp.
configure and patch) are run when building the kernel - tasks which
would normally be disabled by externalsrc.bbclass.

[YOCTO #6658]

(From OE-Core rev: f0a3a38a653c643468452eba43a12795136720c9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:50 +01:00
Ed Bartosh 791a3912d9 wic: fix short variable names
Made short variable names longer and more readable.

Fixed pylint warnings "Invalid variable name" and
"Invalid argument name".

(From OE-Core rev: 872cb0d5d79b26f34e6b35d7be8870d245021be4)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:31 +01:00
Ed Bartosh 14b47e22f9 wic: get rid of listing properties
Functionality of listing and using properties of wic images
does not exist in the wic code. However, there are plenty of
help and usage content about it, which is very confusing.

Removed everything regarding image properties from wic codebase.

(From OE-Core rev: af0a6d547a5a3efefdd4900f7079dfd10b85342d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:30 +01:00
Ed Bartosh 1561970e88 wic: fix pylint warning redefined-builtin
Renamed variables named as Python builtin functions.

(From OE-Core rev: bed98142e3e47ac2862ccf8fe3e4bdeabfc91172)

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