Debian Codegraph @

doc/source/image_description/elements.rst

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