blob: e5347ec4b7c900c68fc64351a5293e75de0672b3 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001# ex:ts=4:sw=4:sts=4:et
2# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
3#
4# Copyright (c) 2013, Intel Corporation.
5# All rights reserved.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19#
20# DESCRIPTION
21# This module implements some basic help invocation functions along
22# with the bulk of the help topic text for the OE Core Image Tools.
23#
24# AUTHORS
25# Tom Zanussi <tom.zanussi (at] linux.intel.com>
26#
27
28import subprocess
29import logging
30
31from wic.plugin import pluginmgr, PLUGIN_TYPES
32
33def subcommand_error(args):
34 logging.info("invalid subcommand %s" % args[0])
35
36
37def display_help(subcommand, subcommands):
38 """
39 Display help for subcommand.
40 """
41 if subcommand not in subcommands:
42 return False
43
44 hlp = subcommands.get(subcommand, subcommand_error)[2]
45 if callable(hlp):
46 hlp = hlp()
47 pager = subprocess.Popen('less', stdin=subprocess.PIPE)
Patrick Williamsc0f7c042017-02-23 20:41:17 -060048 pager.communicate(hlp.encode('utf-8'))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049
50 return True
51
52
53def wic_help(args, usage_str, subcommands):
54 """
55 Subcommand help dispatcher.
56 """
57 if len(args) == 1 or not display_help(args[1], subcommands):
Patrick Williamsc0f7c042017-02-23 20:41:17 -060058 print(usage_str)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059
60
61def get_wic_plugins_help():
62 """
63 Combine wic_plugins_help with the help for every known
64 source plugin.
65 """
66 result = wic_plugins_help
67 for plugin_type in PLUGIN_TYPES:
68 result += '\n\n%s PLUGINS\n\n' % plugin_type.upper()
Patrick Williamsc0f7c042017-02-23 20:41:17 -060069 for name, plugin in pluginmgr.get_plugins(plugin_type).items():
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070 result += "\n %s plugin:\n" % name
71 if plugin.__doc__:
72 result += plugin.__doc__
73 else:
74 result += "\n %s is missing docstring\n" % plugin
75 return result
76
77
78def invoke_subcommand(args, parser, main_command_usage, subcommands):
79 """
80 Dispatch to subcommand handler borrowed from combo-layer.
81 Should use argparse, but has to work in 2.6.
82 """
83 if not args:
84 logging.error("No subcommand specified, exiting")
85 parser.print_help()
86 return 1
87 elif args[0] == "help":
88 wic_help(args, main_command_usage, subcommands)
89 elif args[0] not in subcommands:
90 logging.error("Unsupported subcommand %s, exiting\n" % (args[0]))
91 parser.print_help()
92 return 1
93 else:
94 usage = subcommands.get(args[0], subcommand_error)[1]
95 subcommands.get(args[0], subcommand_error)[0](args[1:], usage)
96
97
98##
99# wic help and usage strings
100##
101
102wic_usage = """
103
104 Create a customized OpenEmbedded image
105
106 usage: wic [--version] | [--help] | [COMMAND [ARGS]]
107
108 Current 'wic' commands are:
109 help Show help for command or one of the topics (see below)
110 create Create a new OpenEmbedded image
111 list List available canned images and source plugins
112
113 Help topics:
114 overview wic overview - General overview of wic
115 plugins wic plugins - Overview and API
116 kickstart wic kickstart - wic kickstart reference
117"""
118
119wic_help_usage = """
120
121 usage: wic help <subcommand>
122
123 This command displays detailed help for the specified subcommand.
124"""
125
126wic_create_usage = """
127
128 Create a new OpenEmbedded image
129
130 usage: wic create <wks file or image name> [-o <DIRNAME> | --outdir <DIRNAME>]
131 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
132 [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
133 [-r, --rootfs-dir] [-b, --bootimg-dir]
134 [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
135
136 This command creates an OpenEmbedded image based on the 'OE kickstart
137 commands' found in the <wks file>.
138
139 The -o option can be used to place the image in a directory with a
140 different name and location.
141
142 See 'wic help create' for more detailed instructions.
143"""
144
145wic_create_help = """
146
147NAME
148 wic create - Create a new OpenEmbedded image
149
150SYNOPSIS
151 wic create <wks file or image name> [-o <DIRNAME> | --outdir <DIRNAME>]
152 [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
153 [-r, --rootfs-dir] [-b, --bootimg-dir]
154 [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600155 [-c, --compress-with] [-m, --bmap]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500156
157DESCRIPTION
158 This command creates an OpenEmbedded image based on the 'OE
159 kickstart commands' found in the <wks file>.
160
161 In order to do this, wic needs to know the locations of the
162 various build artifacts required to build the image.
163
164 Users can explicitly specify the build artifact locations using
165 the -r, -b, -k, and -n options. See below for details on where
166 the corresponding artifacts are typically found in a normal
167 OpenEmbedded build.
168
169 Alternatively, users can use the -e option to have 'wic' determine
170 those locations for a given image. If the -e option is used, the
171 user needs to have set the appropriate MACHINE variable in
172 local.conf, and have sourced the build environment.
173
174 The -e option is used to specify the name of the image to use the
175 artifacts from e.g. core-image-sato.
176
177 The -r option is used to specify the path to the /rootfs dir to
178 use as the .wks rootfs source.
179
180 The -b option is used to specify the path to the dir containing
181 the boot artifacts (e.g. /EFI or /syslinux dirs) to use as the
182 .wks bootimg source.
183
184 The -k option is used to specify the path to the dir containing
185 the kernel to use in the .wks bootimg.
186
187 The -n option is used to specify the path to the native sysroot
188 containing the tools to use to build the image.
189
190 The -f option is used to build rootfs by running "bitbake <image>"
191
192 The -s option is used to skip the build check. The build check is
193 a simple sanity check used to determine whether the user has
194 sourced the build environment so that the -e option can operate
195 correctly. If the user has specified the build artifact locations
196 explicitly, 'wic' assumes the user knows what he or she is doing
197 and skips the build check.
198
199 The -D option is used to display debug information detailing
200 exactly what happens behind the scenes when a create request is
201 fulfilled (or not, as the case may be). It enumerates and
202 displays the command sequence used, and should be included in any
203 bug report describing unexpected results.
204
205 When 'wic -e' is used, the locations for the build artifacts
206 values are determined by 'wic -e' from the output of the 'bitbake
207 -e' command given an image name e.g. 'core-image-minimal' and a
208 given machine set in local.conf. In that case, the image is
209 created as if the following 'bitbake -e' variables were used:
210
211 -r: IMAGE_ROOTFS
212 -k: STAGING_KERNEL_DIR
213 -n: STAGING_DIR_NATIVE
214 -b: empty (plugin-specific handlers must determine this)
215
216 If 'wic -e' is not used, the user needs to select the appropriate
217 value for -b (as well as -r, -k, and -n).
218
219 The -o option can be used to place the image in a directory with a
220 different name and location.
221
222 The -c option is used to specify compressor utility to compress
223 an image. gzip, bzip2 and xz compressors are supported.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600224
225 The -m option is used to produce .bmap file for the image. This file
226 can be used to flash image using bmaptool utility.
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500227"""
228
229wic_list_usage = """
230
231 List available OpenEmbedded images and source plugins
232
233 usage: wic list images
234 wic list <image> help
235 wic list source-plugins
236
237 This command enumerates the set of available canned images as well as
238 help for those images. It also can be used to list of available source
239 plugins.
240
241 The first form enumerates all the available 'canned' images.
242
243 The second form lists the detailed help information for a specific
244 'canned' image.
245
246 The third form enumerates all the available --sources (source
247 plugins).
248
249 See 'wic help list' for more details.
250"""
251
252wic_list_help = """
253
254NAME
255 wic list - List available OpenEmbedded images and source plugins
256
257SYNOPSIS
258 wic list images
259 wic list <image> help
260 wic list source-plugins
261
262DESCRIPTION
263 This command enumerates the set of available canned images as well
264 as help for those images. It also can be used to list available
265 source plugins.
266
267 The first form enumerates all the available 'canned' images.
268 These are actually just the set of .wks files that have been moved
269 into the /scripts/lib/wic/canned-wks directory).
270
271 The second form lists the detailed help information for a specific
272 'canned' image.
273
274 The third form enumerates all the available --sources (source
275 plugins). The contents of a given partition are driven by code
276 defined in 'source plugins'. Users specify a specific plugin via
277 the --source parameter of the partition .wks command. Normally
278 this is the 'rootfs' plugin but can be any of the more specialized
279 sources listed by the 'list source-plugins' command. Users can
280 also add their own source plugins - see 'wic help plugins' for
281 details.
282"""
283
284wic_plugins_help = """
285
286NAME
287 wic plugins - Overview and API
288
289DESCRIPTION
290 plugins allow wic functionality to be extended and specialized by
291 users. This section documents the plugin interface, which is
292 currently restricted to 'source' plugins.
293
294 'Source' plugins provide a mechanism to customize various aspects
295 of the image generation process in wic, mainly the contents of
296 partitions.
297
298 Source plugins provide a mechanism for mapping values specified in
299 .wks files using the --source keyword to a particular plugin
300 implementation that populates a corresponding partition.
301
302 A source plugin is created as a subclass of SourcePlugin (see
303 scripts/lib/wic/pluginbase.py) and the plugin file containing it
304 is added to scripts/lib/wic/plugins/source/ to make the plugin
305 implementation available to the wic implementation.
306
307 Source plugins can also be implemented and added by external
308 layers - any plugins found in a scripts/lib/wic/plugins/source/
309 directory in an external layer will also be made available.
310
311 When the wic implementation needs to invoke a partition-specific
312 implementation, it looks for the plugin that has the same name as
313 the --source param given to that partition. For example, if the
314 partition is set up like this:
315
316 part /boot --source bootimg-pcbios ...
317
318 then the methods defined as class members of the plugin having the
319 matching bootimg-pcbios .name class member would be used.
320
321 To be more concrete, here's the plugin definition that would match
322 a '--source bootimg-pcbios' usage, along with an example method
323 that would be called by the wic implementation when it needed to
324 invoke an implementation-specific partition-preparation function:
325
326 class BootimgPcbiosPlugin(SourcePlugin):
327 name = 'bootimg-pcbios'
328
329 @classmethod
330 def do_prepare_partition(self, part, ...)
331
332 If the subclass itself doesn't implement a function, a 'default'
333 version in a superclass will be located and used, which is why all
334 plugins must be derived from SourcePlugin.
335
336 The SourcePlugin class defines the following methods, which is the
337 current set of methods that can be implemented/overridden by
338 --source plugins. Any methods not implemented by a SourcePlugin
339 subclass inherit the implementations present in the SourcePlugin
340 class (see the SourcePlugin source for details):
341
342 do_prepare_partition()
343 Called to do the actual content population for a
344 partition. In other words, it 'prepares' the final partition
345 image which will be incorporated into the disk image.
346
347 do_configure_partition()
348 Called before do_prepare_partition(), typically used to
349 create custom configuration files for a partition, for
350 example syslinux or grub config files.
351
352 do_install_disk()
353 Called after all partitions have been prepared and assembled
354 into a disk image. This provides a hook to allow
355 finalization of a disk image, for example to write an MBR to
356 it.
357
358 do_stage_partition()
359 Special content-staging hook called before
360 do_prepare_partition(), normally empty.
361
362 Typically, a partition will just use the passed-in
363 parameters, for example the unmodified value of bootimg_dir.
364 In some cases however, things may need to be more tailored.
365 As an example, certain files may additionally need to be
366 take from bootimg_dir + /boot. This hook allows those files
367 to be staged in a customized fashion. Note that
368 get_bitbake_var() allows you to access non-standard
369 variables that you might want to use for these types of
370 situations.
371
372 This scheme is extensible - adding more hooks is a simple matter
373 of adding more plugin methods to SourcePlugin and derived classes.
374 The code that then needs to call the plugin methods uses
375 plugin.get_source_plugin_methods() to find the method(s) needed by
376 the call; this is done by filling up a dict with keys containing
377 the method names of interest - on success, these will be filled in
378 with the actual methods. Please see the implementation for
379 examples and details.
380"""
381
382wic_overview_help = """
383
384NAME
385 wic overview - General overview of wic
386
387DESCRIPTION
388 The 'wic' command generates partitioned images from existing
389 OpenEmbedded build artifacts. Image generation is driven by
390 partitioning commands contained in an 'Openembedded kickstart'
391 (.wks) file (see 'wic help kickstart') specified either directly
392 on the command-line or as one of a selection of canned .wks files
393 (see 'wic list images'). When applied to a given set of build
394 artifacts, the result is an image or set of images that can be
395 directly written onto media and used on a particular system.
396
397 The 'wic' command and the infrastructure it's based on is by
398 definition incomplete - its purpose is to allow the generation of
399 customized images, and as such was designed to be completely
400 extensible via a plugin interface (see 'wic help plugins').
401
402 Background and Motivation
403
404 wic is meant to be a completely independent standalone utility
405 that initially provides easier-to-use and more flexible
406 replacements for a couple bits of existing functionality in
407 oe-core: directdisk.bbclass and mkefidisk.sh. The difference
408 between wic and those examples is that with wic the functionality
409 of those scripts is implemented by a general-purpose partitioning
410 'language' based on Redhat kickstart syntax).
411
412 The initial motivation and design considerations that lead to the
413 current tool are described exhaustively in Yocto Bug #3847
414 (https://bugzilla.yoctoproject.org/show_bug.cgi?id=3847).
415
416 Implementation and Examples
417
418 wic can be used in two different modes, depending on how much
419 control the user needs in specifying the Openembedded build
420 artifacts that will be used in creating the image: 'raw' and
421 'cooked'.
422
423 If used in 'raw' mode, artifacts are explicitly specified via
424 command-line arguments (see example below).
425
426 The more easily usable 'cooked' mode uses the current MACHINE
427 setting and a specified image name to automatically locate the
428 artifacts used to create the image.
429
430 OE kickstart files (.wks) can of course be specified directly on
431 the command-line, but the user can also choose from a set of
432 'canned' .wks files available via the 'wic list images' command
433 (example below).
434
435 In any case, the prerequisite for generating any image is to have
436 the build artifacts already available. The below examples assume
437 the user has already build a 'core-image-minimal' for a specific
438 machine (future versions won't require this redundant step, but
439 for now that's typically how build artifacts get generated).
440
441 The other prerequisite is to source the build environment:
442
443 $ source oe-init-build-env
444
445 To start out with, we'll generate an image from one of the canned
446 .wks files. The following generates a list of availailable
447 images:
448
449 $ wic list images
450 mkefidisk Create an EFI disk image
451 directdisk Create a 'pcbios' direct disk image
452
453 You can get more information about any of the available images by
454 typing 'wic list xxx help', where 'xxx' is one of the image names:
455
456 $ wic list mkefidisk help
457
458 Creates a partitioned EFI disk image that the user can directly dd
459 to boot media.
460
461 At any time, you can get help on the 'wic' command or any
462 subcommand (currently 'list' and 'create'). For instance, to get
463 the description of 'wic create' command and its parameters:
464
465 $ wic create
466
467 Usage:
468
469 Create a new OpenEmbedded image
470
471 usage: wic create <wks file or image name> [-o <DIRNAME> | ...]
472 [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
473 [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
474 [-r, --rootfs-dir] [-b, --bootimg-dir] [-k, --kernel-dir]
475 [-n, --native-sysroot] [-f, --build-rootfs]
476
477 This command creates an OpenEmbedded image based on the 'OE
478 kickstart commands' found in the <wks file>.
479
480 The -o option can be used to place the image in a directory
481 with a different name and location.
482
483 See 'wic help create' for more detailed instructions.
484 ...
485
486 As mentioned in the command, you can get even more detailed
487 information by adding 'help' to the above:
488
489 $ wic help create
490
491 So, the easiest way to create an image is to use the -e option
492 with a canned .wks file. To use the -e option, you need to
493 specify the image used to generate the artifacts and you actually
494 need to have the MACHINE used to build them specified in your
495 local.conf (these requirements aren't necessary if you aren't
496 using the -e options.) Below, we generate a directdisk image,
497 pointing the process at the core-image-minimal artifacts for the
498 current MACHINE:
499
500 $ wic create directdisk -e core-image-minimal
501
502 Checking basic build environment...
503 Done.
504
505 Creating image(s)...
506
507 Info: The new image(s) can be found here:
508 /var/tmp/wic/build/directdisk-201309252350-sda.direct
509
510 The following build artifacts were used to create the image(s):
511
512 ROOTFS_DIR: ...
513 BOOTIMG_DIR: ...
514 KERNEL_DIR: ...
515 NATIVE_SYSROOT: ...
516
517 The image(s) were created using OE kickstart file:
518 .../scripts/lib/wic/canned-wks/directdisk.wks
519
520 The output shows the name and location of the image created, and
521 so that you know exactly what was used to generate the image, each
522 of the artifacts and the kickstart file used.
523
524 Similarly, you can create a 'mkefidisk' image in the same way
525 (notice that this example uses a different machine - because it's
526 using the -e option, you need to change the MACHINE in your
527 local.conf):
528
529 $ wic create mkefidisk -e core-image-minimal
530 Checking basic build environment...
531 Done.
532
533 Creating image(s)...
534
535 Info: The new image(s) can be found here:
536 /var/tmp/wic/build/mkefidisk-201309260027-sda.direct
537
538 ...
539
540 Here's an example that doesn't take the easy way out and manually
541 specifies each build artifact, along with a non-canned .wks file,
542 and also uses the -o option to have wic create the output
543 somewhere other than the default /var/tmp/wic:
544
545 $ wic create ./test.wks -o ./out --rootfs-dir
546 tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs
547 --bootimg-dir tmp/sysroots/qemux86-64/usr/share
548 --kernel-dir tmp/deploy/images/qemux86-64
549 --native-sysroot tmp/sysroots/x86_64-linux
550
551 Creating image(s)...
552
553 Info: The new image(s) can be found here:
554 out/build/test-201507211313-sda.direct
555
556 The following build artifacts were used to create the image(s):
557 ROOTFS_DIR: tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs
558 BOOTIMG_DIR: tmp/sysroots/qemux86-64/usr/share
559 KERNEL_DIR: tmp/deploy/images/qemux86-64
560 NATIVE_SYSROOT: tmp/sysroots/x86_64-linux
561
562 The image(s) were created using OE kickstart file:
563 ./test.wks
564
565 Here is a content of test.wks:
566
567 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
568 part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
569
570 bootloader --timeout=0 --append="rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0"
571
572
573 Finally, here's an example of the actual partition language
574 commands used to generate the mkefidisk image i.e. these are the
575 contents of the mkefidisk.wks OE kickstart file:
576
577 # short-description: Create an EFI disk image
578 # long-description: Creates a partitioned EFI disk image that the user
579 # can directly dd to boot media.
580
581 part /boot --source bootimg-efi --ondisk sda --fstype=efi --active
582
583 part / --source rootfs --ondisk sda --fstype=ext3 --label platform
584
585 part swap --ondisk sda --size 44 --label swap1 --fstype=swap
586
587 bootloader --timeout=10 --append="rootwait console=ttyPCH0,115200"
588
589 You can get a complete listing and description of all the
590 kickstart commands available for use in .wks files from 'wic help
591 kickstart'.
592"""
593
594wic_kickstart_help = """
595
596NAME
597 wic kickstart - wic kickstart reference
598
599DESCRIPTION
600 This section provides the definitive reference to the wic
601 kickstart language. It also provides documentation on the list of
602 --source plugins available for use from the 'part' command (see
603 the 'Platform-specific Plugins' section below).
604
605 The current wic implementation supports only the basic kickstart
606 partitioning commands: partition (or part for short) and
607 bootloader.
608
609 The following is a listing of the commands, their syntax, and
610 meanings. The commands are based on the Fedora kickstart
611 documentation but with modifications to reflect wic capabilities.
612
613 http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition
614 http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader
615
616 Commands
617
618 * 'part' or 'partition'
619
620 This command creates a partition on the system and uses the
621 following syntax:
622
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500623 part [<mountpoint>]
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500624
625 The <mountpoint> is where the partition will be mounted and
626 must take of one of the following forms:
627
628 /<path>: For example: /, /usr, or /home
629
630 swap: The partition will be used as swap space.
631
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500632 If a <mountpoint> is not specified the partition will be created
633 but will not be mounted.
634
635 Partitions with a <mountpoint> specified will be automatically mounted.
636 This is achieved by wic adding entries to the fstab during image
637 generation. In order for a valid fstab to be generated one of the
638 --ondrive, --ondisk or --use-uuid partition options must be used for
639 each partition that specifies a mountpoint.
640
641
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500642 The following are supported 'part' options:
643
644 --size: The minimum partition size. Specify an integer value
645 such as 500. Multipliers k, M ang G can be used. If
646 not specified, the size is in MB.
647 You do not need this option if you use --source.
648
649 --source: This option is a wic-specific option that names the
650 source of the data that will populate the
651 partition. The most common value for this option
652 is 'rootfs', but can be any value which maps to a
653 valid 'source plugin' (see 'wic help plugins').
654
655 If '--source rootfs' is used, it tells the wic
656 command to create a partition as large as needed
657 and to fill it with the contents of the root
658 filesystem pointed to by the '-r' wic command-line
659 option (or the equivalent rootfs derived from the
660 '-e' command-line option). The filesystem type
661 that will be used to create the partition is driven
662 by the value of the --fstype option specified for
663 the partition (see --fstype below).
664
665 If --source <plugin-name>' is used, it tells the
666 wic command to create a partition as large as
667 needed and to fill with the contents of the
668 partition that will be generated by the specified
669 plugin name using the data pointed to by the '-r'
670 wic command-line option (or the equivalent rootfs
671 derived from the '-e' command-line option).
672 Exactly what those contents and filesystem type end
673 up being are dependent on the given plugin
674 implementation.
675
676 If --source option is not used, the wic command
677 will create empty partition. --size parameter has
678 to be used to specify size of empty partition.
679
680 --ondisk or --ondrive: Forces the partition to be created on
681 a particular disk.
682
683 --fstype: Sets the file system type for the partition. These
684 apply to partitions created using '--source rootfs' (see
685 --source above). Valid values are:
686
687 ext2
688 ext3
689 ext4
690 btrfs
691 squashfs
692 swap
693
694 --fsoptions: Specifies a free-form string of options to be
695 used when mounting the filesystem. This string
696 will be copied into the /etc/fstab file of the
697 installed system and should be enclosed in
698 quotes. If not specified, the default string is
699 "defaults".
700
701 --label label: Specifies the label to give to the filesystem
702 to be made on the partition. If the given
703 label is already in use by another filesystem,
704 a new label is created for the partition.
705
706 --active: Marks the partition as active.
707
708 --align (in KBytes): This option is specific to wic and says
709 to start a partition on an x KBytes
710 boundary.
711
712 --no-table: This option is specific to wic. Space will be
713 reserved for the partition and it will be
714 populated but it will not be added to the
715 partition table. It may be useful for
716 bootloaders.
717
718 --extra-space: This option is specific to wic. It adds extra
719 space after the space filled by the content
720 of the partition. The final size can go
721 beyond the size specified by --size.
722 By default, 10MB.
723
724 --overhead-factor: This option is specific to wic. The
725 size of the partition is multiplied by
726 this factor. It has to be greater than or
727 equal to 1.
728 The default value is 1.3.
729
730 --part-type: This option is specific to wic. It specifies partition
731 type GUID for GPT partitions.
732 List of partition type GUIDS can be found here:
733 http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
734
735 --use-uuid: This option is specific to wic. It makes wic to generate
736 random globally unique identifier (GUID) for the partition
737 and use it in bootloader configuration to specify root partition.
738
739 --uuid: This option is specific to wic. It specifies partition UUID.
740 It's useful if preconfigured partition UUID is added to kernel command line
741 in bootloader configuration before running wic. In this case .wks file can
742 be generated or modified to set preconfigured parition UUID using this option.
743
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600744 --system-id: This option is specific to wic. It specifies partition system id. It's useful
745 for the harware that requires non-default partition system ids. The parameter
746 in one byte long hex number either with 0x prefix or without it.
747
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500748 * bootloader
749
750 This command allows the user to specify various bootloader
751 options. The following are supported 'bootloader' options:
752
753 --timeout: Specifies the number of seconds before the
754 bootloader times out and boots the default option.
755
756 --append: Specifies kernel parameters. These will be added to
757 bootloader command-line - for example, the syslinux
758 APPEND or grub kernel command line.
759
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500760 --configfile: Specifies a user defined configuration file for
761 the bootloader. This file must be located in the
762 canned-wks folder or could be the full path to the
763 file. Using this option will override any other
764 bootloader option.
765
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500766 Note that bootloader functionality and boot partitions are
767 implemented by the various --source plugins that implement
768 bootloader functionality; the bootloader command essentially
769 provides a means of modifying bootloader configuration.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500770
771 * include
772
773 This command allows the user to include the content of .wks file
774 into original .wks file.
775
776 Command uses the following syntax:
777
778 include <file>
779
780 The <file> is either path to the file or its name. If name is
781 specified wic will try to find file in the directories with canned
782 .wks files.
783
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500784"""