| 1 |
.. _repositories: |
| 2 |
|
| 3 |
Setting up Repositories |
| 4 |
======================= |
| 5 |
|
| 6 |
The repository selection is a crucial part of an appliance. {kiwi} allows the |
| 7 |
end user to customize the selection of repositories and packages via |
| 8 |
the `repository` element. |
| 9 |
|
| 10 |
Adding repositories |
| 11 |
------------------- |
| 12 |
|
| 13 |
{kiwi} installs packages into an appliance from the repositories defined in |
| 14 |
the image description. This means that at least one repository **must** be |
| 15 |
defined. Otherwise, {kiwi} cannot fetch any packages. |
| 16 |
|
| 17 |
A repository is added to the description via the `repository` element, |
| 18 |
which is a child of the top-level `image` element: |
| 19 |
|
| 20 |
.. code:: xml |
| 21 |
|
| 22 |
<image schemaversion="{schema_version}" name="{exc_image_base_name}"> |
| 23 |
<!-- snip --> |
| 24 |
<repository type="rpm-md" alias="kiwi" priority="1"> |
| 25 |
<source path="{exc_kiwi_repo}"/> |
| 26 |
</repository> |
| 27 |
<repository type="rpm-md" alias="OS" imageinclude="true"> |
| 28 |
<source path="{exc_repo_obs}"/> |
| 29 |
</repository> |
| 30 |
</image> |
| 31 |
|
| 32 |
The above example specifies two repositories: |
| 33 |
|
| 34 |
1. The repository belonging to the {kiwi} project: |
| 35 |
*{exc_kiwi_repo}* at the Open Build Service (OBS). |
| 36 |
|
| 37 |
2. The RPM repository belonging to the OS project: |
| 38 |
*{exc_repo_obs}* at the Open Build Service (OBS). The translated |
| 39 |
HTTP URL is also included in the final appliance. |
| 40 |
|
| 41 |
The `repository` element accepts one `source` child element that |
| 42 |
contains the URL of the repository in a correct format, along with the |
| 43 |
following optional attributes: |
| 44 |
|
| 45 |
- `imageinclude`: Specifies whether the repository should be added to the |
| 46 |
resulting image. The default is false. |
| 47 |
|
| 48 |
- `imageonly`: A repository with `imageonly="true"` is not available |
| 49 |
during the image build but is present in the resulting appliance. The default is |
| 50 |
false. |
| 51 |
|
| 52 |
- `priority`: An integer value for all packages in this repository. If |
| 53 |
the same package is available in more than one repository, then the one |
| 54 |
with the highest priority is used. |
| 55 |
|
| 56 |
- `alias`: Name to use for the repository. It appears as the repository's name |
| 57 |
in the image, visible via `zypper repos` or `dnf repolist`. If `alias` is |
| 58 |
not specified, {kiwi} generates an alias name using a hex representation from |
| 59 |
uuid4. |
| 60 |
|
| 61 |
- `repository_gpgcheck`: Specifies whether or not this specific repository |
| 62 |
values the result of the repository signature validation. |
| 63 |
The default value is `false`. |
| 64 |
|
| 65 |
- `package_gpgcheck`: Specifies whether or not this specific repository |
| 66 |
values the result of the package signature validation for each |
| 67 |
package taken from this repository. The default value is `false`. |
| 68 |
|
| 69 |
- `components`: Distribution components used for `deb` repositories. The default is `main`. |
| 70 |
|
| 71 |
- `distribution`: Distribution name information, used for `deb` repositories. |
| 72 |
|
| 73 |
- `profiles`: List of profiles to which this repository applies. |
| 74 |
|
| 75 |
- `customize`: A script to run custom modifications to the repo file or files. |
| 76 |
Repo files allow for several customization options, but not all of them |
| 77 |
are supported to be set by kiwi through the current repository schema. |
| 78 |
As the used options do not follow any standard, and they are not compatible |
| 79 |
between package managers and distributions, the only way to handle |
| 80 |
this is through a script hook that is invoked with the repo file as a |
| 81 |
parameter for each file created by {kiwi}. |
| 82 |
|
| 83 |
An example for a script call to add the `module_hotfixes` option |
| 84 |
for a `dnf`-compatible repository configuration could look as follows: |
| 85 |
|
| 86 |
.. code:: bash |
| 87 |
|
| 88 |
repo_file=$1 |
| 89 |
echo 'module_hotfixes = 1' >> ${repo_file} |
| 90 |
|
| 91 |
.. note:: |
| 92 |
|
| 93 |
If the script is provided as a relative path, it is expected to be found |
| 94 |
in the image description directory. |
| 95 |
|
| 96 |
.. _supported-repository-paths: |
| 97 |
|
| 98 |
Supported repository paths |
| 99 |
^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 100 |
|
| 101 |
The actual location of a repository is specified in the `source` child |
| 102 |
element of `repository` via its only attribute, `path`. {kiwi} supports the |
| 103 |
following path types: |
| 104 |
|
| 105 |
- `http://URL` or `https://URL` or `ftp://URL`: a URL to the repository |
| 106 |
available via HTTP(S) or FTP. |
| 107 |
|
| 108 |
- `obs://$PROJECT/$REPOSITORY`: checks whether the repository `$REPOSITORY` |
| 109 |
of the project `$PROJECT` is available on the Open Build Service (OBS). By |
| 110 |
default, {kiwi} looks for projects on `build.opensuse.org |
| 111 |
<https://build.opensuse.org>`_, but this can be overridden using the |
| 112 |
runtime configuration file (see :ref:`runtime_config`). |
| 113 |
Note that it is not possible to add repositories using the `obs://` path |
| 114 |
from **different** OBS instances (use direct URLs to the :file:`.repo` |
| 115 |
file instead in this case). |
| 116 |
|
| 117 |
- `obsrepositories:/`: a special path only available for builds using the Open |
| 118 |
Build Service. The repositories configured for the OBS project where the |
| 119 |
{kiwi} image resides are made available inside the appliance. This allows you |
| 120 |
to configure the repositories of your image from OBS itself, without modifying |
| 121 |
the image description. |
| 122 |
|
| 123 |
- `dir:///path/to/directory` or `file:///path/to/file`: an absolute path to |
| 124 |
a local directory or file available on the host building the |
| 125 |
appliance. |