From: Artem Bityutskiy Date: Thu, 27 Sep 2012 14:33:38 +0000 (+0300) Subject: Introduce the --generate-bmap option X-Git-Tag: 0.16~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d74a55dac569ae5d4c4914c78ec79545c8cab1f1;p=tools%2Fmic.git 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 Change-Id: I89f1090f52405939ac77ef6599a3925043d4927b --- diff --git a/mic/imager/raw.py b/mic/imager/raw.py index 4085bec..c95eafa 100644 --- a/mic/imager/raw.py +++ b/mic/imager/raw.py @@ -36,7 +36,7 @@ class RawImageCreator(BaseImageCreator): subsequently be booted in a virtual machine or accessed with kpartx """ - def __init__(self, creatoropts=None, pkgmgr=None, compress_image=None): + def __init__(self, creatoropts=None, pkgmgr=None, compress_image=None, generate_bmap=None): """Initialize a ApplianceImageCreator instance. This method takes the same arguments as ImageCreator.__init__() @@ -54,6 +54,7 @@ class RawImageCreator(BaseImageCreator): self.appliance_version = None self.appliance_release = None self.compress_image = compress_image + self.bmap_needed = generate_bmap #self.getsource = False #self.listpkg = False diff --git a/plugins/imager/raw_plugin.py b/plugins/imager/raw_plugin.py index 9b76d6f..5f04562 100644 --- a/plugins/imager/raw_plugin.py +++ b/plugins/imager/raw_plugin.py @@ -39,6 +39,8 @@ class RawPlugin(ImagerPlugin): @cmdln.option("--compress-image", dest="compress_image", type='choice', choices=("gz", "bz2"), default = None, help="Compress all raw images before package") + @cmdln.option("--generate-bmap", action="store_true", default = None, + help="also generate the block map file") def do_create(self, subcmd, opts, *args): """${cmd_name}: create raw image @@ -92,7 +94,8 @@ class RawPlugin(ImagerPlugin): (creatoropts['pkgmgr'], ','.join(backends.keys()))) - creator = raw.RawImageCreator(creatoropts, pkgmgr, opts.compress_image) + creator = raw.RawImageCreator(creatoropts, pkgmgr, opts.compress_image, + opts.generate_bmap) if len(recording_pkgs) > 0: creator._recording_pkgs = recording_pkgs