<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>The wic help output formally consisted of manually created strings mixed with argparse,</div>
<div>which was unformatted and unusable. This fix cleans up the help messages, rewrites help</div>
<div>functionality to use argparse, and adds functionality to show information for</div>
<div>plugins (similar to canned images).</div>
<div><br>
</div>
<div>Fixes [YOCTO #12205]</div>
<div><br>
</div>
<div>Signed-off-by: anelliot &lt;amber.n.elliot@intel.com&gt;</div>
<div>---</div>
<div>&nbsp;scripts/lib/wic/engine.py | &nbsp; 87 &#43;&#43;&#43;-</div>
<div>&nbsp;scripts/lib/wic/help.py &nbsp; | 1072 &#43;&#43;&#43;&#43;&#43;----------------------------------------</div>
<div>&nbsp;scripts/wic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp;169 &#43;&#43;&#43;----</div>
<div>&nbsp;3 files changed, 243 insertions(&#43;), 1085 deletions(-)</div>
<div><br>
</div>
<div>diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py</div>
<div>index edcfab3..5d1e1d8 100644</div>
<div>--- a/scripts/lib/wic/engine.py</div>
<div>&#43;&#43;&#43; b/scripts/lib/wic/engine.py</div>
<div>@@ -58,6 &#43;58,8 @@ def verify_build_env():</div>
<div>&nbsp;</div>
<div>&nbsp;CANNED_IMAGE_DIR = &quot;lib/wic/canned-wks&quot; # relative to scripts</div>
<div>&nbsp;SCRIPTS_CANNED_IMAGE_DIR = &quot;scripts/&quot; &#43; CANNED_IMAGE_DIR</div>
<div>&#43;SOURCE_PLUGIN_DIR = &quot;lib/wic/plugins/source&quot;</div>
<div>&#43;SCRIPTS_SOURCE_PLUGIN_DIR = &quot;scripts/&quot; &#43; SOURCE_PLUGIN_DIR</div>
<div>&nbsp;WIC_DIR = &quot;wic&quot;</div>
<div>&nbsp;</div>
<div>&nbsp;def build_canned_image_list(path):</div>
<div>@@ -76,6 &#43;78,23 @@ def build_canned_image_list(path):</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;return canned_wks_layer_dirs</div>
<div>&nbsp;</div>
<div>&#43;def build_source_plugin_list(path):</div>
<div>&#43; &nbsp; &nbsp;layers_path = get_bitbake_var(&quot;BBLAYERS&quot;)</div>
<div>&#43; &nbsp; &nbsp;canned_wks_layer_dirs = []</div>
<div>&#43;</div>
<div>&#43; &nbsp; &nbsp;if layers_path is not None:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;for layer_path in layers_path.split():</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for wks_path in (WIC_DIR, SCRIPTS_SOURCE_PLUGIN_DIR):</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cpath = os.path.join(layer_path, wks_path)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if os.path.isdir(cpath):</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;canned_wks_layer_dirs.append(cpath)</div>
<div>&#43;</div>
<div>&#43; &nbsp; &nbsp;cpath = os.path.join(path, SOURCE_PLUGIN_DIR)</div>
<div>&#43; &nbsp; &nbsp;canned_wks_layer_dirs.append(cpath)</div>
<div>&#43;</div>
<div>&#43; &nbsp; &nbsp;return canned_wks_layer_dirs</div>
<div>&#43;</div>
<div>&#43;</div>
<div>&nbsp;def find_canned_image(scripts_path, wks_file):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Find a .wks file with the given name in the canned files dir.</div>
<div>@@ -95,6 &#43;114,24 @@ def find_canned_image(scripts_path, wks_file):</div>
<div>&nbsp; &nbsp; &nbsp;return None</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&#43;def find_source_plugin(scripts_path, plugin_file):</div>
<div>&#43; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&#43; &nbsp; &nbsp;Find a .py file with the given name in the source plugin dir.</div>
<div>&#43;</div>
<div>&#43; &nbsp; &nbsp;Return False if not found</div>
<div>&#43; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&#43; &nbsp; &nbsp;layers_source_plugin_dir = build_source_plugin_list(scripts_path)</div>
<div>&#43;</div>
<div>&#43; &nbsp; &nbsp;for source_plugin_dir in layers_source_plugin_dir:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;for root, dirs, files in os.walk(source_plugin_dir):</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for fname in files:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if fname.endswith(&quot;~&quot;) or fname.endswith(&quot;#&quot;):</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if fname.endswith(&quot;.py&quot;) and plugin_file &#43; &quot;.py&quot; == fname:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fullpath = os.path.join(source_plugin_dir, fname)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return fullpath</div>
<div>&#43; &nbsp; &nbsp;return None</div>
<div>&#43;</div>
<div>&nbsp;def list_canned_images(scripts_path):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;List the .wks files in the canned image dir, minus the extension.</div>
<div>@@ -119,7 &#43;156,7 @@ def list_canned_images(scripts_path):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(&quot; &nbsp;%s\t\t%s&quot; % (basename.ljust(30), desc))</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>-def list_canned_image_help(scripts_path, fullpath):</div>
<div>&#43;def list_canned_image_help(fullpath):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;List the help and params in the specified canned image.</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>@@ -139,6 &#43;176,7 @@ def list_canned_image_help(scripts_path, fullpath):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if idx != -1:</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(line[idx &#43; len(&quot;#:&quot;):].rstrip())</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print()</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>@@ -152,6 &#43;190,29 @@ def list_source_plugins():</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(&quot; &nbsp;%s&quot; % plugin)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&#43;def list_source_plugins_help(fullpath):</div>
<div>&#43; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&#43; &nbsp; &nbsp;List the help and params in the specified canned image.</div>
<div>&#43; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&#43; &nbsp; &nbsp;found = False</div>
<div>&#43; &nbsp; &nbsp;with open(fullpath) as plugin:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;for line in plugin:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not found:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;idx = line.find(&quot;DESCRIPTION&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if idx != -1:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(line[idx &#43; len(&quot;DESCRIPTION&quot;):].strip())</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;found = True</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;continue</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not line.strip():</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;idx = line.find(&quot;#&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;auth = line.find(&quot;AUTHORS&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if idx != -1 and auth == -1:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(line[idx &#43; len(&quot;#:&quot;):].rstrip())</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break</div>
<div>&#43;</div>
<div>&#43;</div>
<div>&nbsp;def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; native_sysroot, options):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>@@ -204,7 &#43;265,7 @@ def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,</div>
<div>&nbsp; &nbsp; &nbsp;logger.info(&quot;The image(s) were created using OE kickstart file:\n &nbsp;%s&quot;, wks_file)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>-def wic_list(args, scripts_path):</div>
<div>&#43;def wic_list(scripts_path, args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Print the list of images or source plugins.</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>@@ -218,16 &#43;279,20 @@ def wic_list(args, scripts_path):</div>
<div>&nbsp; &nbsp; &nbsp;elif args.list_type == &quot;source-plugins&quot;:</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_source_plugins()</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return True</div>
<div>- &nbsp; &nbsp;elif len(args.help_for) == 1 and args.help_for[0] == 'help':</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;wks_file = args.list_type</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;fullpath = find_canned_image(scripts_path, wks_file)</div>
<div>&#43; &nbsp; &nbsp;elif len(args.info_for) == 1 and args.info_for[0] == 'info':</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;input_file = args.list_type</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;fullpath = find_canned_image(scripts_path, input_file)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not fullpath:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise WicError(&quot;No image named %s found, exiting. &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;(Use 'wic list images' to list available images, &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;or specify a fully-qualified OE kickstart (.wks) &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;filename)&quot; % wks_file)</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;list_canned_image_help(scripts_path, fullpath)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fullpath = find_source_plugin(scripts_path, input_file)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not fullpath:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise WicError(&quot;No image named %s found, exiting. &quot;</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;(Use 'wic list images' to list available images, &quot;</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;or specify a fully-qualified OE kickstart (.wks) &quot;</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;filename)&quot; % input_file)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_source_plugins_help(fullpath)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;list_canned_image_help(fullpath)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return True</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;return False</div>
<div>diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py</div>
<div>index 2ac45e0..8230395 100644</div>
<div>--- a/scripts/lib/wic/help.py</div>
<div>&#43;&#43;&#43; b/scripts/lib/wic/help.py</div>
<div>@@ -30,1014 &#43;30,166 @@ import logging</div>
<div>&nbsp;</div>
<div>&nbsp;from wic.pluginbase import PluginMgr, PLUGIN_TYPES</div>
<div>&nbsp;</div>
<div>-logger = logging.getLogger('wic')</div>
<div>-</div>
<div>-def subcommand_error(args):</div>
<div>- &nbsp; &nbsp;logger.info(&quot;invalid subcommand %s&quot;, args[0])</div>
<div>-</div>
<div>-</div>
<div>-def display_help(subcommand, subcommands):</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Display help for subcommand.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;if subcommand not in subcommands:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;return False</div>
<div>-</div>
<div>- &nbsp; &nbsp;hlp = subcommands.get(subcommand, subcommand_error)[2]</div>
<div>- &nbsp; &nbsp;if callable(hlp):</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;hlp = hlp()</div>
<div>- &nbsp; &nbsp;pager = subprocess.Popen('less', stdin=subprocess.PIPE)</div>
<div>- &nbsp; &nbsp;pager.communicate(hlp.encode('utf-8'))</div>
<div>-</div>
<div>- &nbsp; &nbsp;return True</div>
<div>-</div>
<div>-</div>
<div>-def wic_help(args, usage_str, subcommands):</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Subcommand help dispatcher.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;if args.help_topic == None or not display_help(args.help_topic, subcommands):</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;print(usage_str)</div>
<div>-</div>
<div>-</div>
<div>-def get_wic_plugins_help():</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Combine wic_plugins_help with the help for every known</div>
<div>- &nbsp; &nbsp;source plugin.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;result = wic_plugins_help</div>
<div>- &nbsp; &nbsp;for plugin_type in PLUGIN_TYPES:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;result &#43;= '\n\n%s PLUGINS\n\n' % plugin_type.upper()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;for name, plugin in PluginMgr.get_plugins(plugin_type).items():</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;result &#43;= &quot;\n %s plugin:\n&quot; % name</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if plugin.__doc__:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;result &#43;= plugin.__doc__</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;result &#43;= &quot;\n &nbsp; &nbsp;%s is missing docstring\n&quot; % plugin</div>
<div>- &nbsp; &nbsp;return result</div>
<div>-</div>
<div>-</div>
<div>-def invoke_subcommand(args, parser, main_command_usage, subcommands):</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Dispatch to subcommand handler borrowed from combo-layer.</div>
<div>- &nbsp; &nbsp;Should use argparse, but has to work in 2.6.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;if not args.command:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;logger.error(&quot;No subcommand specified, exiting&quot;)</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;parser.print_help()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;return 1</div>
<div>- &nbsp; &nbsp;elif args.command == &quot;help&quot;:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;wic_help(args, main_command_usage, subcommands)</div>
<div>- &nbsp; &nbsp;elif args.command not in subcommands:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;logger.error(&quot;Unsupported subcommand %s, exiting\n&quot;, args.command)</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;parser.print_help()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;return 1</div>
<div>- &nbsp; &nbsp;else:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;subcmd = subcommands.get(args.command, subcommand_error)</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;usage = subcmd[1]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;subcmd[0](args, usage)</div>
<div>-</div>
<div>-</div>
<div>-##</div>
<div>&#43;# ##</div>
<div>&nbsp;# wic help and usage strings</div>
<div>&nbsp;##</div>
<div>&nbsp;</div>
<div>-wic_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- Create a customized OpenEmbedded image</div>
<div>-</div>
<div>- usage: wic [--version] | [--help] | [COMMAND [ARGS]]</div>
<div>-</div>
<div>- Current 'wic' commands are:</div>
<div>- &nbsp; &nbsp;help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Show help for command or one of the topics (see below)</div>
<div>- &nbsp; &nbsp;create &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Create a new OpenEmbedded image</div>
<div>- &nbsp; &nbsp;list &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;List available canned images and source plugins</div>
<div>-</div>
<div>- Help topics:</div>
<div>- &nbsp; &nbsp;overview &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic overview - General overview of wic</div>
<div>- &nbsp; &nbsp;plugins &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wic plugins - Overview and API</div>
<div>- &nbsp; &nbsp;kickstart &nbsp; &nbsp; &nbsp; &nbsp; wic kickstart - wic kickstart reference</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_help_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- usage: wic help &lt;subcommand&gt;</div>
<div>-</div>
<div>- This command displays detailed help for the specified subcommand.</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_create_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- Create a new OpenEmbedded image</div>
<div>-</div>
<div>- usage: wic create &lt;wks file or image name&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-e | --image-name] [-s, --skip-build-check] [-D, --debug]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-r, --rootfs-dir] [-b, --bootimg-dir]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-c, --compress-with] [-m, --bmap]</div>
<div>-</div>
<div>- This command creates an OpenEmbedded image based on the 'OE kickstart</div>
<div>- commands' found in the &lt;wks file&gt;.</div>
<div>-</div>
<div>- The -o option can be used to place the image in a directory with a</div>
<div>- different name and location.</div>
<div>-</div>
<div>- See 'wic help create' for more detailed instructions.</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_create_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic create - Create a new OpenEmbedded image</div>
<div>-</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic create &lt;wks file or image name&gt; [-o &lt;DIRNAME&gt; | --outdir &lt;DIRNAME&gt;]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;[-e | --image-name] [-s, --skip-build-check] [-D, --debug]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;[-r, --rootfs-dir] [-b, --bootimg-dir]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;[-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;[-c, --compress-with] [-m, --bmap] [--no-fstab-update]</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command creates an OpenEmbedded image based on the 'OE</div>
<div>- &nbsp; &nbsp;kickstart commands' found in the &lt;wks file&gt;.</div>
<div>-</div>
<div>- &nbsp; &nbsp;In order to do this, wic needs to know the locations of the</div>
<div>- &nbsp; &nbsp;various build artifacts required to build the image.</div>
<div>-</div>
<div>- &nbsp; &nbsp;Users can explicitly specify the build artifact locations using</div>
<div>- &nbsp; &nbsp;the -r, -b, -k, and -n options. &nbsp;See below for details on where</div>
<div>- &nbsp; &nbsp;the corresponding artifacts are typically found in a normal</div>
<div>- &nbsp; &nbsp;OpenEmbedded build.</div>
<div>-</div>
<div>- &nbsp; &nbsp;Alternatively, users can use the -e option to have 'wic' determine</div>
<div>- &nbsp; &nbsp;those locations for a given image. &nbsp;If the -e option is used, the</div>
<div>- &nbsp; &nbsp;user needs to have set the appropriate MACHINE variable in</div>
<div>- &nbsp; &nbsp;local.conf, and have sourced the build environment.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -e option is used to specify the name of the image to use the</div>
<div>- &nbsp; &nbsp;artifacts from e.g. core-image-sato.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -r option is used to specify the path to the /rootfs dir to</div>
<div>- &nbsp; &nbsp;use as the .wks rootfs source.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -b option is used to specify the path to the dir containing</div>
<div>- &nbsp; &nbsp;the boot artifacts (e.g. /EFI or /syslinux dirs) to use as the</div>
<div>- &nbsp; &nbsp;.wks bootimg source.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -k option is used to specify the path to the dir containing</div>
<div>- &nbsp; &nbsp;the kernel to use in the .wks bootimg.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -n option is used to specify the path to the native sysroot</div>
<div>- &nbsp; &nbsp;containing the tools to use to build the image.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -f option is used to build rootfs by running &quot;bitbake &lt;image&gt;&quot;</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -s option is used to skip the build check. &nbsp;The build check is</div>
<div>- &nbsp; &nbsp;a simple sanity check used to determine whether the user has</div>
<div>- &nbsp; &nbsp;sourced the build environment so that the -e option can operate</div>
<div>- &nbsp; &nbsp;correctly. &nbsp;If the user has specified the build artifact locations</div>
<div>- &nbsp; &nbsp;explicitly, 'wic' assumes the user knows what he or she is doing</div>
<div>- &nbsp; &nbsp;and skips the build check.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -D option is used to display debug information detailing</div>
<div>- &nbsp; &nbsp;exactly what happens behind the scenes when a create request is</div>
<div>- &nbsp; &nbsp;fulfilled (or not, as the case may be). &nbsp;It enumerates and</div>
<div>- &nbsp; &nbsp;displays the command sequence used, and should be included in any</div>
<div>- &nbsp; &nbsp;bug report describing unexpected results.</div>
<div>-</div>
<div>- &nbsp; &nbsp;When 'wic -e' is used, the locations for the build artifacts</div>
<div>- &nbsp; &nbsp;values are determined by 'wic -e' from the output of the 'bitbake</div>
<div>- &nbsp; &nbsp;-e' command given an image name e.g. 'core-image-minimal' and a</div>
<div>- &nbsp; &nbsp;given machine set in local.conf. &nbsp;In that case, the image is</div>
<div>- &nbsp; &nbsp;created as if the following 'bitbake -e' variables were used:</div>
<div>-</div>
<div>- &nbsp; &nbsp;-r: &nbsp; &nbsp; &nbsp; &nbsp;IMAGE_ROOTFS</div>
<div>- &nbsp; &nbsp;-k: &nbsp; &nbsp; &nbsp; &nbsp;STAGING_KERNEL_DIR</div>
<div>- &nbsp; &nbsp;-n: &nbsp; &nbsp; &nbsp; &nbsp;STAGING_DIR_NATIVE</div>
<div>- &nbsp; &nbsp;-b: &nbsp; &nbsp; &nbsp; &nbsp;empty (plugin-specific handlers must determine this)</div>
<div>-</div>
<div>- &nbsp; &nbsp;If 'wic -e' is not used, the user needs to select the appropriate</div>
<div>- &nbsp; &nbsp;value for -b (as well as -r, -k, and -n).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -o option can be used to place the image in a directory with a</div>
<div>- &nbsp; &nbsp;different name and location.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -c option is used to specify compressor utility to compress</div>
<div>- &nbsp; &nbsp;an image. gzip, bzip2 and xz compressors are supported.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -m option is used to produce .bmap file for the image. This file</div>
<div>- &nbsp; &nbsp;can be used to flash image using bmaptool utility.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The --no-fstab-update option is used to doesn't change fstab file. When</div>
<div>- &nbsp; &nbsp;using this option the final fstab file will be same that in rootfs and</div>
<div>- &nbsp; &nbsp;wic doesn't update file, e.g adding a new mount point. User can control</div>
<div>- &nbsp; &nbsp;the fstab file content in base-files recipe.</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_list_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- List available OpenEmbedded images and source plugins</div>
<div>-</div>
<div>- usage: wic list images</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;wic list &lt;image&gt; help</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;wic list source-plugins</div>
<div>-</div>
<div>- This command enumerates the set of available canned images as well as</div>
<div>- help for those images. &nbsp;It also can be used to list of available source</div>
<div>- plugins.</div>
<div>-</div>
<div>- The first form enumerates all the available 'canned' images.</div>
<div>-</div>
<div>- The second form lists the detailed help information for a specific</div>
<div>- 'canned' image.</div>
<div>-</div>
<div>- The third form enumerates all the available --sources (source</div>
<div>- plugins).</div>
<div>-</div>
<div>- See 'wic help list' for more details.</div>
<div>&#43;wic_create_short_description = &quot;&quot;&quot;</div>
<div>&#43;Create a new OpenEmbedded image.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_list_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic list - List available OpenEmbedded images and source plugins</div>
<div>-</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic list images</div>
<div>- &nbsp; &nbsp;wic list &lt;image&gt; help</div>
<div>- &nbsp; &nbsp;wic list source-plugins</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command enumerates the set of available canned images as well</div>
<div>- &nbsp; &nbsp;as help for those images. &nbsp;It also can be used to list available</div>
<div>- &nbsp; &nbsp;source plugins.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The first form enumerates all the available 'canned' images.</div>
<div>- &nbsp; &nbsp;These are actually just the set of .wks files that have been moved</div>
<div>- &nbsp; &nbsp;into the /scripts/lib/wic/canned-wks directory).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The second form lists the detailed help information for a specific</div>
<div>- &nbsp; &nbsp;'canned' image.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The third form enumerates all the available --sources (source</div>
<div>- &nbsp; &nbsp;plugins). &nbsp;The contents of a given partition are driven by code</div>
<div>- &nbsp; &nbsp;defined in 'source plugins'. &nbsp;Users specify a specific plugin via</div>
<div>- &nbsp; &nbsp;the --source parameter of the partition .wks command. &nbsp;Normally</div>
<div>- &nbsp; &nbsp;this is the 'rootfs' plugin but can be any of the more specialized</div>
<div>- &nbsp; &nbsp;sources listed by the 'list source-plugins' command. &nbsp;Users can</div>
<div>- &nbsp; &nbsp;also add their own source plugins - see 'wic help plugins' for</div>
<div>- &nbsp; &nbsp;details.</div>
<div>&#43;wic_rm_short_description = &quot;&quot;&quot;</div>
<div>&#43;Remove files or directories from the vfat or ext* partitions.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_ls_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- List content of a partitioned image</div>
<div>-</div>
<div>- usage: wic ls &lt;image&gt;[:&lt;partition&gt;[&lt;path&gt;]] [--native-sysroot &lt;path&gt;]</div>
<div>-</div>
<div>- This command &nbsp;outputs either list of image partitions or directory contents</div>
<div>- of vfat and ext* partitions.</div>
<div>-</div>
<div>- See 'wic help ls' for more detailed instructions.</div>
<div>-</div>
<div>&#43;wic_write_short_description = &quot;&quot;&quot;</div>
<div>&#43;Write an image to a device.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_ls_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic ls - List contents of partitioned image or partition</div>
<div>-</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic ls &lt;image&gt;</div>
<div>- &nbsp; &nbsp;wic ls &lt;image&gt;:&lt;vfat or ext* partition&gt;</div>
<div>- &nbsp; &nbsp;wic ls &lt;image&gt;:&lt;vfat or ext* partition&gt;&lt;path&gt;</div>
<div>- &nbsp; &nbsp;wic ls &lt;image&gt;:&lt;vfat or ext* partition&gt;&lt;path&gt; --native-sysroot &lt;path&gt;</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command lists either partitions of the image or directory contents</div>
<div>- &nbsp; &nbsp;of vfat or ext* partitions.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The first form it lists partitions of the image.</div>
<div>- &nbsp; &nbsp;For example:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Num &nbsp; &nbsp; Start &nbsp; &nbsp; &nbsp; &nbsp;End &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp; &nbsp; &nbsp;Fstype</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp;1048576 &nbsp; &nbsp; 24438783 &nbsp; &nbsp; 23390208 &nbsp;fat16</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;2 &nbsp; &nbsp; &nbsp; 25165824 &nbsp; &nbsp; 50315263 &nbsp; &nbsp; 25149440 &nbsp;ext4</div>
<div>-</div>
<div>- &nbsp; &nbsp;Second and third form list directory content of the partition:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; Volume Serial Number is 2DF2-5F02</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Directory for ::/</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;efi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;DIR&gt; &nbsp; &nbsp; 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;startup &nbsp;nsh &nbsp; &nbsp; &nbsp; &nbsp;26 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vmlinuz &nbsp; &nbsp; &nbsp; &nbsp;6922288 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 922 314 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 818 752 bytes free</div>
<div>-</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/EFI/boot/</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; Volume Serial Number is 2DF2-5F02</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Directory for ::/EFI/boot</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;DIR&gt; &nbsp; &nbsp; 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;.. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;grub &nbsp; &nbsp; cfg &nbsp; &nbsp; &nbsp; 679 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;bootx64 &nbsp;efi &nbsp; &nbsp;571392 2017-05-11 &nbsp;10:54</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 572 071 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 818 752 bytes free</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -n option is used to specify the path to the native sysroot</div>
<div>- &nbsp; &nbsp;containing the tools(parted and mtools) to use.</div>
<div>-</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_cp_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- Copy files and directories to the vfat or ext* partition</div>
<div>-</div>
<div>- usage: wic cp &lt;src&gt; &lt;image&gt;:&lt;partition&gt;[&lt;path&gt;] [--native-sysroot &lt;path&gt;]</div>
<div>-</div>
<div>- This command &nbsp;copies local files or directories to the vfat or ext* partitions</div>
<div>-of partitioned &nbsp;image.</div>
<div>-</div>
<div>- See 'wic help cp' for more detailed instructions.</div>
<div>-</div>
<div>&#43;wic_cp_short_description = &quot;&quot;&quot;</div>
<div>&#43;Copy files and directories to the vfat or ext* partitions.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_cp_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic cp - copy files and directories to the vfat or ext* partitions</div>
<div>-</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic cp &lt;src&gt; &lt;image&gt;:&lt;partition&gt;</div>
<div>- &nbsp; &nbsp;wic cp &lt;src&gt; &lt;image&gt;:&lt;partition&gt;&lt;path&gt;</div>
<div>- &nbsp; &nbsp;wic cp &lt;src&gt; &lt;image&gt;:&lt;partition&gt;&lt;path&gt; --native-sysroot &lt;path&gt;</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command copies files and directories to the vfat or ext* partition of</div>
<div>- &nbsp; &nbsp;the partitioned image.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The first form of it copies file or directory to the root directory of</div>
<div>- &nbsp; &nbsp;the partition:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic cp test.wks tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; Volume Serial Number is DB4C-FD4C</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Directory for ::/</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;efi &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;loader &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;startup &nbsp;nsh &nbsp; &nbsp; &nbsp; &nbsp;26 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vmlinuz &nbsp; &nbsp; &nbsp; &nbsp;6926384 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; wks &nbsp; &nbsp; &nbsp; 628 2017-05-24 &nbsp;21:22</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 6 927 038 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 677 440 bytes free</div>
<div>-</div>
<div>- &nbsp; &nbsp;The second form of the command copies file or directory to the specified directory</div>
<div>- &nbsp; &nbsp;on the partition:</div>
<div>- &nbsp; &nbsp; &nbsp; $ wic cp test tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/efi/</div>
<div>- &nbsp; &nbsp; &nbsp; $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/efi/</div>
<div>- &nbsp; &nbsp; &nbsp; Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume Serial Number is DB4C-FD4C</div>
<div>- &nbsp; &nbsp; &nbsp; Directory for ::/efi</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; . &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; .. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; boot &nbsp; &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;18:15</div>
<div>- &nbsp; &nbsp; &nbsp; test &nbsp; &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-24 &nbsp;21:27</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 4 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;15 675 392 bytes free</div>
<div>-</div>
<div>- &nbsp; &nbsp;The -n option is used to specify the path to the native sysroot</div>
<div>- &nbsp; &nbsp;containing the tools(parted and mtools) to use.</div>
<div>&#43;wic_ls_short_description = &quot;&quot;&quot;</div>
<div>&#43;Lists either partitions of the image or directory contents</div>
<div>&#43;of vfat or ext* partitions.&quot;&quot;&quot;</div>
<div>&#43;wic_help_short_description = &quot;&quot;&quot;</div>
<div>&#43;sss</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>-</div>
<div>-wic_rm_usage = &quot;&quot;&quot;</div>
<div>-</div>
<div>- Remove files or directories from the vfat or ext* partitions</div>
<div>-</div>
<div>- usage: wic rm &lt;image&gt;:&lt;partition&gt;&lt;path&gt; [--native-sysroot &lt;path&gt;]</div>
<div>-</div>
<div>- This command &nbsp;removes files or directories from the vfat or ext* partitions of</div>
<div>- the partitioned image.</div>
<div>-</div>
<div>- See 'wic help rm' for more detailed instructions.</div>
<div>-</div>
<div>&#43;wic_list_short_description = &quot;&quot;&quot;</div>
<div>&#43;List available canned images and source plugins</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_rm_help = &quot;&quot;&quot;</div>
<div>&#43;wic_create_description = &quot;&quot;&quot;</div>
<div>&#43;This command creates an OpenEmbedded image based on the 'OE</div>
<div>&#43;kickstart commands' found in the &lt;wks file&gt;.</div>
<div>&nbsp;</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic rm - remove files or directories from the vfat or ext* partitions</div>
<div>&#43;In order to do this, wic needs to know the locations of the</div>
<div>&#43;various build artifacts required to build the image.</div>
<div>&nbsp;</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic rm &lt;src&gt; &lt;image&gt;:&lt;partition&gt;&lt;path&gt;</div>
<div>- &nbsp; &nbsp;wic rm &lt;src&gt; &lt;image&gt;:&lt;partition&gt;&lt;path&gt; --native-sysroot &lt;path&gt;</div>
<div>&#43;Users can explicitly specify the build artifact locations using</div>
<div>&#43;the -r, -b, -k, and -n options. &nbsp;See below for details on where</div>
<div>&#43;the corresponding artifacts are typically found in a normal</div>
<div>&#43;OpenEmbedded build.</div>
<div>&nbsp;</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command removes files or directories from the vfat or ext* partition of the</div>
<div>- &nbsp; &nbsp;partitioned image:</div>
<div>&#43;Alternatively, users can use the -e option to have 'wic' determine</div>
<div>&#43;those locations for a given image. &nbsp;If the -e option is used, the</div>
<div>&#43;user needs to have set the appropriate MACHINE variable in</div>
<div>&#43;local.conf, and have sourced the build environment.</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; Volume Serial Number is 11D0-DE21</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Directory for ::/</div>
<div>&#43;The -s option is used to skip the build check. &nbsp;The build check is</div>
<div>&#43;a simple sanity check used to determine whether the user has</div>
<div>&#43;sourced the build environment so that the -e option can operate</div>
<div>&#43;correctly. &nbsp;If the user has specified the build artifact locations</div>
<div>&#43;explicitly, 'wic' assumes the user knows what he or she is doing</div>
<div>&#43;and skips the build check.</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;libcom32 c32 &nbsp; &nbsp;186500 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;libutil &nbsp;c32 &nbsp; &nbsp; 24148 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;syslinux cfg &nbsp; &nbsp; &nbsp; 209 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vesamenu c32 &nbsp; &nbsp; 27104 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vmlinuz &nbsp; &nbsp; &nbsp; &nbsp;6926384 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 164 345 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 582 656 bytes free</div>
<div>&#43;When 'wic -e' is used, the locations for the build artifacts</div>
<div>&#43;values are determined by 'wic -e' from the output of the 'bitbake</div>
<div>&#43;-e' command given an image name e.g. 'core-image-minimal' and a</div>
<div>&#43;given machine set in local.conf. &nbsp;In that case, the image is</div>
<div>&#43;created as if the following 'bitbake -e' variables were used:</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic rm ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/libutil.c32</div>
<div>&#43;-r: &nbsp; &nbsp; &nbsp; &nbsp;IMAGE_ROOTFS</div>
<div>&#43;-k: &nbsp; &nbsp; &nbsp; &nbsp;STAGING_KERNEL_DIR</div>
<div>&#43;-n: &nbsp; &nbsp; &nbsp; &nbsp;STAGING_DIR_NATIVE</div>
<div>&#43;-b: &nbsp; &nbsp; &nbsp; &nbsp;empty (plugin-specific handlers must determine this)</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic ls ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; Volume Serial Number is 11D0-DE21</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;Directory for ::/</div>
<div>&#43;If 'wic -e' is not used, the user needs to select the appropriate</div>
<div>&#43;value for -b (as well as -r, -k, and -n).</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;libcom32 c32 &nbsp; &nbsp;186500 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;syslinux cfg &nbsp; &nbsp; &nbsp; 209 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vesamenu c32 &nbsp; &nbsp; 27104 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;vmlinuz &nbsp; &nbsp; &nbsp; &nbsp;6926384 2017-06-02 &nbsp;15:15</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7 140 197 bytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16 607 232 bytes free</div>
<div>&#43;Here's an example that doesn't take the easy way out and manually</div>
<div>&#43;specifies each build artifact, along with a non-canned .wks file,</div>
<div>&#43;and also uses the -o option to have wic create the output</div>
<div>&#43;somewhere other than the default /var/tmp/wic:</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp;The -n option is used to specify the path to the native sysroot</div>
<div>- &nbsp; &nbsp;containing the tools(parted and mtools) to use.</div>
<div>&#43; &nbsp;$ wic create ./test.wks -o ./out --rootfs-dir</div>
<div>&#43; &nbsp;tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs</div>
<div>&#43; &nbsp;--bootimg-dir tmp/sysroots/qemux86-64/usr/share</div>
<div>&#43; &nbsp;--kernel-dir tmp/deploy/images/qemux86-64</div>
<div>&#43; &nbsp;--native-sysroot tmp/sysroots/x86_64-linux</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_write_usage = &quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>- Write image to a device</div>
<div>&#43;wic_list_description = &quot;&quot;&quot;</div>
<div>&#43;This command enumerates the set of available canned images as well</div>
<div>&#43;as help for those images. &nbsp;It also can be used to list available</div>
<div>&#43;source plugins.</div>
<div>&nbsp;</div>
<div>- usage: wic write &lt;image&gt; &lt;target device&gt; [--expand [rules]] [--native-sysroot &lt;path&gt;]</div>
<div>&#43;The first form enumerates all the available 'canned' images.</div>
<div>&#43;These are actually just the set of .wks files that have been moved</div>
<div>&#43;into the /scripts/lib/wic/canned-wks directory).</div>
<div>&nbsp;</div>
<div>- This command writes partitioned image to a target device (USB stick, SD card etc).</div>
<div>-</div>
<div>- See 'wic help write' for more detailed instructions.</div>
<div>&#43;The second form lists the detailed help information for a specific</div>
<div>&#43;'canned' image.</div>
<div>&nbsp;</div>
<div>&#43;The third form enumerates all the available --sources (source</div>
<div>&#43;plugins). &nbsp;The contents of a given partition are driven by code</div>
<div>&#43;defined in 'source plugins'. &nbsp;Users specify a specific plugin via</div>
<div>&#43;the --source parameter of the partition .wks command. &nbsp;Normally</div>
<div>&#43;this is the 'rootfs' plugin but can be any of the more specialized</div>
<div>&#43;sources listed by the 'list source-plugins' command. &nbsp;Users can</div>
<div>&#43;also add their own source plugins - see 'wic help plugins' for</div>
<div>&#43;details.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_write_help = &quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic write - write an image to a device</div>
<div>&#43;wic_ls_description = &quot;&quot;&quot;</div>
<div>&#43;This command lists either partitions of the image or directory contents</div>
<div>&#43;of vfat or ext* partitions.</div>
<div>&nbsp;</div>
<div>-SYNOPSIS</div>
<div>- &nbsp; &nbsp;wic write &lt;image&gt; &lt;target&gt;</div>
<div>- &nbsp; &nbsp;wic write &lt;image&gt; &lt;target&gt; --expand auto</div>
<div>- &nbsp; &nbsp;wic write &lt;image&gt; &lt;target&gt; --expand 1:100M-2:300M</div>
<div>- &nbsp; &nbsp;wic write &lt;image&gt; &lt;target&gt; --native-sysroot &lt;path&gt;</div>
<div>&#43;The first form lists partitions of the image.</div>
<div>&#43;For example:</div>
<div>&#43; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic</div>
<div>&#43; &nbsp; &nbsp;Num &nbsp; &nbsp; Start &nbsp; &nbsp; &nbsp; &nbsp;End &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Size &nbsp; &nbsp; &nbsp;Fstype</div>
<div>&#43; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp;1048576 &nbsp; &nbsp; 24438783 &nbsp; &nbsp; 23390208 &nbsp;fat16</div>
<div>&#43; &nbsp; &nbsp;2 &nbsp; &nbsp; &nbsp; 25165824 &nbsp; &nbsp; 50315263 &nbsp; &nbsp; 25149440 &nbsp;ext4</div>
<div>&nbsp;</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This command writes an image to a target device (USB stick, SD card etc)</div>
<div>&#43;The second form lists directory contents of the first partition:</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;$ wic write ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic /dev/sdb</div>
<div>&#43; &nbsp; &nbsp;$ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/EFI/boot/</div>
<div>&#43; &nbsp; &nbsp;Volume in drive : is boot</div>
<div>&#43; &nbsp; &nbsp; Volume Serial Number is 2DF2-5F02</div>
<div>&#43; &nbsp; &nbsp;Directory for ::/EFI/boot</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp;The --expand option is used to resize image partitions.</div>
<div>- &nbsp; &nbsp;--expand auto expands partitions to occupy all free space available on the target device.</div>
<div>- &nbsp; &nbsp;It's also possible to specify expansion rules in a format</div>
<div>- &nbsp; &nbsp;&lt;partition&gt;:&lt;size&gt;[-&lt;partition&gt;:&lt;size&gt;...] for one or more partitions.</div>
<div>- &nbsp; &nbsp;Specifying size 0 will keep partition unmodified.</div>
<div>- &nbsp; &nbsp;Note: Resizing boot partition can result in non-bootable image for non-EFI images. It is</div>
<div>- &nbsp; &nbsp;recommended to use size 0 for boot partition to keep image bootable.</div>
<div>&#43; &nbsp; &nbsp;. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;DIR&gt; &nbsp; &nbsp; 2017-05-11 &nbsp;10:54</div>
<div>&#43; &nbsp; &nbsp;.. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;DIR&gt; &nbsp; &nbsp; 2017-05-11 &nbsp;10:54</div>
<div>&#43; &nbsp; &nbsp;grub &nbsp; &nbsp; cfg &nbsp; &nbsp; &nbsp; 679 2017-05-11 &nbsp;10:54</div>
<div>&#43; &nbsp; &nbsp;bootx64 &nbsp;efi &nbsp; &nbsp;571392 2017-05-11 &nbsp;10:54</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 files &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 572 071 bytes</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15 818 752 bytes free</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp;The --native-sysroot option is used to specify the path to the native sysroot</div>
<div>- &nbsp; &nbsp;containing the tools(parted, resize2fs) to use.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_plugins_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic plugins - Overview and API</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;plugins allow wic functionality to be extended and specialized by</div>
<div>- &nbsp; &nbsp;users. &nbsp;This section documents the plugin interface, which is</div>
<div>- &nbsp; &nbsp;currently restricted to 'source' plugins.</div>
<div>-</div>
<div>- &nbsp; &nbsp;'Source' plugins provide a mechanism to customize various aspects</div>
<div>- &nbsp; &nbsp;of the image generation process in wic, mainly the contents of</div>
<div>- &nbsp; &nbsp;partitions.</div>
<div>-</div>
<div>- &nbsp; &nbsp;Source plugins provide a mechanism for mapping values specified in</div>
<div>- &nbsp; &nbsp;.wks files using the --source keyword to a particular plugin</div>
<div>- &nbsp; &nbsp;implementation that populates a corresponding partition.</div>
<div>-</div>
<div>- &nbsp; &nbsp;A source plugin is created as a subclass of SourcePlugin (see</div>
<div>- &nbsp; &nbsp;scripts/lib/wic/pluginbase.py) and the plugin file containing it</div>
<div>- &nbsp; &nbsp;is added to scripts/lib/wic/plugins/source/ to make the plugin</div>
<div>- &nbsp; &nbsp;implementation available to the wic implementation.</div>
<div>-</div>
<div>- &nbsp; &nbsp;Source plugins can also be implemented and added by external</div>
<div>- &nbsp; &nbsp;layers - any plugins found in a scripts/lib/wic/plugins/source/</div>
<div>- &nbsp; &nbsp;directory in an external layer will also be made available.</div>
<div>-</div>
<div>- &nbsp; &nbsp;When the wic implementation needs to invoke a partition-specific</div>
<div>- &nbsp; &nbsp;implementation, it looks for the plugin that has the same name as</div>
<div>- &nbsp; &nbsp;the --source param given to that partition. &nbsp;For example, if the</div>
<div>- &nbsp; &nbsp;partition is set up like this:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;part /boot --source bootimg-pcbios &nbsp; ...</div>
<div>-</div>
<div>- &nbsp; &nbsp;then the methods defined as class members of the plugin having the</div>
<div>- &nbsp; &nbsp;matching bootimg-pcbios .name class member would be used.</div>
<div>-</div>
<div>- &nbsp; &nbsp;To be more concrete, here's the plugin definition that would match</div>
<div>- &nbsp; &nbsp;a '--source bootimg-pcbios' usage, along with an example method</div>
<div>- &nbsp; &nbsp;that would be called by the wic implementation when it needed to</div>
<div>- &nbsp; &nbsp;invoke an implementation-specific partition-preparation function:</div>
<div>-</div>
<div>- &nbsp; &nbsp;class BootimgPcbiosPlugin(SourcePlugin):</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;name = 'bootimg-pcbios'</div>
<div>&#43;wic_cp_description = &quot;&quot;&quot;</div>
<div>&#43;This command copies files and directories to the vfat or ext* partition of</div>
<div>&#43;the partitioned image.</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp;@classmethod</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;def do_prepare_partition(self, part, ...)</div>
<div>-</div>
<div>- &nbsp; &nbsp;If the subclass itself doesn't implement a function, a 'default'</div>
<div>- &nbsp; &nbsp;version in a superclass will be located and used, which is why all</div>
<div>- &nbsp; &nbsp;plugins must be derived from SourcePlugin.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The SourcePlugin class defines the following methods, which is the</div>
<div>- &nbsp; &nbsp;current set of methods that can be implemented/overridden by</div>
<div>- &nbsp; &nbsp;--source plugins. &nbsp;Any methods not implemented by a SourcePlugin</div>
<div>- &nbsp; &nbsp;subclass inherit the implementations present in the SourcePlugin</div>
<div>- &nbsp; &nbsp;class (see the SourcePlugin source for details):</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;do_prepare_partition()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Called to do the actual content population for a</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;partition. In other words, it 'prepares' the final partition</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;image which will be incorporated into the disk image.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;do_configure_partition()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Called before do_prepare_partition(), typically used to</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;create custom configuration files for a partition, for</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;example syslinux or grub config files.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;do_install_disk()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Called after all partitions have been prepared and assembled</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;into a disk image. &nbsp;This provides a hook to allow</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;finalization of a disk image, for example to write an MBR to</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;it.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;do_stage_partition()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Special content-staging hook called before</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do_prepare_partition(), normally empty.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Typically, a partition will just use the passed-in</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parameters, for example the unmodified value of bootimg_dir.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;In some cases however, things may need to be more tailored.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;As an example, certain files may additionally need to be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;take from bootimg_dir &#43; /boot. &nbsp;This hook allows those files</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to be staged in a customized fashion. &nbsp;Note that</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;get_bitbake_var() allows you to access non-standard</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;variables that you might want to use for these types of</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;situations.</div>
<div>-</div>
<div>- &nbsp; &nbsp;This scheme is extensible - adding more hooks is a simple matter</div>
<div>- &nbsp; &nbsp;of adding more plugin methods to SourcePlugin and derived classes.</div>
<div>- &nbsp; &nbsp;Please see the implementation for details.</div>
<div>&#43;Copies file or directory to the specified directory</div>
<div>&#43;on the partition:</div>
<div>&#43; &nbsp; $ wic cp test tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/efi/</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_overview_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic overview - General overview of wic</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;The 'wic' command generates partitioned images from existing</div>
<div>- &nbsp; &nbsp;OpenEmbedded build artifacts. &nbsp;Image generation is driven by</div>
<div>- &nbsp; &nbsp;partitioning commands contained in an 'Openembedded kickstart'</div>
<div>- &nbsp; &nbsp;(.wks) file (see 'wic help kickstart') specified either directly</div>
<div>- &nbsp; &nbsp;on the command-line or as one of a selection of canned .wks files</div>
<div>- &nbsp; &nbsp;(see 'wic list images'). &nbsp;When applied to a given set of build</div>
<div>- &nbsp; &nbsp;artifacts, the result is an image or set of images that can be</div>
<div>- &nbsp; &nbsp;directly written onto media and used on a particular system.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The 'wic' command and the infrastructure it's based on is by</div>
<div>- &nbsp; &nbsp;definition incomplete - its purpose is to allow the generation of</div>
<div>- &nbsp; &nbsp;customized images, and as such was designed to be completely</div>
<div>- &nbsp; &nbsp;extensible via a plugin interface (see 'wic help plugins').</div>
<div>-</div>
<div>- &nbsp;Background and Motivation</div>
<div>-</div>
<div>- &nbsp; &nbsp;wic is meant to be a completely independent standalone utility</div>
<div>- &nbsp; &nbsp;that initially provides easier-to-use and more flexible</div>
<div>- &nbsp; &nbsp;replacements for a couple bits of existing functionality in</div>
<div>- &nbsp; &nbsp;oe-core: directdisk.bbclass and mkefidisk.sh. &nbsp;The difference</div>
<div>- &nbsp; &nbsp;between wic and those examples is that with wic the functionality</div>
<div>- &nbsp; &nbsp;of those scripts is implemented by a general-purpose partitioning</div>
<div>- &nbsp; &nbsp;'language' based on Redhat kickstart syntax).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The initial motivation and design considerations that lead to the</div>
<div>- &nbsp; &nbsp;current tool are described exhaustively in Yocto Bug #3847</div>
<div>- &nbsp; &nbsp;(https://bugzilla.yoctoproject.org/show_bug.cgi?id=3847).</div>
<div>-</div>
<div>- &nbsp;Implementation and Examples</div>
<div>-</div>
<div>- &nbsp; &nbsp;wic can be used in two different modes, depending on how much</div>
<div>- &nbsp; &nbsp;control the user needs in specifying the Openembedded build</div>
<div>- &nbsp; &nbsp;artifacts that will be used in creating the image: 'raw' and</div>
<div>- &nbsp; &nbsp;'cooked'.</div>
<div>-</div>
<div>- &nbsp; &nbsp;If used in 'raw' mode, artifacts are explicitly specified via</div>
<div>- &nbsp; &nbsp;command-line arguments (see example below).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The more easily usable 'cooked' mode uses the current MACHINE</div>
<div>- &nbsp; &nbsp;setting and a specified image name to automatically locate the</div>
<div>- &nbsp; &nbsp;artifacts used to create the image.</div>
<div>-</div>
<div>- &nbsp; &nbsp;OE kickstart files (.wks) can of course be specified directly on</div>
<div>- &nbsp; &nbsp;the command-line, but the user can also choose from a set of</div>
<div>- &nbsp; &nbsp;'canned' .wks files available via the 'wic list images' command</div>
<div>- &nbsp; &nbsp;(example below).</div>
<div>-</div>
<div>- &nbsp; &nbsp;In any case, the prerequisite for generating any image is to have</div>
<div>- &nbsp; &nbsp;the build artifacts already available. &nbsp;The below examples assume</div>
<div>- &nbsp; &nbsp;the user has already build a 'core-image-minimal' for a specific</div>
<div>- &nbsp; &nbsp;machine (future versions won't require this redundant step, but</div>
<div>- &nbsp; &nbsp;for now that's typically how build artifacts get generated).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The other prerequisite is to source the build environment:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ source oe-init-build-env</div>
<div>-</div>
<div>- &nbsp; &nbsp;To start out with, we'll generate an image from one of the canned</div>
<div>- &nbsp; &nbsp;.wks files. &nbsp;The following generates a list of availailable</div>
<div>- &nbsp; &nbsp;images:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic list images</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;mkefidisk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Create an EFI disk image</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;directdisk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Create a 'pcbios' direct disk image</div>
<div>-</div>
<div>- &nbsp; &nbsp;You can get more information about any of the available images by</div>
<div>- &nbsp; &nbsp;typing 'wic list xxx help', where 'xxx' is one of the image names:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic list mkefidisk help</div>
<div>-</div>
<div>- &nbsp; &nbsp;Creates a partitioned EFI disk image that the user can directly dd</div>
<div>- &nbsp; &nbsp;to boot media.</div>
<div>-</div>
<div>- &nbsp; &nbsp;At any time, you can get help on the 'wic' command or any</div>
<div>- &nbsp; &nbsp;subcommand (currently 'list' and 'create'). &nbsp;For instance, to get</div>
<div>- &nbsp; &nbsp;the description of 'wic create' command and its parameters:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic create</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; Usage:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; Create a new OpenEmbedded image</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; usage: wic create &lt;wks file or image name&gt; [-o &lt;DIRNAME&gt; | ...]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-i &lt;JSON PROPERTY FILE&gt; | --infile &lt;JSON PROPERTY_FILE&gt;]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-e | --image-name] [-s, --skip-build-check] [-D, --debug]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-r, --rootfs-dir] [-b, --bootimg-dir] [-k, --kernel-dir]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[-n, --native-sysroot] [-f, --build-rootfs]</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; This command creates an OpenEmbedded image based on the 'OE</div>
<div>- &nbsp; &nbsp; &nbsp; kickstart commands' found in the &lt;wks file&gt;.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; The -o option can be used to place the image in a directory</div>
<div>- &nbsp; &nbsp; &nbsp; with a different name and location.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; See 'wic help create' for more detailed instructions.</div>
<div>- &nbsp; &nbsp; &nbsp; ...</div>
<div>-</div>
<div>- &nbsp; &nbsp;As mentioned in the command, you can get even more detailed</div>
<div>- &nbsp; &nbsp;information by adding 'help' to the above:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic help create</div>
<div>-</div>
<div>- &nbsp; &nbsp;So, the easiest way to create an image is to use the -e option</div>
<div>- &nbsp; &nbsp;with a canned .wks file. &nbsp;To use the -e option, you need to</div>
<div>- &nbsp; &nbsp;specify the image used to generate the artifacts and you actually</div>
<div>- &nbsp; &nbsp;need to have the MACHINE used to build them specified in your</div>
<div>- &nbsp; &nbsp;local.conf (these requirements aren't necessary if you aren't</div>
<div>- &nbsp; &nbsp;using the -e options.) &nbsp;Below, we generate a directdisk image,</div>
<div>- &nbsp; &nbsp;pointing the process at the core-image-minimal artifacts for the</div>
<div>- &nbsp; &nbsp;current MACHINE:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic create directdisk -e core-image-minimal</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Checking basic build environment...</div>
<div>- &nbsp; &nbsp; &nbsp;Done.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Creating image(s)...</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Info: The new image(s) can be found here:</div>
<div>- &nbsp; &nbsp; &nbsp;/var/tmp/wic/build/directdisk-201309252350-sda.direct</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;The following build artifacts were used to create the image(s):</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;ROOTFS_DIR: &nbsp; &nbsp; &nbsp;...</div>
<div>- &nbsp; &nbsp; &nbsp;BOOTIMG_DIR: &nbsp; &nbsp; ...</div>
<div>- &nbsp; &nbsp; &nbsp;KERNEL_DIR: &nbsp; &nbsp; &nbsp;...</div>
<div>- &nbsp; &nbsp; &nbsp;NATIVE_SYSROOT: &nbsp;...</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;The image(s) were created using OE kickstart file:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;.../scripts/lib/wic/canned-wks/directdisk.wks</div>
<div>-</div>
<div>- &nbsp; &nbsp;The output shows the name and location of the image created, and</div>
<div>- &nbsp; &nbsp;so that you know exactly what was used to generate the image, each</div>
<div>- &nbsp; &nbsp;of the artifacts and the kickstart file used.</div>
<div>-</div>
<div>- &nbsp; &nbsp;Similarly, you can create a 'mkefidisk' image in the same way</div>
<div>- &nbsp; &nbsp;(notice that this example uses a different machine - because it's</div>
<div>- &nbsp; &nbsp;using the -e option, you need to change the MACHINE in your</div>
<div>- &nbsp; &nbsp;local.conf):</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic create mkefidisk -e core-image-minimal</div>
<div>- &nbsp; &nbsp; &nbsp;Checking basic build environment...</div>
<div>- &nbsp; &nbsp; &nbsp;Done.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Creating image(s)...</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Info: The new image(s) can be found here:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; /var/tmp/wic/build/mkefidisk-201309260027-sda.direct</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;...</div>
<div>-</div>
<div>- &nbsp; &nbsp;Here's an example that doesn't take the easy way out and manually</div>
<div>- &nbsp; &nbsp;specifies each build artifact, along with a non-canned .wks file,</div>
<div>- &nbsp; &nbsp;and also uses the -o option to have wic create the output</div>
<div>- &nbsp; &nbsp;somewhere other than the default /var/tmp/wic:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;$ wic create ./test.wks -o ./out --rootfs-dir</div>
<div>- &nbsp; &nbsp; &nbsp;tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs</div>
<div>- &nbsp; &nbsp; &nbsp;--bootimg-dir tmp/sysroots/qemux86-64/usr/share</div>
<div>- &nbsp; &nbsp; &nbsp;--kernel-dir tmp/deploy/images/qemux86-64</div>
<div>- &nbsp; &nbsp; &nbsp;--native-sysroot tmp/sysroots/x86_64-linux</div>
<div>-</div>
<div>- &nbsp; &nbsp; Creating image(s)...</div>
<div>-</div>
<div>- &nbsp; &nbsp; Info: The new image(s) can be found here:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out/build/test-201507211313-sda.direct</div>
<div>-</div>
<div>- &nbsp; &nbsp; The following build artifacts were used to create the image(s):</div>
<div>- &nbsp; &nbsp; &nbsp; ROOTFS_DIR: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs</div>
<div>- &nbsp; &nbsp; &nbsp; BOOTIMG_DIR: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tmp/sysroots/qemux86-64/usr/share</div>
<div>- &nbsp; &nbsp; &nbsp; KERNEL_DIR: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tmp/deploy/images/qemux86-64</div>
<div>- &nbsp; &nbsp; &nbsp; NATIVE_SYSROOT: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tmp/sysroots/x86_64-linux</div>
<div>-</div>
<div>- &nbsp; &nbsp; The image(s) were created using OE kickstart file:</div>
<div>- &nbsp; &nbsp; ./test.wks</div>
<div>-</div>
<div>- &nbsp; &nbsp; Here is a content of test.wks:</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024</div>
<div>- &nbsp; &nbsp; part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024</div>
<div>&#43;wic_rm_description = &quot;&quot;&quot;</div>
<div>&#43;This command removes files or directories from the vfat or ext* partition of the</div>
<div>&#43;partitioned image: wic rm &lt;wic image&gt;:&lt;partition&gt;&lt;path&gt;&nbsp;</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; bootloader &nbsp;--timeout=0 &nbsp;--append=&quot;rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0&quot;</div>
<div>&#43;$wic rm ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/libutil.c32&nbsp;</div>
<div>&nbsp;</div>
<div>-</div>
<div>- &nbsp; &nbsp;Finally, here's an example of the actual partition language</div>
<div>- &nbsp; &nbsp;commands used to generate the mkefidisk image i.e. these are the</div>
<div>- &nbsp; &nbsp;contents of the mkefidisk.wks OE kickstart file:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;# short-description: Create an EFI disk image</div>
<div>- &nbsp; &nbsp; &nbsp;# long-description: Creates a partitioned EFI disk image that the user</div>
<div>- &nbsp; &nbsp; &nbsp;# can directly dd to boot media.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;part /boot --source bootimg-efi --ondisk sda --fstype=efi --active</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;part / --source rootfs --ondisk sda --fstype=ext3 --label platform</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;part swap --ondisk sda --size 44 --label swap1 --fstype=swap</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;bootloader &nbsp;--timeout=10 &nbsp;--append=&quot;rootwait console=ttyPCH0,115200&quot;</div>
<div>-</div>
<div>- &nbsp; &nbsp;You can get a complete listing and description of all the</div>
<div>- &nbsp; &nbsp;kickstart commands available for use in .wks files from 'wic help</div>
<div>- &nbsp; &nbsp;kickstart'.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>&nbsp;</div>
<div>-wic_kickstart_help = &quot;&quot;&quot;</div>
<div>-</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic kickstart - wic kickstart reference</div>
<div>-</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;This section provides the definitive reference to the wic</div>
<div>- &nbsp; &nbsp;kickstart language. &nbsp;It also provides documentation on the list of</div>
<div>- &nbsp; &nbsp;--source plugins available for use from the 'part' command (see</div>
<div>- &nbsp; &nbsp;the 'Platform-specific Plugins' section below).</div>
<div>-</div>
<div>- &nbsp; &nbsp;The current wic implementation supports only the basic kickstart</div>
<div>- &nbsp; &nbsp;partitioning commands: partition (or part for short) and</div>
<div>- &nbsp; &nbsp;bootloader.</div>
<div>-</div>
<div>- &nbsp; &nbsp;The following is a listing of the commands, their syntax, and</div>
<div>- &nbsp; &nbsp;meanings. The commands are based on the Fedora kickstart</div>
<div>- &nbsp; &nbsp;documentation but with modifications to reflect wic capabilities.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition</div>
<div>- &nbsp; &nbsp; &nbsp;http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader</div>
<div>-</div>
<div>- &nbsp;Commands</div>
<div>-</div>
<div>- &nbsp; &nbsp;* 'part' or 'partition'</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; This command creates a partition on the system and uses the</div>
<div>- &nbsp; &nbsp; &nbsp; following syntax:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; part [&lt;mountpoint&gt;]</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; The &lt;mountpoint&gt; is where the partition will be mounted and</div>
<div>- &nbsp; &nbsp; &nbsp; must take of one of the following forms:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; /&lt;path&gt;: For example: /, /usr, or /home</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; swap: The partition will be used as swap space.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; If a &lt;mountpoint&gt; is not specified the partition will be created</div>
<div>- &nbsp; &nbsp; &nbsp; but will not be mounted.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; Partitions with a &lt;mountpoint&gt; specified will be automatically mounted.</div>
<div>- &nbsp; &nbsp; &nbsp; This is achieved by wic adding entries to the fstab during image</div>
<div>- &nbsp; &nbsp; &nbsp; generation. In order for a valid fstab to be generated one of the</div>
<div>- &nbsp; &nbsp; &nbsp; --ondrive, --ondisk or --use-uuid partition options must be used for</div>
<div>- &nbsp; &nbsp; &nbsp; each partition that specifies a mountpoint.</div>
<div>-</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; The following are supported 'part' options:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --size: The minimum partition size. Specify an integer value</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; such as 500. Multipliers k, M ang G can be used. If</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; not specified, the size is in MB.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; You do not need this option if you use --source.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --fixed-size: Exact partition size. Value format is the same</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; as for --size option. This option cannot be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; specified along with --size. If partition data</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; is larger than --fixed-size and error will be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; raised when assembling disk image.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --source: This option is a wic-specific option that names the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; source of the data that will populate the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; partition. &nbsp;The most common value for this option</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; is 'rootfs', but can be any value which maps to a</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; valid 'source plugin' (see 'wic help plugins').</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If '--source rootfs' is used, it tells the wic</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; command to create a partition as large as needed</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and to fill it with the contents of the root</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; filesystem pointed to by the '-r' wic command-line</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; option (or the equivalent rootfs derived from the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '-e' command-line option). &nbsp;The filesystem type</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; that will be used to create the partition is driven</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; by the value of the --fstype option specified for</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the partition (see --fstype below).</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If --source &lt;plugin-name&gt;' is used, it tells the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wic command to create a partition as large as</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; needed and to fill with the contents of the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; partition that will be generated by the specified</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plugin name using the data pointed to by the '-r'</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wic command-line option (or the equivalent rootfs</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; derived from the '-e' command-line option).</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exactly what those contents and filesystem type end</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up being are dependent on the given plugin</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; implementation.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If --source option is not used, the wic command</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; will create empty partition. --size parameter has</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; to be used to specify size of empty partition.</div>
<div>&#43;wic_write_description = &quot;&quot;&quot;</div>
<div>&#43;This command writes an image to a target device (USB stick, SD card etc)</div>
<div>&nbsp;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --ondisk or --ondrive: Forces the partition to be created on</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a particular disk.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --fstype: Sets the file system type for the partition. &nbsp;These</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; apply to partitions created using '--source rootfs' (see</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --source above). &nbsp;Valid values are:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vfat</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msdos</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext2</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext3</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ext4</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btrfs</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; squashfs</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; swap</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --fsoptions: Specifies a free-form string of options to be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;used when mounting the filesystem. This string</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;will be copied into the /etc/fstab file of the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;installed system and should be enclosed in</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;quotes. &nbsp;If not specified, the default string is</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;defaults&quot;.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --label label: Specifies the label to give to the filesystem</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to be made on the partition. If the given</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;label is already in use by another filesystem,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a new label is created for the partition.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --active: Marks the partition as active.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --align (in KBytes): This option is specific to wic and says</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to start a partition on an x KBytes</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;boundary.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --no-table: This option is specific to wic. Space will be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reserved for the partition and it will be</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; populated but it will not be added to the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; partition table. It may be useful for</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bootloaders.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --exclude-path: This option is specific to wic. It excludes the given</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; relative path from the resulting image. If the path</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ends with a slash, only the content of the directory</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; is omitted, not the directory itself. This option only</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; has an effect with the rootfs source plugin.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --extra-space: This option is specific to wic. It adds extra</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;space after the space filled by the content</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;of the partition. The final size can go</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;beyond the size specified by --size.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;By default, 10MB. This option cannot be used</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;with --fixed-size option.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --overhead-factor: This option is specific to wic. The</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size of the partition is multiplied by</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this factor. It has to be greater than or</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;equal to 1. The default value is 1.3.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;This option cannot be used with --fixed-size</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;option.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --part-name: This option is specific to wic. It specifies name for GPT partitions.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --part-type: This option is specific to wic. It specifies partition</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type GUID for GPT partitions.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;List of partition type GUIDS can be found here:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --use-uuid: This option is specific to wic. It makes wic to generate</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; random globally unique identifier (GUID) for the partition</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and use it in bootloader configuration to specify root partition.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --uuid: This option is specific to wic. It specifies partition UUID.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; It's useful if preconfigured partition UUID is added to kernel command line</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in bootloader configuration before running wic. In this case .wks file can</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; be generated or modified to set preconfigured parition UUID using this option.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --system-id: This option is specific to wic. It specifies partition system id. It's useful</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for the harware that requires non-default partition system ids. The parameter</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;in one byte long hex number either with 0x prefix or without it.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; --mkfs-extraopts: This option specifies extra options to pass to mkfs utility.</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOTE, that wic uses default options for some filesystems, for example</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '-S 512' for mkfs.fat or '-F -i 8192' for mkfs.ext. Those options will</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; not take effect when --mkfs-extraopts is used. This should be taken into</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; account when using --mkfs-extraopts.</div>
<div>-</div>
<div>- &nbsp; &nbsp;* bootloader</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;This command allows the user to specify various bootloader</div>
<div>- &nbsp; &nbsp; &nbsp;options. &nbsp;The following are supported 'bootloader' options:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;--timeout: Specifies the number of seconds before the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bootloader times out and boots the default option.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;--append: Specifies kernel parameters. These will be added to</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bootloader command-line - for example, the syslinux</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;APPEND or grub kernel command line.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;--configfile: Specifies a user defined configuration file for</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the bootloader. This file must be located in the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;canned-wks folder or could be the full path to the</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file. Using this option will override any other</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bootloader option.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Note that bootloader functionality and boot partitions are</div>
<div>- &nbsp; &nbsp; &nbsp;implemented by the various --source plugins that implement</div>
<div>- &nbsp; &nbsp; &nbsp;bootloader functionality; the bootloader command essentially</div>
<div>- &nbsp; &nbsp; &nbsp;provides a means of modifying bootloader configuration.</div>
<div>-</div>
<div>- &nbsp; &nbsp;* include</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;This command allows the user to include the content of .wks file</div>
<div>- &nbsp; &nbsp; &nbsp;into original .wks file.</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;Command uses the following syntax:</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; include &lt;file&gt;</div>
<div>-</div>
<div>- &nbsp; &nbsp; &nbsp;The &lt;file&gt; is either path to the file or its name. If name is</div>
<div>- &nbsp; &nbsp; &nbsp;specified wic will try to find file in the directories with canned</div>
<div>- &nbsp; &nbsp; &nbsp;.wks files.</div>
<div>-</div>
<div>-&quot;&quot;&quot;</div>
<div>&#43; &nbsp; &nbsp;$ wic write ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic /dev/sdb</div>
<div>&nbsp;</div>
<div>-wic_help_help = &quot;&quot;&quot;</div>
<div>-NAME</div>
<div>- &nbsp; &nbsp;wic help - display a help topic</div>
<div>&#43;The --expand option is used to resize image partitions.</div>
<div>&#43;--expand auto expands partitions to occupy all free space available on the target device.</div>
<div>&#43;It's also possible to specify expansion rules in a format</div>
<div>&#43;&lt;partition&gt;:&lt;size&gt;[-&lt;partition&gt;:&lt;size&gt;...] for one or more partitions.</div>
<div>&#43;Specifying size 0 will keep partition unmodified.</div>
<div>&#43;Note: Resizing boot partition can result in non-bootable image for non-EFI images. It is</div>
<div>&#43;recommended to use size 0 for boot partition to keep image bootable.</div>
<div>&nbsp;</div>
<div>-DESCRIPTION</div>
<div>- &nbsp; &nbsp;Specify a help topic to display it. Topics are shown above.</div>
<div>&nbsp;&quot;&quot;&quot;</div>
<div>diff --git a/scripts/wic b/scripts/wic</div>
<div>index 097084a..cb348e3 100755</div>
<div>--- a/scripts/wic</div>
<div>&#43;&#43;&#43; b/scripts/wic</div>
<div>@@ -106,7 &#43;106,7 @@ class RootfsArgAction(argparse.Action):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;namespace.__dict__['rootfs_dir'][key] = rootfs_dir</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>-def wic_create_subcommand(options, usage_str):</div>
<div>&#43;def wic_create_subcommand(options):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for image creation. &nbsp;The real work is done</div>
<div>&nbsp; &nbsp; &nbsp;by image.engine.wic_create()</div>
<div>@@ -177,7 &#43;177,7 @@ def wic_create_subcommand(options, usage_str):</div>
<div>&nbsp; &nbsp; &nbsp;wks_file = options.wks_file</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;if not wks_file.endswith(&quot;.wks&quot;):</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;wks_file = engine.find_canned_image(scripts_path, wks_file)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;wks_file = engine.find_canned_image(wks_file)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if not wks_file:</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise WicError(&quot;No image named %s found, exiting. &nbsp;(Use 'wic list images' &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;to list available images, or specify a fully-qualified OE &quot;</div>
<div>@@ -227,91 &#43;227,44 @@ def wic_create_subcommand(options, usage_str):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;native_sysroot, options)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>-def wic_list_subcommand(args, usage_str):</div>
<div>&#43;def wic_list_subcommand(args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for listing available images.</div>
<div>&nbsp; &nbsp; &nbsp;The real work is done by image.engine.wic_list()</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;if not engine.wic_list(args, scripts_path):</div>
<div>&#43; &nbsp; &nbsp;if not engine.wic_list(scripts_path, args):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;raise WicError(&quot;Bad list arguments, exiting&quot;)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>-def wic_ls_subcommand(args, usage_str):</div>
<div>&#43;def wic_ls_subcommand(args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for list content of images.</div>
<div>&nbsp; &nbsp; &nbsp;The real work is done by engine.wic_ls()</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;engine.wic_ls(args, args.native_sysroot)</div>
<div>&nbsp;</div>
<div>-def wic_cp_subcommand(args, usage_str):</div>
<div>&#43;def wic_cp_subcommand(args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for copying files/dirs to images.</div>
<div>&nbsp; &nbsp; &nbsp;The real work is done by engine.wic_cp()</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;engine.wic_cp(args, args.native_sysroot)</div>
<div>&nbsp;</div>
<div>-def wic_rm_subcommand(args, usage_str):</div>
<div>&#43;def wic_rm_subcommand(args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for removing files/dirs from images.</div>
<div>&nbsp; &nbsp; &nbsp;The real work is done by engine.wic_rm()</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;engine.wic_rm(args, args.native_sysroot)</div>
<div>&nbsp;</div>
<div>-def wic_write_subcommand(args, usage_str):</div>
<div>&#43;def wic_write_subcommand(args):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;Command-line handling for writing images.</div>
<div>&nbsp; &nbsp; &nbsp;The real work is done by engine.wic_write()</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>&nbsp; &nbsp; &nbsp;engine.wic_write(args, args.native_sysroot)</div>
<div>&nbsp;</div>
<div>-def wic_help_subcommand(args, usage_str):</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Command-line handling for help subcommand to keep the current</div>
<div>- &nbsp; &nbsp;structure of the function definitions.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;pass</div>
<div>-</div>
<div>&nbsp;</div>
<div>-def wic_help_topic_subcommand(usage_str, help_str):</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;Display function for help 'sub-subcommands'.</div>
<div>- &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>- &nbsp; &nbsp;print(help_str)</div>
<div>- &nbsp; &nbsp;return</div>
<div>-</div>
<div>-</div>
<div>-wic_help_topic_usage = &quot;&quot;&quot;</div>
<div>-&quot;&quot;&quot;</div>
<div>-</div>
<div>-helptopics = {</div>
<div>- &nbsp; &nbsp;&quot;plugins&quot;: &nbsp; [wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_plugins_help],</div>
<div>- &nbsp; &nbsp;&quot;overview&quot;: &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_overview_help],</div>
<div>- &nbsp; &nbsp;&quot;kickstart&quot;: [wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_kickstart_help],</div>
<div>- &nbsp; &nbsp;&quot;create&quot;: &nbsp; &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_create_help],</div>
<div>- &nbsp; &nbsp;&quot;ls&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_ls_help],</div>
<div>- &nbsp; &nbsp;&quot;cp&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_cp_help],</div>
<div>- &nbsp; &nbsp;&quot;rm&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_rm_help],</div>
<div>- &nbsp; &nbsp;&quot;write&quot;: &nbsp; &nbsp; [wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_write_help],</div>
<div>- &nbsp; &nbsp;&quot;list&quot;: &nbsp; &nbsp; &nbsp;[wic_help_topic_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_list_help]</div>
<div>-}</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;def wic_init_parser_create(subparser):</div>
<div>@@ -333,17 &#43;286,15 @@ def wic_init_parser_create(subparser):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the dir containing the kernel to use &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;in the .wks bootimg&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-n&quot;, &quot;--native-sysroot&quot;, dest=&quot;native_sysroot&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;to use to build the image&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools (parted and mtools) to use.&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-s&quot;, &quot;--skip-build-check&quot;, dest=&quot;build_check&quot;,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;action=&quot;store_false&quot;, default=True, help=&quot;skip the build check&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-f&quot;, &quot;--build-rootfs&quot;, action=&quot;store_true&quot;, help=&quot;build rootfs&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-c&quot;, &quot;--compress-with&quot;, choices=(&quot;gzip&quot;, &quot;bzip2&quot;, &quot;xz&quot;),</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dest='compressor',</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;compress image with specified compressor&quot;)</div>
<div>- &nbsp; &nbsp;subparser.add_argument(&quot;-m&quot;, &quot;--bmap&quot;, action=&quot;store_true&quot;, help=&quot;generate .bmap&quot;)</div>
<div>- &nbsp; &nbsp;subparser.add_argument(&quot;--no-fstab-update&quot; ,action=&quot;store_true&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;Do not change fstab file.&quot;)</div>
<div>&#43; &nbsp; &nbsp;subparser.add_argument(&quot;-m&quot;, &quot;--bmap&quot;, action=&quot;store_true&quot;, help=&quot;used to produce .bmap file for the image.&quot;</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;This file can be used to flash image using bmaptool utility&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-v&quot;, &quot;--vars&quot;, dest='vars_dir',</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;directory with &lt;image&gt;.env files that store &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;bitbake variables&quot;)</div>
<div>@@ -357,10 &#43;308,10 @@ def wic_init_parser_list(subparser):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;can be 'images' or 'source-plugins' &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;to obtain a list. &quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;If value is a valid .wks image file&quot;)</div>
<div>- &nbsp; &nbsp;subparser.add_argument(&quot;help_for&quot;, default=[], nargs='*',</div>
<div>&#43; &nbsp; &nbsp;subparser.add_argument(&quot;info_for&quot;, default=[], nargs='*',</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;If 'list_type' is a valid .wks image file &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;this value can be 'help' to show the help information &quot;</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;defined inside the .wks file&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;this value can be 'info' to show the image or plugin information &quot;)</div>
<div>&#43;</div>
<div>&nbsp; &nbsp; &nbsp;return</div>
<div>&nbsp;</div>
<div>&nbsp;def imgtype(arg):</div>
<div>@@ -385,9 &#43;336,9 @@ def imgtype(arg):</div>
<div>&nbsp;</div>
<div>&nbsp;def wic_init_parser_ls(subparser):</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;path&quot;, type=imgtype,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;image spec: &lt;image&gt;[:&lt;vfat partition&gt;[&lt;path&gt;]]&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;image spec: &lt;image&gt;[:&lt;partition&gt;[&lt;path&gt;]]&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-n&quot;, &quot;--native-sysroot&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools (parted and mtools) to use.&quot;)</div>
<div>&nbsp;</div>
<div>&nbsp;def imgpathtype(arg):</div>
<div>&nbsp; &nbsp; &nbsp;img = imgtype(arg)</div>
<div>@@ -399,15 &#43;350,15 @@ def wic_init_parser_cp(subparser):</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;src&quot;,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;source spec&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;dest&quot;, type=imgpathtype,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;image spec: &lt;image&gt;:&lt;vfat partition&gt;[&lt;path&gt;]&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;image spec: &lt;image&gt;:&lt;partition&gt;[&lt;path&gt;]&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-n&quot;, &quot;--native-sysroot&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools (parted and mtools) to use.&quot;)</div>
<div>&nbsp;</div>
<div>&nbsp;def wic_init_parser_rm(subparser):</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;path&quot;, type=imgpathtype,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path: &lt;image&gt;:&lt;vfat partition&gt;&lt;path&gt;&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;image spec: &lt;image&gt;[:&lt;partition&gt;[&lt;path&gt;]&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-n&quot;, &quot;--native-sysroot&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools&quot;)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools (parted and mtools) to use.&quot;)</div>
<div>&nbsp;</div>
<div>&nbsp;def expandtype(rules):</div>
<div>&nbsp; &nbsp; &nbsp;&quot;&quot;&quot;</div>
<div>@@ -448,59 &#43;399,56 @@ def wic_init_parser_write(subparser):</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-e&quot;, &quot;--expand&quot;, type=expandtype,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;expand rules: auto or &lt;partition&gt;:&lt;size&gt;[,&lt;partition&gt;:&lt;size&gt;]&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;subparser.add_argument(&quot;-n&quot;, &quot;--native-sysroot&quot;,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools&quot;)</div>
<div>-</div>
<div>-def wic_init_parser_help(subparser):</div>
<div>- &nbsp; &nbsp;helpparsers = subparser.add_subparsers(dest='help_topic', help=hlp.wic_usage)</div>
<div>- &nbsp; &nbsp;for helptopic in helptopics:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;helpparsers.add_parser(helptopic, help=helptopics[helptopic][2])</div>
<div>- &nbsp; &nbsp;return</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;help=&quot;path to the native sysroot containing the tools (parted and mtools) to use.&quot;)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;subcommands = {</div>
<div>&nbsp; &nbsp; &nbsp;&quot;create&quot;: &nbsp; &nbsp;[wic_create_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_create_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_create_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_create],</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_create_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_create,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_create_short_description],</div>
<div>&nbsp; &nbsp; &nbsp;&quot;list&quot;: &nbsp; &nbsp; &nbsp;[wic_list_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_list_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_list_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_list],</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_list_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_list,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_list_short_description],</div>
<div>&nbsp; &nbsp; &nbsp;&quot;ls&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_ls_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_ls_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_ls_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_ls],</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_ls_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_ls,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_ls_short_description],</div>
<div>&nbsp; &nbsp; &nbsp;&quot;cp&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_cp_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_cp_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_cp_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_cp],</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_cp_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_cp,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_cp_short_description],</div>
<div>&nbsp; &nbsp; &nbsp;&quot;rm&quot;: &nbsp; &nbsp; &nbsp; &nbsp;[wic_rm_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_rm_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_rm_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_rm],</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_rm_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_rm,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_rm_short_description],</div>
<div>&nbsp; &nbsp; &nbsp;&quot;write&quot;: &nbsp; &nbsp; [wic_write_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_write_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_write_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_write],</div>
<div>- &nbsp; &nbsp;&quot;help&quot;: &nbsp; &nbsp; &nbsp;[wic_help_subcommand,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_help_topic_usage,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_help_help,</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_help]</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_write_description,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wic_init_parser_write,</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlp.wic_write_short_description],</div>
<div>&nbsp;}</div>
<div>&nbsp;</div>
<div>&#43;def invoke_subcommand(args, parser, main_command_usage, subcommands):</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;subcmd = subcommands.get(args.command, subcommand_error)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;usage = subcmd[1]</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;subcmd[0](args, usage)</div>
<div>&#43;</div>
<div>&nbsp;</div>
<div>&nbsp;def init_parser(parser):</div>
<div>&nbsp; &nbsp; &nbsp;parser.add_argument(&quot;--version&quot;, action=&quot;version&quot;,</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;version=&quot;%(prog)s {version}&quot;.format(version=__version__))</div>
<div>- &nbsp; &nbsp;subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage)</div>
<div>&#43; &nbsp; &nbsp;subparsers = parser.add_subparsers(dest='command')</div>
<div>&#43; &nbsp; &nbsp;helpparser = subparsers.add_parser(&quot;help&quot;, help=&quot;Display usages&quot;)</div>
<div>&nbsp; &nbsp; &nbsp;for subcmd in subcommands:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;subcommands[subcmd][3](subparser)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][3], formatter_class=argparse.RawDescriptionHelpFormatter, description=subcommands[subcmd][1])</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;subcommands[subcmd][2](subparser)</div>
<div>&#43;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;def main(argv):</div>
<div>&nbsp; &nbsp; &nbsp;parser = argparse.ArgumentParser(</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;description=&quot;wic version %s&quot; % __version__)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;description=&quot;Create a customized OpenEmbedded image. Wic version %s&quot; % __version__)</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;init_parser(parser)</div>
<div>&nbsp;</div>
<div>@@ -508,22 &#43;456,15 @@ def main(argv):</div>
<div>&nbsp;</div>
<div>&nbsp; &nbsp; &nbsp;if &quot;command&quot; in vars(args):</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if args.command == &quot;help&quot;:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if args.help_topic is None:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parser.print_help()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print()</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(&quot;Please specify a help topic&quot;)</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elif args.help_topic in helptopics:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlpt = helptopics[args.help_topic]</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hlpt[0](hlpt[1], hlpt[2])</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return 0</div>
<div>-</div>
<div>- &nbsp; &nbsp;return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands)</div>
<div>-</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;parser.print_help()</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print()</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp;else:</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subcmd = subcommands.get(args.command)</div>
<div>&#43; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;subcmd[0](args)</div>
<div>&nbsp;</div>
<div>&nbsp;if __name__ == &quot;__main__&quot;:</div>
<div>&nbsp; &nbsp; &nbsp;try:</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys.exit(main(sys.argv[1:]))</div>
<div>&nbsp; &nbsp; &nbsp;except WicError as err:</div>
<div>- &nbsp; &nbsp; &nbsp; &nbsp;print()</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;logger.error(err)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sys.exit(1)</div>
<div>--&nbsp;</div>
<div>2.7.4</div>
<div><br>
</div>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</body>
</html>