Setting up the Build Host
Host Requirements
Building an image needs tools on the build host which depend on the
image type, for example tools to create partition tables and
filesystems for a disk image. The kiwi-systemdeps packages, built from
the python-kiwi package, install these tools. Install the package for
the image type to build; the packages it requires are installed as
well:
The kiwi-systemdeps packages and their requirements.
- Diagram description:
The package
kiwi-systemdepsrequires all otherkiwi-systemdepspackages except for-boxbuildand-stackbuild.-disk-imagesrequires-iso-media, which requires-filesystemsand-bootloaders, which both require-core.-stackbuildrequires-containers.-containers-wsl,-image-validationand-boxbuilddo not require otherkiwi-systemdepspackages.
Package |
Builds |
Installs |
|---|---|---|
|
|
The package managers supported by the distribution and |
|
|
The tool chain to build OCI-compliant container images. |
|
|
The tool chain to build WSL container images. |
|
|
The tools to create the filesystems supported by KIWI NG, and to manage loop devices, partition tables, LVM and LUKS. |
|
Bootable |
The bootloader tools of the host architecture. |
|
|
The tools to create ISO filesystems. |
|
|
The QEMU tools to create virtual disks. |
|
Any image type |
|
|
Images via |
The QEMU/KVM tool chain to run the build box, see Building in a Self-Contained Environment. |
|
Images via |
|
To build every image type, install the package kiwi-systemdeps. This
pulls in a large number of packages, as the required tools have
dependencies of their own, for example Java for jing.
Tip
With the kiwi-boxbuild tool, the build host only needs podman,
see Building with kiwi-boxbuild.
The Runtime Configuration File
Settings of KIWI NG itself, which do not belong into an image description and should persist across calls, are stored in a runtime configuration file in YAML format. KIWI NG reads all of the following files which exist, in this order, and merges them. Later files take precedence:
/usr/share/kiwi/kiwi.yml, the vendor settings/usr/share/kiwi/kiwi.yml.d/*.yml, in alphabetical order/etc/kiwi.yml, the administrator settings/etc/kiwi.yml.d/*.yml, in alphabetical order~/.config/kiwi/config.yml, the user settingsthe file passed with the global
--configoption
The drop-in directories are read whether or not the corresponding main
file exists. The files are merged key by key: a later file only needs
to contain the keys it changes, lists are combined without duplicates.
For example, with the following two files the effective shasum_size
is "256", and compress stays true:
# /usr/share/kiwi/kiwi.yml
bundle:
compress: true
shasum_size: "512"
# /etc/kiwi.yml.d/10-local.yml
bundle:
shasum_size: "256"
All available settings with a short description are listed in
/usr/share/kiwi/kiwi.yml.example, provided by the python3-kiwi
package.
The sparse data sync
The sparse setting of the sync section turns runs of null bytes into
holes when KIWI NG syncs data, for example when it installs the image
payload into the image filesystem. It is off by default and applies to
every data sync of KIWI NG.
It saves space if the data contains many null runs. This is the case, for example, for a distribution compiled for a larger page size, such as ARM 64K kernels, which leaves zero tails between the segments of ELF binaries. How much space is saved depends on the filesystem:
ext4andbtrfskeep the holes.xfskeeps the holes only with mount options against its speculative preallocation. KIWI NG applies them to the mount at install time only, they do not become mount options of the system.Compressing read-only filesystems,
squashfsanderofs, gain nothing, as the compression already removes the null runs.In encrypted images the filesystem uses less space, but the image file does not get smaller, as KIWI NG fills the device with random data before it creates the filesystem. With
luks_randomize="false"the image file gets smaller as well.
Sparse files can fragment the filesystem and the image file. Enable the setting only if your image gains from it.