support running specified command for mic chroot

usage: mic chroot CHROOT [COMMAND [ARGS]]
this feature enables running command with non-interactive

Change-Id: Ic7e74a00c83e3cef5684c2ee94a755389ba4276d
relocate dist files and add change log

Change-Id: Idd31d153f36ff12b5a0aedee644d3811038b599b
Signed-off-by: Gui Chen <gui.chen@intel.com>
fix syntax warning for USAGE.rst

Change-Id: I5e67db666bb1ee57dc6f05bcdff27fd5d6be1a13
Signed-off-by: Gui Chen <gui.chen@intel.com>
fix extlinux not found issue

Signed-off-by: Gui Chen <gui.chen@intel.com>
fix version comparison for bootstrap

Signed-off-by: Gui Chen <gui.chen@intel.com>
decide uniq arch when one repo only has one uniq arch

the arch detection is changed: when one uniq arch is found in a repo,
this arch should be detected arch now.

Signed-off-by: Gui Chen <gui.chen@intel.com>
Cleanup RawImageCreator a bit

This patch cleans-up the RawImageCreator code a little bit. We construct
the full name for the files we generate many times in various places, which
looks untidy. This commit introduces 2 helper functions: _full_name() and
_full_path() which return full name for a file and full path to a file,
correspondingly. The code becomes more readable with this change.

But also, this is a preparation to one of the following patches where we'll
need to construct full path for the bmap file. We do not want to add yet
another place where we construct this manually, so we better have a helper
function.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Change-Id: I9ac52c95e4b16bcd227df467439ac2ae87b1c145
Introduce the --generate-bmap option

This patch only introduce the --generate-bmap option of the 'raw' subcommand
and does not implement it. The implementation is added by in the follo-up
patches.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Change-Id: I89f1090f52405939ac77ef6599a3925043d4927b
Add block map functionality

This patch add a 'generate_bmap()' method to the RawImageCreator
class and makes the '--generate-bmap' option actually work. The generated
file has '.bmap' extention and the same name as the raw image file.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Change-Id: I54ab3bc7274160c697dce4f8e296b46dda28cdd2
point to tizen repo, not meego

Change-Id: I50e62f957dbdbfbc178558598881e041fe0f1643
update README.rst

Signed-off-by: lhh <huanhuanx.li@intel.com>
handle unicode in CreatorError and UsageError

when code like 'raise CreatorError(str(e))' and e.msg is unicode,
this will be failed, this patch will fix such issue

Signed-off-by: Gui Chen <gui.chen@intel.com>
bmap: fix the image file open mode

Open the image file in R/O binary mode instead of the default
R/O mode.

Change-Id: Ibc8b69fdf0b920c716e7cc9c23017747206e5500
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmap: move human-readable stuff to comments

I've got feed-back from Henning Schroeder that it is bad idea to provide
human-only information in machine-parsible parts of the XML, simply because
someone may be tempted to use it.

And he is right. This patch moves all the human-only date to XML comments.

It also amends the BMAP xml header comment by adding more information.

Change-Id: If5c62c2277686dfd3c889ae6f59a9d1caa94b026
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
RawImageCreator: use hashlib unconditionally

mic does not work with python < 2.5 (see distfiles/mic.spec, for example), so
we can use hashlib without falling-back to 'import sha1'. This patch cleans-up
the code a bit and removes the fall-back to 'import sha1' stuff.

I move 'import hashlib' to the top level because it is cleaner and because I
will need hashlib very soon in the next patch.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
RawImageCreator: remove meter for hash calculation

We currently use the progress meter when calculating hash functions
of the raw image file. Well, there is nothing bad with this, but this
is not really necessary. I am removing this because I am going to
introduce a helper function for calculating hashes, and I do not want
to complicate it with a meter.

So, remove the meter. We can add it back if we find this necessary
in the future.

This makes the code a bit less complex as well.

Change-Id: I7da651f82dcbb14e16e1dccbbc4ee73cc1aa7e0b
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
RawImageCreator: introduce a function for hash calculation

Introduce a separate function for hash calculations. I will need
hash in bmap code, so it is nice to have a common helper for this.

Change-Id: I859450803a0c6cfa9bb6db738a6931508572374f
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmap: support sha1 checksums

This patch addresses another complaint from Henning Schroeder and adds
SHA1 checksum for each block range.

Change-Id: Ib1835ce2ca26d4e8ebe46a1e83c083822c47ce21
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmap: increase minor version number

We've done some compatible changes and it is a good idea to incread the
minor bmap version number now.

Also, add some XML comments explaining the versioning.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
fix help command

'mic cr ?' will output differently with 'mic cr -h'

Signed-off-by: Huanhuan Li <huanhuanx.li@intel.com>