| 1 |
.. _kis: |
| 2 |
|
| 3 |
Build KIS Image (Kernel, Initrd, System) |
| 4 |
======================================== |
| 5 |
|
| 6 |
.. sidebar:: Abstract |
| 7 |
|
| 8 |
This page explains how to build an image that consists |
| 9 |
of three components: the kernel, an initrd, and an |
| 10 |
optional root filesystem image. In {kiwi} terminology, |
| 11 |
this type of image is called KIS. |
| 12 |
|
| 13 |
A KIS image is a collection of image components that are not |
| 14 |
associated with a dedicated use case. This means that as far as {kiwi} |
| 15 |
is concerned, it is not known in which environment these components |
| 16 |
are expected to be used. The predecessor of this image type was called |
| 17 |
`pxe` under the assumption that the components will be used |
| 18 |
in a PXE boot environment. However, this assumption is not |
| 19 |
always true, and the image components may be used in different |
| 20 |
ways. Because there are so many possible deployment strategies |
| 21 |
for a `kernel` plus `initrd` and an optional `system root filesystem`, |
| 22 |
{kiwi} provides this as the universal `KIS` type. |
| 23 |
|
| 24 |
The former `pxe` image type still exists, but it is expected |
| 25 |
to be used only in combination with the legacy `netboot` infrastructure, |
| 26 |
as described in :ref:`build_legacy_pxe`. |
| 27 |
|
| 28 |
To add a KIS build to an appliance, create a `type` element with |
| 29 |
`image` set to `kis` in :file:`config.xml`, as shown below: |
| 30 |
|
| 31 |
.. code:: xml |
| 32 |
|
| 33 |
<preferences> |
| 34 |
<type image="kis"/> |
| 35 |
</preferences> |
| 36 |
|
| 37 |
With this image type setup, {kiwi} builds a kernel and initrd |
| 38 |
not associated with any system root filesystem. Normally, such |
| 39 |
an image is only useful with certain custom dracut extensions |
| 40 |
as part of the image description. |
| 41 |
|
| 42 |
The following attributes of the `type` element are often used when |
| 43 |
building KIS images: |
| 44 |
|
| 45 |
- `archive`: By default the output files of a KIS image will be stored |
| 46 |
in a tarball archive. If you want to store the output files |
| 47 |
individually instead, set this attribute to `false`. |
| 48 |
|
| 49 |
- `compressed`: Specifies whether the root filesystem image should be |
| 50 |
xz-compressed. If set to `true`, the tar archive that contains the |
| 51 |
output files is not compressed again; otherwise, the tar archive is |
| 52 |
xz-compressed. If the `archive` attribute is set to `false`, only the |
| 53 |
compression of the root filesystem image applies. |
| 54 |
|
| 55 |
- `filesystem`: Specifies the root filesystem and triggers the build |
| 56 |
of an additional filesystem image of that filesystem. The generated |
| 57 |
kernel command-line options file (append file) will then also |
| 58 |
include a `root=` parameter that references this filesystem image's UUID. |
| 59 |
Whether the information from the append file should be used or not is |
| 60 |
optional. |
| 61 |
|
| 62 |
- `kernelcmdline`: Specifies kernel command-line options that are |
| 63 |
part of the generated kernel command-line options file (append file). |
| 64 |
By default, the append file contains no information other than the |
| 65 |
reference to the root UUID if the `filesystem` attribute is used. |
| 66 |
|
| 67 |
All other attributes of the `type` element that apply to an optional |
| 68 |
root filesystem image remain in effect in the system image of a KIS |
| 69 |
image as well. |
| 70 |
|
| 71 |
With the appropriate settings present in :file:`config.xml`, you can use {kiwi} to |
| 72 |
build the image: |
| 73 |
|
| 74 |
.. code:: bash |
| 75 |
|
| 76 |
$ sudo kiwi-ng --type kis system build \ |
| 77 |
--description kiwi/build-tests/{exc_description_kis} \ |
| 78 |
--set-repo {exc_repo_tumbleweed} \ |
| 79 |
--target-dir /tmp/myimage |
| 80 |
|
| 81 |
The resulting image components are saved in :file:`/tmp/myimage`. |
| 82 |
Outside of a deployment infrastructure, the example KIS image can be |
| 83 |
tested with QEMU as follows: |
| 84 |
|
| 85 |
.. code:: bash |
| 86 |
|
| 87 |
$ sudo qemu \ |
| 88 |
-kernel /tmp/myimage/*.kernel \ |
| 89 |
-initrd /tmp/myimage/*.initrd \ |
| 90 |
-append "$(cat /tmp/myimage/*.append) rw" \ |
| 91 |
-drive file=/tmp/myimage/{exc_image_base_name_kis}.x86_64-{exc_image_version_kis},if=virtio,driver=raw \ |
| 92 |
-serial stdio |
| 93 |
|
| 94 |
.. note:: |
| 95 |
|
| 96 |
Testing the components of a KIS image normally requires a deployment |
| 97 |
infrastructure and a deployment process encoded in the initrd. An example |
| 98 |
of a deployment infrastructure using PXE is provided by {kiwi} with |
| 99 |
the `netboot` infrastructure. However, that netboot infrastructure is |
| 100 |
no longer developed and is only kept for compatibility reasons. |
| 101 |
For details, see :ref:`build_legacy_pxe`. |