wic: Initial code for wic (OpenEmbedded Image Creator)

Initial implementation of the 'wic' command.

The 'wic' command generates partitioned images from existing
OpenEmbedded build artifacts.  Image generation is driven by
partitioning commands contained in an 'Openembedded kickstart' (.wks)
file specified either directly on the command-line or as one of a
selection of canned .wks files (see 'wic list images').  When applied
to a given set of build artifacts, the result is an image or set of
images that can be directly written onto media and used on a
particular system.

'wic' is based loosely on the 'mic' (Meego Image Creator) framework,
but heavily modified to make direct use of OpenEmbedded build
artifacts instead of package installation and configuration, things
already incorporated int the OE artifacts.

The name 'wic' comes from 'oeic' with the 'oe' diphthong promoted to
the letter 'w', because 'oeic' is impossible to remember or pronounce.

This covers the mechanics of invoking and providing help for the
command and sub-commands; it contains hooks for future commits to
connect with the actual functionality, once implemented.

Help is integrated into the 'wic' command - see that for details on
usage.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add mic w/pykickstart

This is the starting point for the implemention described in [YOCTO
3847] which came to the conclusion that it would make sense to use
kickstart syntax to implement image creation in OpenEmbedded.  I
subsequently realized that there was an existing tool that already
implemented image creation using kickstart syntax, the Tizen/Meego mic
tool.  As such, it made sense to use that as a starting point - this
commit essentially just copies the relevant Python code from the MIC
tool to the scripts/lib dir, where it can be accessed by the
previously created wic tool.

Most of this will be removed or renamed by later commits, since we're
initially focusing on partitioning only.  Care should be taken so that
we can easily add back any additional functionality should we decide
later to expand the tool, though (we may also want to contribute our
local changes to the mic tool to the Tizen project if it makes sense,
and therefore should avoid gratuitous changes to the original code if
possible).

Added the /mic subdir from Tizen mic repo as a starting point:

 git clone git://review.tizen.org/tools/mic.git

 For reference, the top commit:

 commit 20164175ddc234a17b8a12c33d04b012347b1530
 Author: Gui Chen <gui.chen@intel.com>
 Date:   Sun Jun 30 22:32:16 2013 -0400

    bump up to 0.19.2

Also added the /plugins subdir, moved to under the /mic subdir (to
match the default plugin_dir location in mic.conf.in, which was
renamed to yocto-image.conf (moved and renamed by later patches) and
put into /scripts.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wic: Add OpenEmbedded-specific implementation

Reuses the mic/livecd infrastructure but heavily subclasses and
modifies it to adapt to the special needs of building images from
existing OpenEmbedded build artifacts.

In addition to the OE-specific mic objects and modifications to the
underlying infrastructure, this adds a mechanism to allow OE kickstart
files to be 'canned' and made available to users via the 'wic list
images' command.

Two initial OE kickstart files have been added as canned .wks files:
directdisk, which implements the same thing as the images created by
directdisk.bbclass, and mkefidisk, which can essentially be used as a
replacement for mkefidisk.sh.  Of course, since creation of these
images are now driven by .wks files rather than being hard-coded into
class files or scripts, they can be easily modified to generate
different variations on those images.  They also don't require root
priveleges, since they don't use mount to create the images.  They
don't however write to media like mkefidisk.sh does, but rather create
images that can be written onto media.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
dpkg: Add xz to RDEPENDS

dpkg uses xz as a compressor and the binary image is needed on the system for
dpkg to work correctly.

[YOCTO #1881]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
makedevs: Do not return error if the fifo exisits

This ensures that makedevs will not cause image creation failures
when it encounters a pipe (fifo) that exists from a previous image.
This handles mode changes and it will correctly fail for dangling
symlinks.

[YOCTO #5288]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
linux-dummy.bb: Resolve missing task issues

Commit 609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a added additional
initramfs functionality and created an additional task on kernel.bbclass
Adding this task was missed on the linux-dummy recipe, which causes task
dependency issues due to image.bbclass depending on
"virtual/kernel:do_bundle_initramfs". This change adds a dummy task
which resolves the dependency issue.

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>