Debian Codegraph @

doc/source/image_description/elements.rst

raw
1 .. _image-description-elements:
2
3 Schema Reference
4 ================
5
6 .. note::
7
8 This document is the exhaustive reference for the {kiwi} image description
9 schema in :file:`kiwi/schema/kiwi.rnc` for version |version|.
10
11 .. contents:: Schema sections
12 :local:
13 :depth: 2
14
15 The sections are documented in the same order as they appear below the
16 :ref:`sec.image` root element. Use :doc:`/image_description` for the guided
17 introduction and this page when you need the complete list of valid elements
18 and attributes.
19
20
21 .. _sec.image:
22
23 <image>
24 -------
25
26 The top level of any {kiwi} image description.
27
28 .. code:: xml
29
30 <image schemaversion="{schema_version}" name="{exc_image_base_name}">
31 <!-- descendants -->
32 </image>
33
34 The image definition starts with an image tag and requires the schema
35 format at version {schema_version}. The attribute name specifies the name
36 of the image, which is also used for the filenames created by KIWI. Because
37 we don’t want spaces in filenames, the name attribute must not have any
38 spaces in its name.
39
40 The following optional attributes can be inserted in the image tag:
41
42 displayname
43 Allows setting up the boot menu title for the selected boot loader. So
44 you can have *suse-SLED-foo* as the image name but a different name
45 as the boot display name. Spaces are not allowed in the display name
46 because it causes problems for some boot loaders, and kiwi did not
47 take the effort to separate the ones that can display them correctly
48 from the ones that can't.
49
50 id
51 sets an identification number that appears as file ``/etc/ImageID``
52 within the image.
53
54 .. _sec.include:
55
56 <include>
57 ---------
58
59 Optional include of XML file content from a file.
60
61 .. code:: xml
62
63 <image schemaversion="{schema_version}" name="{exc_image_base_name}">
64 <include from="file://description.xml"/>
65 </image>
66
67 with file :file:`description.xml` as follows:
68
69 .. code:: xml
70
71 <image>
72 <description type="system">
73 <author>name</author>
74 <contact>contact</contact>
75 <specification>text</specification>
76 </description>
77 </image>
78
79 This will replace the `include` statement with the contents
80 of :file:`description.xml`. The validation of the result happens
81 after the inclusion of all `include` references. The value for
82 the `from` attribute is interpreted as a URI. As of now, only
83 local URI types are supported, as well as the `this://` resource
84 locator, which translates into the path to the KIWI image
85 description.
86
87 .. note::
88
89 The include information must be embedded into an `<image>`
90 root node. Only the inner elements of the root node will
91 be included. The processing of XML data via XSLT always
92 requires a root node, which is the reason why this is
93 required to be specified for include files as well.
94
95 .. note::
96
97 Nesting of include statements in other include files is
98 not supported. This will lead to unresolved include
99 statements in the final document and will cause the
100 runtime checker to complain about it.
101
102 .. note::
103
104 The include is implemented via an XSLT stylesheet and therefore
105 expects an XML document. Other markup formats are not supported
106 as an include reference.
107
108 .. _sec.description:
109
110 <description>
111 -------------
112
113 Provide an image identity.
114
115 .. code:: xml
116
117 <description type="system">
118 <author>name</author>
119 <contact>contact</contact>
120 <specification>text</specification>
121 </description>
122
123 The mandatory description section contains information about the creator
124 of this image description. The attribute `type` could be either of the
125 value `system`, which indicates this is a system image description, or a value
126 `boot` for custom kiwi boot image descriptions.
127
128 The following optional subsections can be inserted below the description tag:
129
130 license
131 Specifies the license name that applies to this image description.
132
133 .. _sec.certificates:
134
135 <certificates>
136 --------------
137
138 Add a cert-file to the directory storing additional local CA certificates.
139 The import will occur immediately after the bootstrap process, where
140 the required CA update tooling is expected to be installed. This
141 setting is useful for situations where certificates are not packaged,
142 or the certificates are required during the build process, e.g., due
143 to proxy servers in the build environment that need certificates
144 in chroot. The required `target_distribution` attribute must be set
145 to allow kiwi a correct matching for the CA store path and the update
146 tool with regard to the image's target distribution. The following
147 settings apply:
148
149 +--------------+-------------------------------------------+------------------------+
150 | Distributor | CA Store | Update Tool |
151 +==============+===========================================+========================+
152 | SUSE | /etc/pki/trust/anchors | update-ca-certificates |
153 +--------------+-------------------------------------------+------------------------+
154 | Red Hat | /etc/pki/ca-trust/source/anchors | update-ca-trust |
155 +--------------+-------------------------------------------+------------------------+
156 | Debian Based | /usr/local/share/ca-certificates | update-ca-certificates |
157 +--------------+-------------------------------------------+------------------------+
158 | Arch Linux | /etc/ca-certificates/trust-source/anchors | update-ca-trust |
159 +--------------+-------------------------------------------+------------------------+
160
161 .. code:: xml
162
163 <certificates target_distribution="suse|redhat|debian|archlinux">
164 <certificate name="/some/ca/filename1"/>
165 <certificate name="/some/ca/filename2"/>
166 </certificates>
167
168 .. _sec.preferences:
169
170 <preferences>
171 -------------
172
173 Set up image type and layout.
174
175 .. code:: xml
176
177 <preferences arch="arch">
178 <version>1.2.3</version>
179 <packagemanager>zypper</packagemanager>
180 <type image="tbz"/>
181 </preferences>
182
183 The mandatory preferences section contains information about the
184 supported image type(s), the used package manager, the version of this
185 image, and further optional elements. The preferences section can
186 be configured to apply only for a certain architecture. In this
187 case, specify the `arch` attribute with a value as it is reported
188 by :command:`uname -m`.
189
190 <preferences><version>
191 ~~~~~~~~~~~~~~~~~~~~~~
192 The mandatory image version must be a three-part version number of the
193 format: **Major**.\ **Minor**.\ **Release**. In case of changes to
194 the image description, the following rules should apply:
195
196 * For smaller image modifications that do not add or remove any new
197 packages, only the release number is incremented. The XML description
198 file(``config.xml``) remains unchanged.
199
200 * For image changes that involve the addition or removal of packages,
201 the minor number is incremented, and the release number is reset.
202
203 * For image changes that change the behavior or geometry of the
204 image file, the major number is incremented.
205
206 <preferences><packagemanager>
207 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208 The mandatory `packagemanager` element specifies which package manager
209 should be used to handle software packages. The `packagemanager` setup
210 is connected to the distribution used to build the image. The following
211 table shows which package manager is connected to which distributor:
212
213 +--------------+-----------------+
214 | Distributor | Package Manager |
215 +==============+=================+
216 | SUSE | zypper |
217 +--------------+-----------------+
218 | Red Hat | dnf4 / dnf5 / |
219 | | microdnf |
220 +--------------+-----------------+
221 | Debian Based | apt |
222 +--------------+-----------------+
223 | Arch Linux | pacman |
224 +--------------+-----------------+
225 | Alpine Linux | apk |
226 +--------------+-----------------+
227
228 In general, the specification of one preferences section is sufficient.
229 However, it’s possible to specify multiple preferences sections and
230 distinguish between the sections via the `profiles` attribute.
231
232 In combination with the above, the preferences element supports the
233 following optional elements:
234
235 <preferences><rpm-locale-filtering>
236 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
237 locale-filtering can be set to "true" or "false". If set to "true", it
238 sets the `install_lang` macro for RPM-based installations to the RPM-
239 configured locale list. This results in language-specific files
240 being filtered out by `rpm` if they don't match the configured list.
241
242 .. code:: xml
243
244 <preferences>
245 <rpm-locale-filtering>true</rpm-locale-filtering>
246 </preferences>
247
248 .. note::
249
250 It depends on the individual package design if the `install_lang`
251 macro contents apply to the package or not.
252
253 <preferences><rpm-check-signatures>
254 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
255 Specifies whether package signatures should be checked or not.
256
257 .. code:: xml
258
259 <preferences>
260 <rpm-check-signatures>true</rpm-check-signatures>
261 </preferences>
262
263 <preferences><rpm-excludedocs>
264 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
265 Specifies whether files marked as documentation should be skipped
266 during installation.
267
268 .. code:: xml
269
270 <preferences>
271 <rpm-excludedocs>true</rpm-excludedocs>
272 </preferences>
273
274 <preferences><keytable>
275 ~~~~~~~~~~~~~~~~~~~~~~~
276 Specifies the name of the console keymap to use. The value
277 corresponds to a map file in `/usr/share/kbd/keymaps/xkb`.
278
279 .. code:: xml
280
281 <preferences>
282 <keytable>us</keytable>
283 </preferences>
284
285 <preferences><timezone>
286 ~~~~~~~~~~~~~~~~~~~~~~~
287 Specifies the time zone. Available time zones are located in the
288 `/usr/share/zoneinfo` directory. Specify the attribute value
289 relative to `/usr/share/zoneinfo`. For example, specify
290 `Europe/Berlin` for `/usr/share/zoneinfo/Europe/Berlin`.
291
292 .. code:: xml
293
294 <preferences>
295 <timezone>Europe/Berlin</timezone>
296 </preferences>
297
298 <preferences><locale>
299 ~~~~~~~~~~~~~~~~~~~~~
300 Specifies the name of the UTF-8 locale to use, which defines the
301 contents of the `RC_LANG` system environment variable used in the
302 image and to run the custom scripts specified as part of the
303 {kiwi} image description. Please note, only UTF-8 locales are
304 supported here, which also means that the encoding must *not* be part
305 of the locale information. This means you need to specify the
306 locale using the 4-digit name, like the following example: `en_US` or
307 `en_US,de_DE`.
308
309 .. code:: xml
310
311 <preferences>
312 <locale>en_US</locale>
313 </preferences>
314
315 <preferences><bootsplash-theme>
316 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317 Specifies the name of the plymouth bootsplash theme to use.
318
319 .. code:: xml
320
321 <preferences>
322 <bootsplash-theme>bgrt</bootsplash-theme>
323 </preferences>
324
325 <preferences><bootloader-theme>
326 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327 Specifies the name of the bootloader theme to use if that used
328 bootloader has theme support.
329
330 .. code:: xml
331
332 <preferences>
333 <bootloader-theme>openSUSE</bootloader-theme>
334 </preferences>
335
336
337 Along with the version and the packagemanager, at least one image type
338 element must be specified to indicate which image type should be built.
339
340 <preferences><release-version>
341 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
342 Specifies the distribution's global release version as consumed
343 by package managers. Currently, the release version is not set or
344 set to `0` for package managers that require a value to operate.
345 With the optional `release-version` section, users have an
346 opportunity to specify a custom value which is passed along the package
347 manager to define the distribution release.
348
349 .. note::
350
351 The release version information is currently
352 used in dnf/dnf5 and microdnf package managers only. It might
353 happen that it gets applied to the other package manager
354 backends as well. This will happen on demand, though.
355
356 <preferences><showlicense>
357 ~~~~~~~~~~~~~~~~~~~~~~~~~~
358 Specifies the name of a license to be displayed in a dialog window at
359 boot time. The element may be provided multiple times to show more than one
360 license.
361
362 .. code:: xml
363
364 <preferences>
365 <showlicense>license_name</showlicense>
366 </preferences>
367
368 <preferences><type>
369 ~~~~~~~~~~~~~~~~~~~
370 At least one type element must be configured. It is possible to
371 specify multiple type elements in a preferences block. To set a given
372 type description as the default image, use the boolean attribute `primary`
373 and set its value to `true`:
374
375 .. code:: xml
376
377 <preferences>
378 <type image="typename" primary="true"/>
379 </preferences>
380
381 The image type to be created is determined by the value of the image
382 attribute. The following list describes the supported types and
383 possible values of the image attribute:
384
385 image="tbz"
386 A simple tar archive image. The `tbz` type packs the contents of
387 the image root tree into an xz-compressed tarball.
388
389 image="btrfs|ext2|ext3|ext4|squashfs|erofs|xfs"
390 A filesystem image. The image root tree data is packed into a
391 filesystem image of the given type. An image of that type can
392 be loop-mounted and accessed according to the capabilities of
393 the selected filesystem.
394
395 image="iso"
396 An ISO image that can be dumped on a CD/DVD or USB stick
397 and boots from this media without interfering with other
398 system storage components. A useful pocket system for testing,
399 demo, and debugging purposes.
400
401 image="oem"
402 An image representing an expandable system disk. This means after
403 deployment, the system can resize itself to the new disk geometry.
404 The resize operation is configurable as part of the image description,
405 and an installation image for CD/DVD, USB stick, and network deployment
406 can be created in addition. For use in cloud frameworks like
407 Amazon EC2, Google Compute Engine, or Microsoft Azure, this disk
408 type also supports the common virtual disk formats.
409
410 image="docker"
411 An archive image suitable for the Docker container engine.
412 The image can be loaded via the `docker load` command and
413 works within the scope of the container engine.
414
415 image="oci"
416 An archive image that builds a container matching the OCI
417 (Open Container Initiative) standard. The container should be
418 able to run with any OCI-compliant container engine.
419
420 image="appx"
421 An archive image suitable for the Windows Subsystem for Linux
422 container engine. The image can be loaded from a Windows System
423 that has support for WSL activated.
424
425 image="wsl"
426 An archive image suitable for the Windows Subsystem for Linux
427 container engine >= v2.4.4. The image represents a gzip-compressed
428 tar file as described in
429 https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro
430 and can be loaded from a Windows System
431 that has support for WSL in that version activated.
432
433 image="kis"
434 An optional root filesystem image associated with a kernel and initrd.
435 The use case for this component image type is highly customizable.
436 Many different deployment strategies are possible.
437
438 image="pxe"
439 The legacy network boot image type, superseded by `kis`. It builds the
440 same kernel, initrd and root filesystem components but defaults to the
441 {kiwi} initrd system rather than dracut.
442
443 image="cpio"
444 A cpio archive of the image root tree, as used for an initrd.
445
446 image="enclave"
447 An AWS Nitro Enclave image. Requires
448 `enclave_format="aws-nitro"`. See :ref:`eif`.
449
450 The complete set of accepted values is `btrfs`, `cpio`, `docker`, `enclave`,
451 `erofs`, `ext2`, `ext3`, `ext4`, `iso`, `kis`, `oci`, `oem`, `pxe`, `squashfs`,
452 `tbz`, `wsl`, `xfs` and `appx`.
453
454
455 For completion of a type description, there could be several other
456 optional attributes and child elements. The `type` element supports a
457 plethora of optional attributes; some of these are only relevant for
458 certain build types and will be covered in extra chapters that describe
459 the individual image types in more detail. Certain attributes are, however,
460 useful for nearly all build types and will be covered next:
461
462 bootpartition="true|false":
463 A boolean parameter notifying {kiwi} whether an extra boot
464 partition should be used or not (the default depends on the current
465 layout). This will override {kiwi}'s default layout.
466 Only available for the `oem` type.
467
468
469 bootpartsize="nonNegativeInteger":
470 For images with a separate boot partition, this attribute
471 specifies the size in MB. If not set, the boot partition
472 size is set to 300 MB. Only available for the `oem` type.
473
474 eficsm="true|false":
475 For images with an EFI layout, specify if the legacy
476 CSM (BIOS) mode should be supported or not. By default,
477 CSM mode is enabled.
478 Only available for the `oem` and `iso` types.
479
480
481 efipartsize="nonNegativeInteger":
482 For images with an EFI fat partition, this attribute
483 specifies the size in MB. If not set, the EFI partition
484 size is set to 20 MB.
485 Only available for the `oem` type.
486
487
488 efifatimagesize="nonNegativeInteger":
489 For ISO images (live and install), the EFI boot requires
490 an embedded FAT image. This attribute specifies the size
491 in MB. If not set, the FAT image size is set to 20 MB.
492 Only available for the `oem` and `iso` types.
493
494
495 efiparttable="msdos|gpt":
496 For images with an EFI firmware, specifies the partition
497 table type to use. If not set, it defaults to the GPT partition
498 table type.
499 Only available for the `oem` and `iso` types.
500
501
502 dosparttable_extended_layout="true|false":
503 For OEM disk images, specifies to make use of logical partitions
504 inside of an extended one. If set to true and if the msdos table type
505 is active, this will cause the fourth partition to be an
506 extended partition, and all following partitions will be
507 placed as logical partitions inside of that extended
508 partition. This setting is useful if more than 4 primary
509 partitions need to be created in an msdos table.
510 Only available for the `oem` type.
511
512
513 btrfs_quota_groups="true|false":
514 A boolean parameter to activate filesystem quotas if
515 the filesystem is `btrfs`. By default, quotas are inactive.
516 Only available for the `oem` type.
517
518
519 btrfs_set_default_volume="true|false":
520 For OEM disk images using the btrfs filesystem, this requests to
521 set a default volume for the rootfs, which is used when the
522 filesystem gets mounted. In case a `true` value is provided or
523 the attribute is not specified at all, kiwi will make a volume
524 the default volume. This can be either `/` or the configured
525 root subvolume or the configured root snapshot. Consequently, the
526 entry created for the rootfs in the `/etc/fstab` file will not
527 contain any specific volume definition. In case a `false` value
528 is provided, kiwi will not set any default volume, which also
529 means that the entry for the rootfs in the `/etc/fstab` file
530 requires a volume definition which is placed by kiwi as a
531 `subvol=` parameter in the respective fstab field entry. In
532 addition, the parameter `rootflags=subvol=` is added to the
533 kernel commandline such that early initrd code has a chance
534 to know about the rootfs volume.
535
536 btrfs_root_is_subvolume="true|false":
537 Tell kiwi to create a root volume to host (/) inside.
538 The name of this subvolume is, by default, set to: `@`.
539 The name of the subvolume can be changed via a volume entry
540 of the form:
541
542 .. code:: xml
543
544 <systemdisk>
545 <volume name="@root=TOPLEVEL_NAME"/>
546 </systemdisk>
547
548 By default, the creation of a top-level volume is set to `true`.
549 Only available for the `oem` type.
550
551
552 btrfs_root_is_snapper_snapshot="true|false":
553 A boolean parameter that tells {kiwi} to install
554 the system into a btrfs snapshot. The snapshot layout is compatible
555 with the snapper management toolkit and follows a concept by SUSE.
556 By default, snapshots are turned off.
557 Only available for the `oem` type.
558
559
560 btrfs_root_is_readonly_snapshot="true|false":
561 A boolean parameter notifying {kiwi} that
562 the btrfs root filesystem snapshot has to be made read-only. If this option
563 is set to true, the root filesystem snapshot will be turned into
564 read-only mode once all data has been placed in it. The option is only
565 effective if `btrfs_root_is_snapper_snapshot` is also set to true. By default, the
566 root filesystem snapshot is writable.
567 Only available for the `oem` type.
568
569
570
571 compressed="true|false":
572 Specifies whether the root filesystem image should be xz-compressed
573 or not. Only available for the `pxe` and `kis` types. If set to `true`,
574 the tar archive that contains the build results is not compressed
575 again; otherwise, the tar archive is xz-compressed.
576
577 archive="true|false":
578 Specifies whether the image output file should be an archive or not.
579 This option is only available for the `kis` type. When set to `true`,
580 all image build results will be placed into an archive file. When set
581 to `false`, the build results will stay as individual files in the
582 build directory. The default is `true`.
583
584 editbootconfig="file_path":
585 Specifies the path to a script that is called right
586 before the bootloader is installed. The script runs relative to the
587 directory that contains the image structure.
588 Only available for the `oem` and `iso` types.
589
590
591 editbootinstall="file_path":
592 Specifies the path to a script that is called right
593 after the bootloader is installed. The script runs relative to the
594 directory that contains the image structure.
595 Only available for the `oem` type.
596
597
598 filesystem="btrfs|ext2|ext3|ext4|squashfs|erofs|xfs":
599 The root filesystem. Available for the `oem`, `pxe`, `kis` and `iso` types,
600 and **required** for the `oem` type.
601
602 firmware="efi|uefi|bios|ec2|ofw|opal|custom":
603 Specifies the boot firmware of the appliance. This attribute is
604 used to differentiate the image according to the firmware which
605 boots up the system. It mostly impacts the disk layout and the
606 partition table type. By default, `bios` is used on x86,
607 `ofw` on PowerPC, and `efi` on ARM, RISC-V and LoongArch.
608 Only available for the `oem`, `pxe` and `iso` types.
609
610 * `efi`
611 Standard EFI layout.
612
613 * `uefi`
614 Standard EFI layout for secure boot.
615
616 * `bios`
617 Standard BIOS layout for x86.
618
619 * `ec2`
620 Standard BIOS layout for x86 using Xen grub modules for old-
621 style Xen boot in Amazon EC2.
622
623 * `ofw`
624 Standard PPC layout.
625
626 * `opal`
627 Standard openPOWER PPC64 layout. kexec-based boot process.
628
629 * `custom`
630 The firmware setup is entirely provided by custom scripts and {kiwi} takes
631 no further action.
632
633 force_mbr="true|false":
634 A boolean parameter to force the usage of an MBR partition
635 table even if the system would default to GPT. This is occasionally
636 required on ARM systems that use an EFI partition layout but must
637 not be stored in a GPT. Note that forcing an MBR partition table incurs
638 limitations with respect to the number of available partitions and their
639 sizes. Only available for the `oem` type.
640
641 fsmountoptions="option_string":
642 Specifies the filesystem mount options that are passed
643 via the `-o` flag to :command:`mount` and are included in
644 :file:`/etc/fstab`.
645
646 fscreateoptions="option_string":
647 Specifies the filesystem options used to create the
648 filesystem. In {kiwi}, the filesystem utility to create a filesystem is
649 called without any custom options. The default options are filesystem-
650 specific and are provided along with the package that provides the
651 filesystem utility. For the Linux `ext[234]` filesystem, the default
652 options can be found in the :file:`/etc/mke2fs.conf` file. Other
653 filesystems provide this differently and document information
654 about options and their defaults in the respective manual page, e.g.,
655 :command:`man mke2fs`. With the `fscreateoptions` attribute, it's possible
656 to directly influence how the filesystem will be created. The options
657 provided as a string are passed to the command that creates the
658 filesystem without any further validation by {kiwi}. For example, to turn
659 off the journal on the creation of an ext4 filesystem, the following option
660 would be required:
661
662 .. code:: xml
663
664 <preferences>
665 <type fscreateoptions="-O ^has_journal"/>
666 </preferences>
667
668 kernelcmdline="string":
669 Additional kernel parameters passed to the kernel by the
670 bootloader.
671 Only available for the `oem`, `iso`, `pxe`, `kis` and `enclave` types.
672
673
674 root_clone="number"
675 For OEM disk images, this attribute allows you to create `number`
676 clone(s) of the root partition, with `number` >= 1. A clone partition
677 is content-wise an exact byte-for-byte copy of the origin root partition.
678 However, to avoid conflicts at boot time, the UUID of any
679 cloned partition will be made unique. In the sequence of partitions,
680 the clone(s) will always be created first, followed by the
681 partition considered the origin. The origin partition is the
682 one that will be referenced and used by the system.
683 Also, see :ref:`clone_partitions`.
684 Only available for the `oem` type.
685
686
687 boot_clone="number"
688 Same as `root_clone` but applied to the boot partition if present.
689 Only available for the `oem` type.
690
691
692 luks="passphrase|file:///path/to/keyfile|random":
693 Supplying a value will trigger the encryption of the partition
694 serving the root filesystem using the LUKS extension. The supplied
695 value represents either the passphrase string or the location of
696 a key file if specified as a `file://...` resource or the reserved
697 name `random`. When using a passphrase, the system will interactively
698 ask for that passphrase on first boot unless it is set empty.
699 In case of an empty passphrase, the system cannot be considered secure.
700 When using a key file, the information from the file is read and
701 used as a passphrase. The given key file is **not automatically**
702 placed into the system or added to `/etc/crypttab`, which means
703 the passphrase in the key file is, by default, requested from an
704 interactive dialog at boot time. When using the reserved word
705 `random`, kiwi will create a key file with a random passphrase
706 and place this information into `/etc/crypttab`. This allows
707 the system to boot without user interaction but also requires
708 the initrd to be protected in some way because it will contain
709 the key file. The use of `random` is therefore only secure if
710 the image adds additional security that encrypts the initrd,
711 as is, e.g., done in the IBM secure execution process.
712 If the encryption of the system is combined with the attribute
713 `bootpartition="false"`, it's important to understand that this
714 will place `/boot` into the encrypted area of the system and
715 leave reading boot data from it as a responsibility to the
716 bootloader. Not every bootloader can cope with that, and those
717 that can, e.g., grub, will then open an interactive dialog at
718 the bootloader level asking for the credentials to decrypt the
719 root filesystem.
720 Only available for the `oem`, `iso`, `pxe` and `kis` types.
721
722
723 luks_version="luks|luks1|luks2":
724 Specify which `LUKS` version should be used. If not set, and by
725 default, `luks` is used. The interpretation of the default depends
726 on the distribution and could result in either 'luks1' or 'luks2'.
727 The specification of the `LUKS` version allows using a different
728 set of `luksformat` options. To investigate the differences between
729 the two, please consult the `cryptsetup` manual page.
730 Only available for the `oem`, `iso`, `pxe` and `kis` types.
731
732
733 target_blocksize="number":
734 Specifies the image blocksize in bytes, which has to
735 match the logical blocksize of the target storage device. By default, 512
736 bytes is used, which works on many disks. You can obtain the blocksize
737 from the `SSZ` column in the output of the following command:
738
739 .. code:: shell-session
740
741 blockdev --report $DEVICE
742
743 Only available for the `oem` and `kis` types.
744
745
746 target_removable="true|false":
747 Indicate if the target disk for OEM images is deployed
748 to a removable device, e.g., a USB stick or not. This only
749 affects the EFI setup if requested, and in the end, avoids
750 the creation of a custom boot menu entry in the firmware
751 of the target machine. By default, the target disk is
752 expected to be non-removable.
753 Only available for the `oem` type.
754
755
756 selinux_policy="targeted|mls|minimum":
757 The `selinux_policy` attribute sets the SELinux policy to use.
758 The `targeted` policy is the default policy. Only change this option
759 if you want to use the `mls` or `minimum` policy.
760
761 spare_part="number":
762 Request a spare partition right before the root partition
763 of the requested size. The attribute takes a size value
764 and allows a unit in MB or GB, e.g., 200M. If no unit is given,
765 the value is considered to be mbytes. A spare partition
766 can only be configured for the disk image type oem.
767
768 spare_part_mountpoint="dir_path":
769 Specify a mount point for the spare partition in the system.
770 Can only be configured for the disk image type oem.
771
772 spare_part_fs="btrfs|ext2|ext3|ext4|xfs":
773 Specify a filesystem for the spare partition in the system.
774 Can only be configured for the disk image type oem.
775
776 spare_part_fs_attributes="attribute_list":
777 Specify filesystem attributes for the spare partition.
778 Attributes can be specified as a comma-separated list.
779 Currently, the attributes `no-copy-on-write` and `synchronous-updates`
780 are available. Can only be configured for the disk image
781 type oem.
782
783 spare_part_is_last="true|false":
784 Specify if the spare partition should be the last one in
785 the partition table. It can only be configured for the `oem`
786 type with oem-resize switched off. By default, the root
787 partition is the last one, and the spare partition lives
788 before it. With this attribute, that setup can be toggled.
789 However, if the root partition is no longer the last one,
790 the OEM repart/resize code can no longer work because
791 the spare part would block it. Because of that, moving
792 the spare part at the end of the disk is only applied
793 if oem-resize is switched off. There is a runtime
794 check in the {kiwi} code to check this condition.
795
796 devicepersistency="by-uuid|by-label|by-partuuid":
797 Specifies which method to use for persistent device names.
798 This will affect all files written by kiwi that include
799 device references, for example, `/etc/fstab` or the `root=`
800 parameter in the kernel command line. By default, by-uuid
801 is used.
802
803 .. note:: devicepersistency and its impact to install images
804
805 Please note that specifying `devicepersistency` also affects an
806 eventually generated install image. This means that the installation
807 media created from the image description will also use the specified
808 device persistency method. It is possible that the selected method
809 does not provide device representations for the disk devices found
810 by the installation process. In this case the fallback to the raw
811 unix device node e.g., `/dev/sda` will be used. If the installation
812 media is created to allow user interaction and there are more than
813 one disk device found during installation, the user will be prompted
814 with a list of disk device names to select from. If the list shows
815 the raw unix device nodes, it might be difficult for the user to
816 select the correct disk. In this case, it is recommended to explicitly
817 set the persistency method to use for the installation media via
818 the `rd.kiwi.install.devicepersistency` kernel command line parameter.
819 The parameter can also be set as a fixed value in the `kernelcmdline`
820 attribute of the image description. Available persistency methods
821 useful for disk device mappings are: `by-id` and `by-path`.
822
823 squashfscompression="uncompressed|gzip|lzo|lz4|xz|zstd":
824 Specifies the compression type for mksquashfs.
825 Only available for the `oem`, `pxe`, `kis`, `iso` and `squashfs` types.
826
827
828 erofscompression="text"
829 Specifies the compression type and level for erofs.
830 The attribute is a free-form text because erofs allows parameters
831 for the different compression types. Please consult the erofs
832 man page for details on how to specify a value for the `-z` option
833 on `mkfs.erofs` and pass a proper value as `erofscompression`.
834 Only available for the `oem`, `pxe`, `kis`, `iso` and `erofs` types.
835
836
837 standalone_integrity="true|false":
838 For the `oem` type only, specifies to create a standalone
839 `dm_integrity` layer on top of the root filesystem.
840
841 integrity_legacy_hmac="true|false":
842 For the `oem` type only and in combination with the `standalone_integrity`
843 attribute, this allows the use of old, flawed HMAC calculations (does not protect the superblock).
844
845 .. warning::
846
847 Do not use this attribute unless compatibility with
848 a specific old kernel is required!
849
850 integrity_keyfile="filepath":
851 For the `oem` type only, and in combination with the `standalone_integrity`
852 attribute, this protects access to the integrity map using the given keyfile.
853
854 integrity_metadata_key_description="string":
855 For the `oem` type only, and in combination with
856 the `embed_integrity_metadata` attribute, specifies a custom
857 description of an integrity key as it is expected to be present
858 in the kernel keyring. The information is placed in the integrity
859 metadata block. If not specified, kiwi creates a key argument
860 string instead, which is based on the given `integrity_keyfile`
861 filename. The format of this key argument is:
862
863 .. code:: bash
864
865 :BASENAME_OF_integrity_keyfile_WITHOUT_FILE_EXTENSION
866
867 embed_integrity_metadata="true|false":
868 For the `oem` type only, and in combination with the
869 `standalone_integrity` attribute, specifies to write a binary
870 block at the end of the partition serving the root filesystem,
871 containing information to create the `dm_integrity` device map
872 in the following format:
873
874 .. code:: bash
875
876 |header|0xFF|dm_integrity_meta|0xFF|0x0|
877
878 header:
879 Is a string of the following information separated by spaces:
880
881 * **version**: currently set to `1`
882 * **fstype**: name of the `filesystem` attribute
883 * **access**: either `ro` or `rw`, depending on the filesystem capabilities
884 * `integrity`: fixed identifier value
885
886 dm_integrity_meta:
887 Is a string of the following information separated by spaces:
888
889 * **provided_data_sectors**: number of data sectors
890 * **sector_size**: sector size in bytes; defaults to 512
891 * **parameter_count**:
892 number of parameters needed to construct the integrity device map.
893 After the `parameter_count`, a list of space-separated parameters
894 follows, and the `parameter_count` specifies the quantity of these
895 parameters.
896 * **parameters**:
897 The first element of the parameter list contains information about
898 the used hash algorithm, which is not part of the superblock and
899 is provided according to the parameters passed along when {kiwi}
900 calls `integritysetup`. As of now, this defaults to:
901
902 - internal_hash:sha256
903
904 All subsequent parameters are taken from the `flags` field of the
905 dm-integrity superblock. see the dm-integrity documentation on the
906 web for possible flag values.
907
908 verity_blocks="number|all":
909 For the `oem` and `iso` types only, specifies to create a dm-verity hash
910 from the number of given blocks (or all) placed at the end of the
911 root filesystem. For later verification of the device,
912 the credentials information produced by `veritysetup` from the
913 cryptsetup tools are needed. This data as of now is only printed
914 as debugging information to the build log file. A concept to
915 persistently store the verification metadata as part of the
916 partition(s) will be a next step.
917
918 embed_verity_metadata="true|false":
919 For the `oem` type only, and in combination with the `verity_blocks`
920 attribute, specifies to write a binary block at the end of the
921 partition serving the root filesystem, containing information
922 for `dm_verity` verification in the following format:
923
924 .. code:: bash
925
926 |header|0xFF|dm_verity_credentials|0xFF|0x0|
927
928 header:
929 Is a string of the following information separated by spaces:
930
931 * **version**: currently set to `1`
932 * **fstype**: name of `filesystem` attribute
933 * **access**: either `ro` or `rw` depending on the filesystem capabilities
934 * `verity`: fixed identifier value
935
936 dm_verity_credentials:
937 Is a string of the following information separated by spaces:
938
939 * **hash_type**: hash type name as returned by `veritysetup`
940 * **data_blksize**: data blocksize as returned by `veritysetup`
941 * **hash_blksize**: hash blocksize as returned by `veritysetup`
942 * **data_blocks**: number of data blocks as returned by `veritysetup`
943 * **hash_start_block**:
944 hash start block as required by the kernel to construct the device map
945 * **algorithm**: hash algorithm as returned by `veritysetup`
946 * **root_hash**: root hash as returned by `veritysetup`
947 * **salt**: salt hash as returned by `veritysetup`
948
949 .. note:: dm-verity Runtime Options
950
951 Additional veritysetup options can be provided at boot time using the kernel
952 parameter `rd.kiwi.verity_options=option1,option2`. This allows runtime
953 customization.
954
955 KIWI automatically provides `hash-offset` and `hash-block-size` parameters
956 based on the image configuration. These should not be specified manually
957 via `rd.kiwi.verity_options=`.
958
959 **Common Options:**
960
961 * `panic-on-corruption`: System panics on corruption detection.
962 * `restart-on-corruption`: System restarts on corruption (often default).
963 * `ignore-corruption`: Ignore corruption (debugging only).
964 * `ignore-zero-blocks`: Skip verification of zero blocks.
965 * `check-at-most-once`: Verify each block only once.
966
967 For complete options, see `veritysetup(8) <https://man7.org/linux/man-pages/man8/veritysetup.8.html>`_.
968
969 overlayroot="true|false":
970 For the `oem` type only, specifies to use an `overlayfs`-based root
971 filesystem consisting of a squashfs-compressed read-only root
972 filesystem combined with an optional write partition or tmpfs.
973 The optional kernel boot parameter `rd.root.overlay.temporary` can
974 be used to point the write area into a `tmpfs` instead of
975 a persistent write partition. In this mode, all written data is
976 temporary until the system is rebooted. The kernel boot parameter
977 `rd.root.overlay.size` can be used to configure the size for the
978 `tmpfs` that is used for the `overlayfs` mount process if
979 `rd.root.overlay.temporary` is requested. That size configures the
980 amount of space available for writing new data during the runtime
981 of the system. The default value is set to `50%`, which means one
982 half of the available RAM space can be used for writing new data.
983 By default, the persistent write partition is used. The size of that
984 partition can be influenced via the optional `<size>` element in
985 the `<type>` section or via the optional `<oem-resize>` element in
986 the `<oemconfig>` section of the XML description. Setting a fixed
987 `<size>` value will set the size of the image disk to that
988 value and results in an image file of that size. The available
989 space for the write partition is that size, reduced by the
990 size the squashfs read-only system needs. If the `<oem-resize>`
991 element is set to `true`, an eventually given `<size>` element
992 will not have any effect because the write partition will be
993 resized on first boot to the available disk space.
994 To disable the use of any overlay, the kernel boot parameter
995 `rd.root.overlay.readonly` can be used. It takes precedence
996 over all other overlay kernel parameters because it leads to the
997 deactivation of any overlayfs-based action and just boots up with
998 the squashfs root filesystem. In fact, this mode is the same
999 as not installing the `kiwi-overlay` dracut module.
1000
1001 overlayroot_readonly_filesystem="squashfs|erofs":
1002 For the `oem` type only, specifies the filesystem type to use
1003 as a read-only filesystem in an `overlayroot` setup. By default,
1004 `squashfs` is used.
1005
1006 overlayroot_readonly_createoptions="string":
1007 For the `oem` type only, specifies additional creation options
1008 passed to the tool that builds the read-only filesystem of an
1009 `overlayroot` setup (`mkfs.erofs` or `mksquashfs`). The value is a
1010 whitespace separated list of options, analogous to `fscreateoptions`
1011 for the read-write root filesystem. A typical use is to select a
1012 larger EROFS physical cluster for a better compression ratio, for
1013 example `overlayroot_readonly_createoptions="-C 1048576"`.
1014
1015 overlayroot_write_partition="true|false":
1016 For the `oem` type only, this allows you to specify if the extra read-write
1017 partition in an `overlayroot` setup should be created or not.
1018 By default, the partition is created, and the kiwi-overlay dracut
1019 module also expects it to be present. However, the overlayroot
1020 feature can also be used without dracut (`initrd_system="none"`),
1021 and under certain circumstances, it is handy to configure whether the
1022 partition table should contain the read-write partition or not.
1023
1024 overlayroot_readonly_partsize="mbsize":
1025 Specifies the size in MB of the partition that stores the
1026 squashfs-compressed read-only root filesystem in an
1027 overlayroot setup. If not specified, kiwi calculates
1028 the needed size by a preliminary creation of the
1029 squashfs compressed file. However, this is only accurate
1030 if no changes to the root filesystem data happen
1031 after this calculation, which cannot be guaranteed as
1032 there is at least one optional script hook that is
1033 allowed and applied after the calculation. In addition, the
1034 pre-calculation requires some time in the build process.
1035 If the value can be provided beforehand, this also speeds
1036 up the build process significantly.
1037 Only available for the `oem` type.
1038
1039
1040 bootfilesystem="btrfs|ext2|ext3|ext4|xfs|fat32|fat16":
1041 If an extra boot partition is required, this attribute
1042 specifies which filesystem should be used for it. The
1043 type of the selected bootloader might overwrite this
1044 setting if there is no alternative possible, though.
1045 Only available for the `oem` type.
1046
1047
1048 flags="overlay|dmsquash":
1049 For the ISO image type, this specifies the live ISO technology and
1050 dracut module to use. If set to `overlay`, the kiwi-live dracut
1051 module will be used to support a live ISO system based on
1052 squashfs+overlayfs. If set to `dmsquash`, the dracut standard
1053 dmsquash-live module will be used to support a live ISO
1054 system based on the capabilities of the upstream dracut
1055 module.
1056
1057 format="format_name":
1058 For disk image type `oem`, this specifies the format of the virtual disk
1059 so that it can run on the desired target virtualization platform. The
1060 supported format names are:
1061
1062 * `gce`: Google Compute Engine image format.
1063 * `ova`: Open Virtualization Format Archive.
1064 * `qcow2`: QEMU Copy-On-Write version 2.
1065 * `vagrant`: Vagrant box format (tar.gz).
1066 * `vmdk`: VMware Virtual Machine Disk.
1067 * `vdi`: VirtualBox Disk Image.
1068 * `vhd`: Microsoft Virtual Hard Disk.
1069 * `vhdx`: Microsoft Virtual Hard Disk version 2.
1070 * `vhd-fixed`: Microsoft Virtual Hard Disk with fixed size.
1071 * `oci:image_format`: OCI image archive (oci format).
1072 * `docker:image_format`: OCI image archive (docker format).
1073
1074 The `(oci|docker):image_format` format is a special case that stores the
1075 disk image inside of an OCI-compliant container. The disk image is
1076 stored in the specified `image_format` in the `disk/` directory
1077 of the container. The disk format can be one of the above formats,
1078 except `vagrant` and the container formats themselves, or just `raw`
1079 if the disk should be stored as a raw disk inside of the container. Custom naming conventions for the disk image
1080 can be applied by using the `bundle_format` attribute.
1081 The `derived_from` attribute can be used to specify the source
1082 container. The resulting container image will be built by adding
1083 the disk image as a new layer on top of the specified reference container.
1084 If there is no `derived_from` attribute, the container image will be built
1085 from scratch using an empty root directory. This format is particularly
1086 useful for building an image which bundles the actual disk image
1087 and its runtime requirements into one artifact.
1088
1089 formatoptions="string":
1090 Specifies additional format options passed on to `qemu-img`.
1091 `formatoptions` is a comma-separated list of format-specific
1092 options in a `name=value` format, as `qemu-img` expects it.
1093 kiwi will take the information and pass it as a parameter to
1094 the `-o` option in the `qemu-img` call.
1095 Only available for the `oem` type.
1096
1097
1098 gpt_hybrid_mbr="true|false":
1099 For disk types, create a hybrid GPT/MBR partition table with an
1100 'accurate' MBR table that will have no 'bootable' flagged partition.
1101 For ISO types, create a hybrid GPT/MBR partition table where the
1102 MBR partition table contains a whole-disk 'protective' partition
1103 and a second bootable-flagged partition (intended to make the image
1104 bootable in both UEFI and BIOS modes on as much hardware as possible).
1105 In both cases, it only has an effect if the EFI partition table
1106 type is GPT.
1107 Only available for the `oem` and `iso` types.
1108
1109
1110 hybridpersistent="true|false":
1111 For the live ISO type, this triggers the creation of a partition for
1112 a COW file to keep data persistent over a reboot.
1113 Only available for the `iso` and `pxe` types.
1114
1115
1116 hybridpersistent_filesystem="ext4|xfs":
1117 For the live ISO type, set the filesystem to use for persistent
1118 writing if a hybrid image is used as a disk on, e.g., a USB Stick.
1119 By default, the ext4 filesystem is used.
1120 Only available for the `iso` and `pxe` types.
1121
1122
1123 initrd_system="kiwi|dracut|none":
1124 Specify which initrd builder to use; the default is set to `dracut`,
1125 except for the `pxe` type, which defaults to `kiwi`.
1126 If set to `none`, the image is built without an initrd. Depending
1127 on the image type, this can lead to a non-bootable system, as it's
1128 now a kernel responsibility if the given root device can be
1129 mounted or not.
1130 Only available for the `oem`, `pxe` and `kis` types.
1131
1132
1133 metadata_path="dir_path":
1134 Specifies a path to additional metadata required for the selected
1135 image type or its tools used to create that image type.
1136
1137 .. note::
1138
1139 Currently, this is only effective for the `appx` container image type,
1140 where it is **mandatory**.
1141
1142 installboot="failsafe-install|harddisk|install":
1143 Specifies the bootloader's default boot entry for the initial
1144 boot of a {kiwi} install image.
1145
1146 .. note::
1147
1148 This value is only evaluated for grub.
1149
1150 install_continue_on_timeout="true|false":
1151 Specifies the boot timeout handling for the {kiwi}
1152 install image. If set to "true", the configured timeout
1153 or its default value applies. If set to "false", no
1154 timeout applies in the boot menu of the install image.
1155
1156 installprovidefailsafe="true|false":
1157 Specifies if the bootloader menu should provide a
1158 failsafe entry with special kernel parameters or not.
1159 Only available for the `oem` type.
1160
1161
1162 installiso="true|false"
1163 Specifies if an install ISO image should be created.
1164 This attribute is only available for the `oem` type.
1165 The generated ISO image is a hybrid ISO that can be
1166 used as a disk on, e.g., a USB stick or as an ISO.
1167
1168 installstick="true|false":
1169 Specifies if an install stick image should be created.
1170 Only available for the `oem` type.
1171
1172 installpxe="true|false":
1173 Specifies if a tarball that contains all data for a PXE network
1174 installation should be created. This attribute is only available
1175 for the `oem` type.
1176
1177 mediacheck="true|false":
1178 For ISO images, specifies whether the bootloader menu should provide a
1179 mediacheck entry to verify ISO integrity or not. It is disabled by default
1180 and only available for the x86 arch family.
1181
1182 mdraid="mirroring|striping":
1183 Set up software RAID in degraded mode with one disk.
1184 Thus, only mirroring and striping are possible.
1185 Only available for the `oem` type.
1186
1187
1188 primary="true|false":
1189 Specifies this type to be the primary type. If no type option
1190 is given on the commandline, {kiwi} will build this type.
1191
1192 ramonly="true|false":
1193 For all images that are configured to use the overlay filesystem,
1194 this setting forces any COW(Copy-On-Write) action to happen in RAM.
1195 Only available for the `oem` type.
1196
1197
1198 rootfs_label="string":
1199 A label name to set for the root filesystem. By default, `ROOT` is used.
1200 Only available for the `oem`, `pxe`, `kis` and `docker` types.
1201
1202
1203 volid="string":
1204 For the `iso` and `oem` install ISO only, this specifies the
1205 volume ID (volume name or label) to be written into the master block.
1206 Can be at most 32 characters.
1207
1208 application_id="string":
1209 For the ISO/(oem install ISO) type only, specifies the Application
1210 ID to be written into the master block. There is space for
1211 128 characters.
1212
1213 vhdfixedtag="GUID_string":
1214 For the VHD disk format, this specifies the GUID.
1215 Only available for the `oem` type.
1216
1217
1218 derived_from="string":
1219 For container images, specifies the image URI of the container image.
1220 The image created by {kiwi} will use the specified container as the
1221 base root to work on.
1222 Only available for the `docker`, `oci` and `oem` types. On the `oem` type it
1223 may only be combined with a container output format, that is
1224 `format="oci:..."` or `format="docker:..."`.
1225
1226
1227 delta_root="true|false":
1228 For container images and in combination with the `derived_from`
1229 attribute. If `delta_root` is set to `true`, {kiwi} creates
1230 a container image that only contains the differences compared
1231 to the given `derived_from` container. Such a container is, on
1232 its own, no longer functional and requires a tool that is able
1233 to provision a container instance from the `derived_from`
1234 container combined with the `delta_root` application container.
1235 Such a tool exists with the
1236 `oci-pilot <https://github.com/Elektrobit/oci-pilot>`_
1237 project and allows you to manage applications as containers
1238 that feel like native applications on the host system.
1239 Only available for the `docker` and `oci` types.
1240
1241
1242 ensure_empty_tmpdirs="true|false":
1243 For OCI container images, this specifies whether to ensure the `/run` and `/tmp`
1244 directories are empty in the container image created by {kiwi}.
1245 The default is true.
1246 Only available for the `docker` and `oci` types.
1247
1248
1249 publisher="string":
1250 For ISO images, this specifies the publisher name of the ISO.
1251 Only available for the `iso` type.
1252
1253
1254 eficsmpart_id="number":
1255 For OEM images, this specifies the partition number for the EFI CSM
1256 (legacy BIOS) partition. For details about the evaluation and impact
1257 of custom partition ids, please see: :ref:`custom_partitions`.
1258
1259 efipart_id="number":
1260 For OEM images, specifies the partition number for the EFI partition.
1261 For details about the evaluation and impact of custom partition ids,
1262 please see: :ref:`custom_partitions`.
1263
1264 rootpart_id="number":
1265 For OEM images, this specifies the partition number for the ROOT partition.
1266 For details about the evaluation and impact of custom partition ids,
1267 please see: :ref:`custom_partitions`.
1268
1269 bootpart_id="number":
1270 For OEM images, specifies the partition number for the BOOT partition.
1271 For details about the evaluation and impact of custom partition ids,
1272 please see: :ref:`custom_partitions`.
1273
1274 boot="path":
1275 Path to a {kiwi} boot image description used to build the initrd.
1276 Requires `initrd_system="kiwi"`. A relative path is looked up below
1277 :file:`/usr/share/kiwi/custom_boot`. Only available for the `oem` and
1278 `pxe` types.
1279
1280 bootkernel="name":
1281 Name of the kernel profile of the boot image description to use.
1282 Passed on as `add-profile` when the boot image is built.
1283
1284 bootprofile="name":
1285 Name of the profile of the boot image description to use. Passed on as
1286 `add-profile` when the boot image is built. Only available for the
1287 `oem`, `iso`, `pxe` and `cpio` types.
1288
1289 bundle_format="string":
1290 Base name pattern used for all target image files by
1291 :command:`kiwi-ng result bundle`. See
1292 :ref:`image_types` for the list of supported placeholders.
1293
1294 disk_start_sector="number":
1295 First usable sector of the partition table. The minimum, and the
1296 default, is 2048. Only available for the `oem` type.
1297
1298 enclave_format="aws-nitro":
1299 Target format of the enclave image. `aws-nitro` is currently the only
1300 supported value. Only available for the `enclave` type.
1301
1302 gcelicense="string":
1303 License tag to embed into an image built with `format="gce"`.
1304 Only available for the `oem` type.
1305
1306 luksOS="sle12":
1307 Passes a predefined set of cipher, keysize and hash format options to
1308 the :command:`cryptsetup` call, producing a format compatible with the
1309 named distribution. Only available for the `oem`, `iso`, `pxe` and
1310 `kis` types.
1311
1312 luks_pbkdf="pbkdf2|argon2i|argon2id":
1313 Key derivation function used by LUKS to derive the encryption key from
1314 the password. Only available for the `oem`, `iso`, `pxe` and `kis`
1315 types.
1316
1317 luks_randomize="true|false":
1318 By default all blocks of a LUKS volume are filled with pseudo-random
1319 data. Set this to `false` to reduce the image size when shipping an
1320 image with a well-known key that is re-encrypted at deployment time.
1321 Only available for the `oem`, `iso`, `pxe` and `kis` types.
1322
1323 provide_system_files="true|false":
1324 Emit a metadata file listing the system files of the image, for later
1325 consumption by a derived build. Only available for the `docker` and
1326 `oci` types. Use a `<packages type="systemfiles">` section to filter
1327 the generated list.
1328
1329 require_system_files="true|false":
1330 Consume the system file metadata provided by a base image. Only
1331 available for the `docker` and `oci` types.
1332
1333 wwid_wait_timeout="number":
1334 Seconds to wait for a device WWID to appear. Defaults to 3.
1335 Only available for the `oem` type.
1336
1337 xen_server="true|false":
1338 Marks the image as a Xen dom0 (server) rather than a Xen guest.
1339 Only available for the `oem` type. See also
1340 `check_xen_uniquely_setup_as_server_or_guest`.
1341
1342 The following sections show the supported child elements of the `type`
1343 element, including references to their usage in a detailed type setup:
1344
1345 .. _preferences-type-luksformat:
1346
1347 <preferences><type><luksformat>
1348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1349 The `luksformat` element is used to specify additional luks options
1350 passed on to the `cryptsetup luksFormat` call. The element requires
1351 the attribute `luks` to be set in the `<type>` section referring to
1352 `luksformat`. Several custom settings related to the LUKS and LUKS2
1353 format features can be set up. For example, the setup of
1354 the `dm_integrity` feature:
1355
1356 .. code:: xml
1357
1358 <luksformat>
1359 <option name="--cipher" value="aes-gcm-random"/>
1360 <option name="--integrity" value="aead"/>
1361 </luksformat>
1362
1363 .. _preferences-type-bootloader:
1364
1365 <preferences><type><bootloader>
1366 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1367 The `bootloader` element is used to select the bootloader. At the moment,
1368 `grub2`, `systemd_boot`, and the combination of zipl
1369 plus userspace grub2, `grub2_s390x_emu`, are supported. The special
1370 `custom` entry allows you to skip the bootloader configuration and installation
1371 and leaves this up to the user, which can be done by using
1372 the `editbootinstall` and `editbootconfig` custom scripts.
1373
1374 .. note::
1375
1376 Bootloaders provide a very different set of features and only
1377 work within their individual implementation priorities. {kiwi}
1378 provides an API for bootloaders, but not all API methods can be
1379 implemented for all bootloaders due to the fact that some
1380 features only exist in one but not in another bootloader. If
1381 a bootloader setting is used that is not understood by the
1382 selected bootloader, the image build process will fail with
1383 an exception message.
1384
1385 name="grub2|grub2_s390x_emu|systemd_boot|custom|zipl":
1386 Specifies the bootloader to use for this image.
1387
1388 .. note:: systemd_boot ESP size
1389
1390 The implementation to support systemd-boot reads all
1391 data from the ESP (EFI System Partition). This also
1392 includes the kernel and initrd, which requires the size
1393 of the ESP to be configured appropriately. By default,
1394 {kiwi} configures the ESP with 20MB. For systemd_boot,
1395 this is usually too small and can be changed with the
1396 `efipartsize` attribute. Reading boot-relevant files
1397 from another filesystem requires providing alternative
1398 EFI filesystem drivers, e.g., efifs, and also needs
1399 adaptations on the setup of `bootctl`.
1400
1401 .. note:: systemd_boot and shim
1402
1403 At the moment, the EFI image provided along with systemd-boot
1404 is not compatible with the shim-signed loader provided in an
1405 extra effort by the distributions.
1406
1407 In addition to the mandatory name attribute, the following optional
1408 attributes are supported:
1409
1410 bls="true|false":
1411 Specifies whether to use Bootloader Spec-style configuration if
1412 `grub` in the image supports it. It is a no-op if the `blscfg`
1413 module is not available. This option is only available for `grub`
1414 and defaults to true if not set.
1415
1416 output_console="none|console|gfxterm|serial|vga_text|mda_text|morse|spkmodem":
1417 Specifies the bootloader output console. The attribute is available for the
1418 `grub` bootloader type. Multiple console types can be provided, separated
1419 by a space.
1420
1421 input_console="none|console|serial|at_keyboard|usb_keyboard":
1422 Specifies the bootloader input console. The attribute is available for the
1423 `grub` bootloader type. Multiple console types can be provided, separated
1424 by a space. If no `input_console` is provided, the value for the
1425 `output_console` is used if specified.
1426
1427 grub_template="filename":
1428 Specifies a custom grub bootloader template file that will be used
1429 instead of the one provided with {kiwi}. A static bootloader template to
1430 create the grub config file is only used in {kiwi} if the native method
1431 via the grub `mkconfig` toolchain does not work properly. As of today,
1432 this is only the case for live and install ISO images. Thus, this
1433 setting only affects the oem and iso image types.
1434
1435 The template file should contain a `Template string
1436 <https://docs.python.org/3.4/library/string.html#template-strings>`_
1437 and can use the following variables:
1438
1439 +-----------------------+----------------------------------------------+
1440 | Variable | Description |
1441 +=======================+==============================================+
1442 | search_params | parameters needed for grub's `search` |
1443 | | command to locate the root volume |
1444 +-----------------------+----------------------------------------------+
1445 | default_boot | number of the default menu item to boot |
1446 +-----------------------+----------------------------------------------+
1447 | kernel_file | the name of the kernel file |
1448 +-----------------------+----------------------------------------------+
1449 | initrd_file | the name of the initial ramdisk file |
1450 +-----------------------+----------------------------------------------+
1451 | boot_options | kernel command-line options for booting |
1452 | | normally |
1453 +-----------------------+----------------------------------------------+
1454 | failsafe_boot_options | kernel command-line options for booting in |
1455 | | failsafe mode |
1456 +-----------------------+----------------------------------------------+
1457 | gfxmode | the resolution to use for the bootloader; |
1458 | | passed to grub's `gfxmode` command |
1459 +-----------------------+----------------------------------------------+
1460 | theme | the name of a graphical theme to use |
1461 +-----------------------+----------------------------------------------+
1462 | boot_timeout | the boot menu timeout, set by the `timeout` |
1463 | | attribute |
1464 +-----------------------+----------------------------------------------+
1465 | boot_timeout_style | the boot timeout style, set by the |
1466 | | `timeout_style` attribute |
1467 +-----------------------+----------------------------------------------+
1468 | serial_line_setup | directives used to initialize the serial |
1469 | | port, set by the `serial_line` attribute |
1470 +-----------------------+----------------------------------------------+
1471 | title | a title for the image: this will be the |
1472 | | `<image>` tag's `displayname` attribute or |
1473 | | its `name` attribute if `displayname` is not |
1474 | | set; see: :ref:`sec.image` |
1475 +-----------------------+----------------------------------------------+
1476 | bootpath | the bootloader lookup path |
1477 +-----------------------+----------------------------------------------+
1478 | boot_directory_name | the name of the grub directory |
1479 +-----------------------+----------------------------------------------+
1480 | efi_image_name | architecture-specific EFI boot binary name |
1481 +-----------------------+----------------------------------------------+
1482 | terminal_setup | the bootloader console mode, set by the |
1483 | | `console` attribute |
1484 +-----------------------+----------------------------------------------+
1485
1486 serial_line="string":
1487 Specifies the bootloader serial line setup. The setup is effective if
1488 the bootloader console is set to use the serial line. The attribute is
1489 available for the grub bootloader only.
1490
1491 video_mode="string":
1492 Specifies the video mode to use for the bootloader. The attribute is
1493 available for the grub bootloader only and is passed to grub's `gfxmode`
1494 command. For details on the supported video modes, please see the grub
1495 manual at https://www.gnu.org/software/grub/manual/grub/html_node/gfxmode.html.
1496
1497 timeout="number":
1498 Specifies the boot timeout in seconds prior to launching the default
1499 boot option. By default, the timeout is set to 10 seconds. It makes
1500 sense to set this value to `0` for images intended to be started
1501 non-interactively (e.g., virtual machines).
1502
1503 timeout_style="countdown|hidden|menu":
1504 Specifies the boot timeout style to control the way in which the timeout
1505 interacts with displaying the menu. If set, the display of the
1506 bootloader menu is delayed after the timeout has expired. In countdown mode,
1507 an indication of the remaining time is displayed. The attribute is
1508 available for the grub loader only.
1509
1510 targettype="CDL|FBA|SCSI|GPT":
1511 Specifies the device type of the disk zipl should boot.
1512 On zFCP and/or KVM devices, use `SCSI` or `GPT`; on DASD devices,
1513 use `CDL`; on emulated DASD devices, use `FBA`.
1514 The attribute is available for the `grub2_s390x_emu` and `zipl`
1515 loaders only.
1516
1517 use_disk_password="true|false":
1518 When `/boot` is encrypted, makes the bootloader store the
1519 password in its configuration file (in cleartext). This is
1520 useful for full disk encryption images.
1521
1522 <preferences><type><bootloader><securelinux>
1523 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1524 Used to specify data required to set up secure Linux execution. Secure
1525 Linux execution reads the kernel, initrd, and boot parameters from an
1526 encrypted data blob and couples the image to the machine it gets
1527 executed on. Typically, the private key is protected in hardware on
1528 the machine itself. {kiwi} supports secure execution for the IBM secure
1529 Linux target on the s390 platform, along with the bootloaders
1530 `zipl` and `grub2_s390x_emu`.
1531
1532 .. code:: xml
1533
1534 <securelinux hkd_ca_cert="some-ca.crt" hkd_sign_cert="some-signing.crt">
1535 <hkd_cert name="some1-host.crt"/>
1536 <hkd_cert name="some2-host.crt"/>
1537 <hkd_revocation_list name="some1-revocation.crl"/>
1538 <hkd_revocation_list name="some2-revocation.crl"/>
1539 </securelinux>
1540
1541 The `securelinux` element itself can be specified multiple times, for example to
1542 couple one image to several machines that use different signing certificates.
1543
1544 hkd_ca_cert:
1545 Mandatory attribute providing the `Common Authority` certificate (signed by
1546 the root CA) that is used to establish a chain of trust for the verification
1547 of the `Host Key Document`.
1548
1549 hkd_sign_cert:
1550 Mandatory attribute providing the `Signing` certificate that is used to
1551 establish a chain of trust for the verification of the `Host Key Document`.
1552
1553 hkd_cert:
1554 Child element, required at least once. The file specified in the `name`
1555 attribute defines the `Host Key Document` and tightly couples the image to the
1556 host matching the document. Can be specified multiple times.
1557
1558 hkd_revocation_list:
1559 Optional child element, providing in its `name` attribute the revocation list
1560 to check on the use of expired certificates in the chain of trust. Can be
1561 specified multiple times.
1562
1563 <preferences><type><bootloader><bootloadersettings>
1564 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1565 Used to specify custom arguments for the tools called to set up
1566 the bootloader:
1567
1568 * secure boot via `<shimoption>`, e.g., `shim-install`
1569 * installation of the bootloader via `<installoption>`, e.g., `grub-install`
1570 * configuration of the bootloader via `<configoption>`, e.g., `grub-mkconfig`
1571 * setup of bootloader environment variables via `<environment>`, e.g., `grub2-editenv`
1572
1573 .. code:: xml
1574
1575 <bootloadersettings>
1576 <shimoption name="--suse-enable-tpm"/>
1577 <shimoption name="--bootloader-id" value="some-id"/>
1578 <installoption name="--suse-enable-tpm"/>
1579 <configoption name="--debug"/>
1580 <environment>
1581 <env name="menu_auto_hide" value="1"/>
1582 </environment>
1583 </bootloadersettings>
1584
1585 .. note::
1586
1587 {kiwi} does not judge the given parameters, and if the provided
1588 data is effectively used depends on the individual bootloader
1589 implementation.
1590
1591 <preferences><type><containerconfig>
1592 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1593 Used to describe the container configuration metadata in docker or wsl
1594 image types. For details, see: :ref:`building_container_build` and:
1595 :ref:`building_wsl_build`.
1596
1597 <preferences><type><vagrantconfig>
1598 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1599 Used to describe vagrant configuration metadata in a disk image
1600 that is being used as a vagrant box. For details, see: :ref:`setup_vagrant`.
1601
1602 <preferences><type><systemdisk>
1603 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1604 Used to describe the volumes of the disk area, which
1605 contains the root filesystem. Volumes are either a feature
1606 of the used filesystem, or LVM is used for this purpose.
1607 For details, see: :ref:`custom_volumes`.
1608
1609 .. note::
1610
1611 When both `<partitions>` and `<systemdisk>` are used, `<partitions>`
1612 are evaluated first, and mount points defined in `<partitions>` cannot
1613 be redefined as `<systemdisk>` volumes. The two types define a
1614 complete disk setup, so there cannot be any overlapping volumes
1615 or mount points. As a result, whatever is written in `<partitions>`
1616 cannot be expressed in the same way in `<systemdisk>`.
1617
1618 <preferences><type><partitions>
1619 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1620 Used to describe the geometry of the disk on the level of the
1621 partition table. For details, see: :ref:`custom_partitions`.
1622
1623 <preferences><type><oemconfig>
1624 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1625 Used to customize the deployment process in an OEM disk image.
1626 For details, see: :ref:`oem_customize`.
1627
1628 <preferences><type><size>
1629 ~~~~~~~~~~~~~~~~~~~~~~~~~
1630 Used to customize the size of the resulting disk image in an
1631 OEM image. For details, see: :ref:`disk-the-size-element`.
1632
1633 <preferences><type><machine>
1634 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1635 Used to customize the virtual machine configuration, which describes
1636 the components of an emulated hardware.
1637 For details, see: :ref:`disk-the-machine-element`.
1638
1639 <preferences><type><installmedia>
1640 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1641 Used to customize the installation media images created for OEM images
1642 deployment.
1643 For details, see: :ref:`installmedia_customize`.
1644
1645 <preferences><type><initrd>
1646 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1647 Used to specify custom arguments for the initrd tooling, e.g., dracut.
1648
1649 .. code:: xml
1650
1651 <initrd action="setup">
1652 <dracut uefi="true"/>
1653 </initrd>
1654 <initrd action="add|omit">
1655 <dracut module="some_a"/>
1656 <dracut module="some_b"/>
1657 <dracut driver="driver_name"/>
1658 </initrd>
1659
1660 dracut.uefi.true:
1661 As part of the `setup` action, this enables creating a UKI EFI binary.
1662
1663 dracut.module.NAME:
1664 As part of the `add` or `omit` action, this adds or omits the given
1665 module name. The element can be specified multiple times.
1666
1667 dracut.driver.NAME:
1668 As part of the `add` or `omit` action, this adds or omits the given
1669 kernel driver. The element can be specified multiple times and
1670 accepts kernel driver names without the `.ko` extension.
1671
1672 .. _sec.registry:
1673
1674 <containers>
1675 ------------
1676
1677 Set up containers to fetch from a registry assigned to one
1678 of the supported container backends.
1679
1680 .. code:: xml
1681
1682 <containers source="registry.opensuse.org" backend="podman">
1683 <container name="some"/>
1684 </containers>
1685
1686 <containers source="registry.opensuse.org" backend="container-snap">
1687 <container name="opensuse/bootable" tag="slowroll"/>
1688 </containers>
1689
1690 The optional containers element specifies the location of one or
1691 more containers on a registry `source` server. {kiwi} will take
1692 this information and fetch the containers as OCI archives to
1693 the image. On first boot, these container archives will be loaded
1694 into the local container backend store for the selected
1695 backend, and the archive files will be deleted.
1696
1697 Supported `backend` values are `docker`, `podman`, and
1698 `container-snap`. The `backend` attribute is mandatory and specifies
1699 for which container backend the image should be available in the
1700 system. The `containers` element has the following optional
1701 attributes:
1702
1703 arch="arch"
1704 The containers section can be configured to apply only for a certain
1705 architecture. In this case, specify the `arch` attribute with a
1706 value as it is reported by :command:`uname -m`.
1707
1708 profiles="name[,name]"
1709 A list of profiles to which this containers selection applies
1710 (see :ref:`image-profiles`).
1711
1712 <containers><container>
1713 -----------------------
1714
1715 Details about the container.
1716
1717 .. code:: xml
1718
1719 <containers source="registry.opensuse.org" backend="podman">
1720 <container name="some"/>
1721 </containers>
1722
1723 The `name` attributes are mandatory and specify
1724 the name of the container as it exists in the registry.
1725 The `container` element has the following optional attributes:
1726
1727 path="some/path"
1728 The path to the container in the registry. If not specified,
1729 the value defaults to `/`.
1730
1731 fetch_only="true|false"
1732 If set to `true`, kiwi will only fetch the container but will not
1733 set up the systemd unit for loading the container into
1734 the local registry. In this mode, the container archive file stays
1735 in the system and can be handled in a custom way. By default,
1736 `fetch_only` is set to `false`.
1737
1738 tag="tagname"
1739 Specifies the container tag to fetch. If not set, the tag name
1740 defaults to `latest`.
1741
1742 arch="arch"
1743 The container section can be configured to apply only for a certain
1744 architecture. In this case, specify the `arch` attribute with a
1745 value as it is reported by :command:`uname -m`.
1746
1747 .. _sec.repository:
1748
1749 <repository>
1750 -------------
1751
1752 Set up software sources for the image.
1753
1754 .. code:: xml
1755
1756 <repository arch="arch">
1757 <source path="uri"/>
1758 </repository>
1759
1760 The repository element specifies the location and type of a
1761 repository to be used by the package manager as a package installation
1762 source. It is optional and may be provided multiple times, but at least one
1763 repository is required for {kiwi} to be able to install software.
1764 {kiwi} supports apk, apt, dnf4, dnf5, microdnf, pacman, and zypper as
1765 package managers, specified via the packagemanager element.
1766 The repository element has the following optional attributes:
1767
1768 alias="name"
1769 Specifies an alternative name for the configured repository. If the
1770 attribute is not specified, {kiwi} will generate a random alias name
1771 for the repository. The specified name must match the pattern:
1772 `[a-zA-Z0-9_\-\.]+`.
1773
1774 type="apk|apt-deb|apt-rpm|deb-dir|mirrors|rpm-md"
1775 Specifies the repository metadata format. If not set, {kiwi} derives a
1776 suitable default from the configured package manager.
1777
1778 arch="arch_name[,arch_name]"
1779 Use this repository only when building on one of the listed host
1780 architectures.
1781
1782 profiles="profile_a,profile_b"
1783 Use this repository only when one of the listed build profiles is active.
1784
1785 architectures="arch_name[,arch_name]"
1786 Used for `apt-deb` repositories only. Declares which architectures this
1787 repository provides packages for.
1788
1789 components="name"
1790 Used for Debian (apt) based repositories only. Specifies the
1791 component name that should be used from the repository. By default,
1792 the `main` component is used.
1793
1794 distribution="name"
1795 Used for Debian (apt) based repositories only. Specifies the
1796 distribution name used in the repository data structure.
1797
1798 imageonly="true|false"
1799 Specifies whether or not this repository should be configured in
1800 the resulting image without using it at build time. By default,
1801 the value is set to false. This attribute is mutually exclusive with
1802 `imageinclude`.
1803
1804 repository_gpgcheck="true|false"
1805 Specifies whether or not this specific repository values the result
1806 of the repository signature validation. If not set, the default is
1807 `false`. If set, the relevant key information needs to be provided
1808 on the {kiwi} commandline using the `--signing-key` option or via
1809 the `<signing>` element as part of the `<repository><source>`
1810 setting in the image description. Some distributions provides the
1811 signing keys as part of the `distribution-gpg-keys` package. In that case,
1812 the keys can be included in the image by specifying a repository like
1813 the following:
1814
1815 .. code:: xml
1816
1817 <repository type="rpm-md" alias="baseos" sourcetype="metalink">
1818 <source path="https://mirrors.fedoraproject.org/metalink?repo=eln-baseos-1&amp;arch=$basearch">
1819 <signing key="file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-rawhide-primary"/>
1820 </source>
1821 </repository>
1822
1823 Debian based distributions, on the other hand, usually provide the keys
1824 at https://ftp-master.debian.org/keys.html. Fetch the relevant key for
1825 the image target distribution from there and use them in the same way as
1826 described above.
1827
1828 package_gpgcheck="true|false"
1829 Specify whether or not this specific repository values the result
1830 of the package signature validation for each package taken from
1831 this repository. If not set, the default value is `false`.
1832 If set, the same key information requirements as for the
1833 `repository_gpgcheck` attribute apply.
1834
1835 customize="/path/to/custom_script"
1836 A custom script hook that is invoked with the repo file as a parameter
1837 for each file created by {kiwi}.
1838
1839 .. note::
1840
1841 If the script is provided as a relative path, it will
1842 be searched in the image description directory.
1843
1844 imageinclude="true|false"
1845 Specifies whether the given repository should be configured as a
1846 repository in the image or not. The default behavior is that
1847 repositories used to build an image are not configured as a
1848 repository inside the image. This feature allows you to change the
1849 behavior by setting the value to true.
1850
1851 .. note:: Scope of repository uri's
1852
1853 The repository is configured in the image according to the source
1854 path as specified with the `path` attribute of the source element.
1855 Therefore, if the path is not a fully qualified URL, you may need
1856 to adjust the repository file in the image to accommodate the
1857 expected location. It is recommended that you use the alias
1858 attribute in combination with the `imageinclude` attribute to
1859 avoid having unpredictable random names assigned to the
1860 repository you wish to include in the image.
1861
1862 password="string"
1863 Specifies a password for the given repository. The password attribute
1864 must be used in combination with the username attribute. Dependent on
1865 the repository location, this information may not be used.
1866
1867 username="name"
1868 Specifies a user name for the given repository. The username
1869 attribute must be used in combination with the password attribute.
1870 Dependent on the repository location, this information may not be
1871 used.
1872
1873 priority="number"
1874 Specifies the repository priority for this given repository. Priority
1875 values are treated differently by different package managers.
1876 Repository priorities allow the package management system to
1877 disambiguate packages that may be contained in more than one of the
1878 configured repositories. The zypper package manager, for example,
1879 prefers packages from a repository with a *lower* priority over
1880 packages from a repository with higher priority values.
1881 If the attribute is not set, {kiwi} writes no priority into the generated
1882 repository configuration, so the package manager's own default applies.
1883 For other package managers, please refer to the individual documentation
1884 about repository priorities.
1885
1886 sourcetype="baseurl|metalink|mirrorlist"
1887 Specifies the source type of the repository path. Depending on whether the
1888 source path is a simple URL or a pointer to a metadata file or mirror
1889 list, the configured package manager needs to be set up appropriately.
1890 By default, the source is expected to be a simple repository baseurl.
1891
1892 <repository><source>
1893 ~~~~~~~~~~~~~~~~~~~~
1894 The location of a repository is specified by the path attribute of the
1895 mandatory source child element:
1896
1897 .. code:: xml
1898
1899 <repository alias="kiwi">
1900 <source path="{exc_kiwi_repo}"/>
1901 </repository>
1902
1903 The location specification may include
1904 the `%arch` macro, which will expand to the architecture of the image
1905 building host. The value for the path attribute may begin with any of
1906 the following location indicators:
1907
1908 * ``file:///local/path/to/file``
1909 An absolute path to a file accessible through the local filesystem.
1910
1911 * ``ftp://<ftp://>``
1912 A ftp-protocol-based network location.
1913
1914 * ``http://<http://>``
1915 A http-protocol-based network location.
1916
1917 * ``https://<https://>``
1918 A https-protocol-based network location.
1919
1920 .. note:: https repositories
1921
1922 When specifying a https location for a repository, it is generally
1923 necessary to include the openssl certificates and a cracklib word
1924 dictionary as package entries in the bootstrap section of the
1925 image configuration. The names of the packages to include are
1926 individual to the used distribution. On SUSE systems, as one example,
1927 this would be `openssl-certs` and `cracklib-dict-full`.
1928
1929 * ``obs://Open:Build:Service:Project:Name``
1930 A reference to a project in the Open Build Service (OBS). {kiwi}
1931 translates the given project path into a remote URL at which
1932 the given project hosts the packages.
1933
1934 * ``obsrepositories:/``
1935 A placeholder for the Open Build Service (OBS) to indicate that all
1936 repositories are taken from the project configuration in OBS.
1937
1938 A repository `<source>` element can optionally contain one or more
1939 signing keys for the packages from this repository, as shown in the
1940 following example:
1941
1942 .. code:: xml
1943
1944 <repository alias="kiwi">
1945 <source path="{exc_kiwi_repo}">
1946 <signing key="file:///path/to/sign_key_a"/>
1947 <signing key="file:///path/to/sign_key_b"/>
1948 </source>
1949 </repository>
1950
1951 All signing keys from all repositories will be collected and
1952 incorporated into the keyring as used by the selected package
1953 manager.
1954
1955 .. _sec.packages:
1956
1957 <packages>
1958 -----------
1959
1960 Set up software components to be installed in the image.
1961
1962 .. code:: xml
1963
1964 <packages type="type"/>
1965
1966 The packages element specifies the setup of a packages group for the given
1967 type. It is optional and may be provided multiple times, but in practice at
1968 least a `bootstrap` group is required to produce a usable appliance. The value
1969 of the type attribute specifies at which state in the build process the packages
1970 group is handled.
1971 The attribute accepts the following set of values:
1972
1973 type="bootstrap"
1974 Bootstrap packages, a list of packages to be installed first into
1975 a new (empty) root tree. The packages list the required components
1976 to support a chroot environment from which further software
1977 components can be installed.
1978
1979 type="image"
1980 Image packages, a list of packages to be installed as part of a chroot
1981 operation inside the new root tree.
1982
1983 type="uninstall|delete"
1984 Packages to be uninstalled or deleted. For further details,
1985 see :ref:`uninstall-system-packages`.
1986
1987 type="docker|iso|kis|oci|oem|pxe"
1988 Packages to be installed only when the named image type is being built.
1989 For example, with `type="iso"` the packages in this group are installed
1990 only if the ISO image type is built. Note that these six are the only
1991 image type names accepted here. Other `<type image="...">` values such as
1992 `appx`, `wsl`, `enclave`, `tbz`, `cpio` and the plain filesystem types have
1993 no corresponding packages group, use `type="image"` for those.
1994
1995 type="systemfiles"
1996 Used together with the `provide_system_files` and `require_system_files`
1997 type attributes. The group typically holds `<ignore>` entries naming
1998 packages to filter out of the generated system file list.
1999
2000
2001 In addition to `type`, the `packages` element accepts the following optional
2002 attributes:
2003
2004 profiles="profile_a,profile_b"
2005 Use this packages group only when one of the listed build profiles is active.
2006
2007 patternType="onlyRequired|plusRecommended"
2008 Controls how `namedCollection` entries are resolved.
2009
2010 bootstrap_package="package_name"
2011 For use with the `apt` package manager only, and only on a
2012 `type="bootstrap"` group. Specifies the name of a bootstrap package that
2013 provides a bootstrap tarball in
2014 :file:`/var/lib/bootstrap/PACKAGE_NAME.ARCH.tar.xz`. The tarball is
2015 unpacked and used as the bootstrap rootfs to begin with, providing an
2016 alternative bootstrap method. For further details, see
2017 :ref:`debianbootstrap_alternative`.
2018
2019 The packages element may contain any number of the following child elements,
2020 which provide specific configuration information for the specified packages
2021 group:
2022
2023 <packages><package>
2024 ~~~~~~~~~~~~~~~~~~~
2025 .. code:: xml
2026
2027 <packages type="image">
2028 <package name="name" arch="arch"/>
2029 </packages>
2030
2031 The package element installs the given package name. The optional
2032 `arch` attribute can be used to limit the installation of the package
2033 to the host architecture from which {kiwi} is called. The `arch`
2034 attribute is also available in all of the following elements.
2035
2036 Two further optional attributes control the {kiwi} initrd:
2037
2038 bootinclude="true|false"
2039 Additionally install this package into the {kiwi} initrd.
2040
2041 bootdelete="true|false"
2042 Remove this package from the {kiwi} initrd again. Only evaluated in
2043 combination with `bootinclude`.
2044
2045 <packages><namedCollection>
2046 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2047 .. code:: xml
2048
2049 <packages type="image" patternType="onlyRequired">
2050 <namedCollection name="base"/>
2051 </packages>
2052
2053 The `namedCollection` element is used to install a number of packages
2054 grouped together under a name. This is a feature of the individual
2055 distribution and is used in the implementation of the {kiwi} package
2056 manager backend. At the moment, collections are only supported for
2057 SUSE- and Red Hat-based distributions. The optional `patternType` attribute
2058 is used to control the behavior of the dependency resolution of
2059 the package collection. `onlyRequired` installs only the collection
2060 and its required packages. `plusRecommended` installs the collection,
2061 any of its required packages, and any recommended packages.
2062
2063 .. note:: Collections on SUSE
2064
2065 On SUSE-based distributions, collections are called `patterns` and are
2066 just simple packages. To get the names of the patterns such that
2067 they can be used in a namedCollection type, use the following command:
2068 `$ zypper patterns`. If for some reason the collection name cannot
2069 be used, it is also possible to add the name of the package that
2070 provides the collection as part of a `package` element. To get the
2071 names of the pattern packages, type the following command:
2072 `$ zypper search patterns`. By convention, all packages that start
2073 with the name "patterns-" represent a pattern package.
2074
2075 .. note:: Collections on Red Hat
2076
2077 On Red Hat-based distributions, collections are called `groups` and are
2078 extra metadata. To get the names of these groups, type the following
2079 command: `$ dnf group list -v`. Please note that since {kiwi} v9.23.39,
2080 group IDs are allowed only, e.g.:
2081 `<namedCollection name="minimal-environment"/>`.
2082
2083 <packages><collectionModule>
2084 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2085 .. code:: xml
2086
2087 <packages type="bootstrap">
2088 <collectionModule name="module" stream="stream" enable="true|false"/>
2089 </packages>
2090
2091 In CentOS Stream >= 8 and Red Hat Enterprise Linux >= 8, there are
2092 Application Streams that are offered in the form of modules
2093 (using Fedora Modularity technology). To build images that use
2094 this content, {kiwi} offers to enable/disable modules when using
2095 the `dnf` or `microdnf` package manager backend. Modules are set up
2096 prior to the bootstrap phase, and their setup persists as part of the
2097 image.
2098
2099 There are the following constraints when adding `collectionModule`
2100 elements:
2101
2102 * `collectionModule` elements can only be specified as part of the
2103 `<packages type="bootstrap">` section. This is because the setup of
2104 modules must be done once and as early as possible in the process
2105 of installing the image root tree.
2106
2107 * Disabling a module can only be done as a whole, and therefore, the
2108 `stream` attribute is not allowed for disabling modules. For
2109 enabling modules, the `stream` attribute is optional.
2110
2111 * The `enable` attribute is mandatory because it should be an explicit
2112 setting if a module is effectively used or not.
2113
2114 <packages><file>
2115 ~~~~~~~~~~~~~~~~~~~
2116 .. code:: xml
2117
2118 <packages type="image">
2119 <file name="name"/>
2120 </packages>
2121
2122 The `file` element takes the `name` attribute and looks up the
2123 given name as a file on the system. If specified as a relative path, {kiwi}
2124 looks up the name in the image description directory. The file
2125 is installed using the `rsync` program. The file element has the
2126 following optional attributes:
2127
2128 owner="user:group"
2129 The `owner` attribute can be specified to make the file
2130 belong to the specified owner and group. The ownership of
2131 the original file is meaningless in this case. The provided
2132 value is passed along to the `chown` program.
2133
2134 permissions="perms"
2135 The `permissions` attribute can be specified to store the file
2136 with the provided permission. The permission bits of the original
2137 file are meaningless in this case. The provided value is passed
2138 along to the `chmod` program.
2139
2140 target="some/path"
2141 The `target` attribute can be used to specify a target path to
2142 install the file to the specified directory and name. Eventually,
2143 missing parent directories will be created.
2144
2145 <packages><archive>
2146 ~~~~~~~~~~~~~~~~~~~
2147 .. code:: xml
2148
2149 <packages type="image">
2150 <archive name="name" target_dir="some/path"/>
2151 </packages>
2152
2153 The `archive` element takes the `name` attribute and looks up the
2154 given name as a file on the system. If specified as a relative path, {kiwi}
2155 looks up the name in the image description directory. The archive
2156 is installed using the `tar` program. Thus, the file name is
2157 expected to be a tar archive. The compression of the archive is
2158 detected automatically by the tar program. The optional `target_dir`
2159 attribute can be used to specify a target directory to unpack the
2160 archive inside the image root tree. The optional `bootinclude` attribute
2161 additionally unpacks the archive into the {kiwi} initrd.
2162
2163 <packages><ignore>
2164 ~~~~~~~~~~~~~~~~~~
2165 .. code:: xml
2166
2167 <packages type="image">
2168 <ignore name="name"/>
2169 </packages>
2170
2171 The `ignore` element instructs the used package manager to ignore the
2172 given package name at installation time. Please note whether or not
2173 the package can be ignored is up to the package manager. Packages
2174 that are hard-required by other packages in the install procedure
2175 cannot be ignored, and the package manager will simply ignore the
2176 request.
2177
2178 <packages><product>
2179 ~~~~~~~~~~~~~~~~~~~
2180 .. code:: xml
2181
2182 <packages type="image">
2183 <product name="name"/>
2184 </packages>
2185
2186 The `product` element instructs the used package manager to install
2187 the given product. What the installation of a product means is up to
2188 the package manager and is also distribution-specific. This feature
2189 currently only works on SUSE-based distributions.
2190
2191 .. _sec.users:
2192
2193 <users>
2194 --------
2195
2196 Set up image users.
2197
2198 .. code:: xml
2199
2200 <users arch="arch">
2201 <user
2202 name="user"
2203 groups="group_list"
2204 home="dir"
2205 id="number"
2206 password="text"
2207 pwdformat="encrypted|plain"
2208 realname="name"
2209 shell="path"
2210 />
2211 </users>
2212
2213 The optional `users` element contains the user setup {kiwi} should create
2214 in the system. The optional `arch` attribute can be used to limit the
2215 user's setup to the host architecture from which {kiwi} is called.
2216 At least one user child element must be specified as part of the `users`
2217 element. Multiple user elements may be specified.
2218
2219 Each `user` element represents a specific user that is added or
2220 modified. The following attributes are mandatory:
2221
2222 name="name":
2223 the UNIX username.
2224
2225 password="string"
2226 The password for this user account. It can be provided either
2227 in cleartext form or encrypted. An encrypted password can be created
2228 using `openssl` as follows:
2229
2230 .. code::
2231
2232 $ openssl passwd -1 -salt xyz PASSWORD
2233
2234 It is also possible to specify the password as a non-encrypted string
2235 by using the `pwdformat` attribute and setting its value to `plain`.
2236 {kiwi} will then encrypt the password prior to the user being added
2237 to the system.
2238
2239 .. warning:: plain text passwords
2240
2241 We do not recommend plain passwords, as they will be readable in
2242 the image configuration in plain text.
2243
2244 All specified users and groups will be created if they do not already
2245 exist. The defined users will be part of the group(s) specified
2246 with the `groups` attribute or belong to the default group as configured
2247 in the system. If specified, the first entry in the groups list is used
2248 as the login group.
2249
2250 Additionally, the following optional attributes can be specified:
2251
2252 home="path":
2253 The path to the user's home directory.
2254
2255 groups="group_a,group_b,group_c:id":
2256 A comma-separated list of UNIX groups. The first element of the
2257 list is used as the user's primary group. The remaining elements are
2258 appended to the user's supplementary groups. When no groups are assigned,
2259 then the system's default primary group will be used. If a group should
2260 be of a specific group ID, it can be appended to the name, separated by
2261 a colon.
2262
2263 .. note::
2264
2265 Group IDs can only be set for groups that do not yet exist at
2266 the time when {kiwi} creates them. A check is made if the desired
2267 group is already present, and if it exists, the user will become a
2268 member of that group, but any given group ID from the {kiwi}
2269 configuration will **not** be taken into account. Usually, all
2270 standard system groups are affected by this behavior because they
2271 are provided by the OS itself. Thus, it's by intention not possible
2272 to overwrite the group ID of an existing group.
2273
2274 id="number":
2275 The numeric user ID of this account.
2276
2277 pwdformat="plain|encrypted":
2278 The format in which `password` is provided. The default, if not
2279 specified, is `encrypted`.
2280
2281 realname="string":
2282 The full name of the user, stored in the GECOS field.
2283
2284 shell="path":
2285 The login shell for this account.
2286
2287 The `users` element itself accepts the optional `arch` and `profiles`
2288 attributes to restrict a whole group of accounts to a given host
2289 architecture or set of build profiles.
2290
2291 .. _sec.drivers:
2292
2293 <drivers>
2294 ---------
2295
2296 .. code:: xml
2297
2298 <drivers>
2299 <file name="crypto/*"/>
2300 </drivers>
2301
2302 Lists kernel driver modules to include in the {kiwi} initrd. Each `file`
2303 child element takes a `name` attribute holding a path relative to the
2304 kernel module directory (shell globs are supported). The `drivers` element
2305 accepts the optional `profiles` attribute and may be provided multiple times.
2306
2307 .. _sec.strip:
2308
2309 <strip>
2310 -------
2311
2312 .. code:: xml
2313
2314 <strip type="delete">
2315 <file name="/usr/share/doc"/>
2316 </strip>
2317
2318 Lists files to remove from, or to keep in, the image root tree. The
2319 mandatory `type` attribute selects the meaning of the `file` children:
2320
2321 type="delete"
2322 A list of custom files and directories to delete.
2323
2324 type="tools"
2325 A list of file names in the Linux `bin` and `sbin` directories to keep;
2326 everything else is removed.
2327
2328 type="libs"
2329 A list of file names in the Linux library directories to keep;
2330 everything else is removed.
2331
2332 The element accepts the optional `profiles` attribute and may be supplied
2333 multiple times.
2334
2335 .. _sec.extension:
2336
2337 <extension>
2338 -----------
2339
2340 An optional container for namespaced XML belonging to a {kiwi} plugin. Each
2341 XML namespace may appear at most once, and its content is validated against
2342 an external RELAX NG schema resolved through the XML catalog. See
2343 :doc:`../contributing/schema_extensions` for how to register and consume one.
2344
2345 .. _sec.profiles:
2346
2347 <profiles>
2348 -----------
2349
2350 Manage image namespace(s).
2351
2352 .. code:: xml
2353
2354 <profiles>
2355 <profile name="profile_name" description="text" arch="arch_name"/>
2356 </profiles>
2357
2358 The optional profiles section lets you maintain one image description
2359 while allowing for variation of other sections that are included. A
2360 separate profile element must be specified for each variation. The
2361 profile child element specifies an alias name used to mark sections as
2362 belonging to a profile, and a short description explaining what this profile
2363 does. Both `name` and `description` are **mandatory**. Two further attributes
2364 are optional:
2365
2366 import="true|false"
2367 Select this profile automatically when no profile was given on the
2368 command line. If any profile is passed via `--profile`, `import` is
2369 ignored entirely and only the profiles named on the command line plus
2370 their transitive `requires` are used.
2371
2372 arch="arch_name"
2373 Limit this profile to the listed host architectures.
2374
2375 A profile can require other profiles, and the required profiles will
2376 be evaluated in the order of their declaration. The optional arch
2377 attribute can be used to limit the profile and required profiles
2378 to a certain architecture. For example:
2379
2380 .. code:: xml
2381
2382 <profile name="A" description="Some A" arch="x86_64,s390x">
2383 <requires profile="B"/>
2384 <requires profile="C" arch="s390x"/>
2385 </profile>
2386
2387 For example, to mark a set of packages as belonging to a profile, simply
2388 annotate them with the profiles attribute, as shown below:
2389
2390 .. code:: xml
2391
2392 <packages type="image" profiles="profile_name">
2393 <package name="name"/>
2394 </packages>
2395
2396 It is also possible to mark sections as belonging to multiple profiles
2397 by separating the names in the profiles attribute with a comma:
2398
2399 .. code:: xml
2400
2401 <packages type="image" profiles="profile_A,profile_B">
2402 <package name="name"/>
2403 </packages>
2404
2405 If a section tag does not have a profiles attribute, it is globally
2406 present in the configuration. If global sections and profiled sections
2407 contain the same sub-sections, the profiled sections will overwrite
2408 the global sections in the order of the provided profiles. For a better
2409 overview of the result configuration when profiles are used we
2410 recommend to put data that applies in any case to non profiled (global)
2411 sections and only extend those global sections with profiled data.
2412 For example:
2413
2414 .. code:: xml
2415
2416 <preferences>
2417 <version>1.2.3</version>
2418 <packagemanager>zypper</packagemanager>
2419 </preferences>
2420
2421 <preferences profiles="oem_qcow_format">
2422 <type image="oem" filesystem="ext4" format="qcow2"/>
2423 </preferences>
2424
2425 <preferences profiles="oem_vmdk_format">
2426 <type image="oem" filesystem="ext4" format="vmdk"/>
2427 </preferences>
2428
2429 The above example configures two versions of the same oem type.
2430 One builds a disk in qcow2 format the other builds a disk in
2431 vmdk format. The global preferences section without a profile
2432 assigned will be used in any case and defines those preferences
2433 settings that are common to any build process. A user can
2434 select both profiles at a time but that will result in building
2435 the disk format that is specified last because one is overwriting
2436 the other.
2437
2438 Use of one or more profile(s) during image generation is triggered
2439 by the use of the ``--profile`` command line argument. Multiple profiles
2440 can be selected by passing this option multiple times.