Commit Graph

79 Commits

Author SHA1 Message Date
Marcus Schäfer
1385187ccf
Allow ignore stanza in bootstrap
So far the <ignore> stanza was only effective when placed
as part of the type="image" packages section. This commit
allows to place it also to the type="bootstrap" packages.
This Fixes #2499
2024-03-22 10:33:04 +01:00
Marcus Schäfer
f5d2683776
Update unit test data to schema v8.0 2024-01-11 09:46:23 +01:00
Marcus Schäfer
b7bf4099b6
Support release version in signkey URLs
Using one of the $releasever/${releasever} variable placeholders
in an URL as part of a <signing key="..."/> element did not replace
the placeholder with the value of the <release-version> element.
This commit fixes this and also makes sure that the result list
for downloading signing keys is unique. This Fixes #2381
2023-10-16 09:23:42 +02:00
Marcus Schäfer
7ac14458af Refactor the luks_device class data transport
Also add missing unit tests
2023-07-05 12:30:38 +02:00
Marcus Schäfer
ae6effd5de
Change package manager dnf to dnf4
With dnf5 there is a successor for dnf but there will also
be a transition period where there will be both, the former
dnf and the new dnf5 available. For a clear distinction
between the two we got the recommendation from the RedHat
team to support both in different namespaces. This commit
now implements a backward compatible change for kiwi which
includes the following modifications:

* XSL stylesheet for automatic schema transformation from

  <packagemanager>dnf</packagemanager> to
  <packagemanager>dnf4</packagemanager>

* Code copy of dnf API interface from

  PackageManagerDnf -> PackageManagerDnf4
  RepositoryDnf -> RepositoryDnf4

* Deprecation of former Dnf API interface

The code change here will force developers to adapt
their code if they used RepositoryDnf / PackageManagerDnf
classes in their python code. After this change developers
will be dropped into a raise condition which exits kiwi
at the time of the call. Related to Issue #2300
and Issue #2262
2023-06-12 17:44:06 +02:00
Robert Schweikert
ef35bef97b
Support new bootloadersettings section
Allow to specify an optional <bootloadersettings> element
inside of the <bootloader> section. The information is used to
specify custom arguments for the tools called in a bootloader
setup procedure, e.g shim-install, grub-install or grub-mkconfig.
kiwi does not judge on the given parameters and if the provided
data is effectively used depends on the individual bootloader
implementation. In this commit the data will be effectively
handled if bootloader="grub2" is configured. More precisely
the custom additions to support SUSE's TPM model with grub2
can be configured as follows:

<bootloadersettings>
    <shimoption name="--suse-enable-tpm"/>
    <installoption name="--suse-enable-tpm"/>
    <configoption name="--set-trusted-boot"/>
</bootloadersettings>

This Fixes #2224
2023-02-22 23:27:19 +01:00
Marcus Schäfer
04d966b920
Add support for group id in users setting
Allow to specify the group id in the groups list a user
should belong to. The group id can be placed as part of
the group name separated by a colon like in the following
example:

<users>
    <user groups="kiwi,admin:42,users" password="..." name="kiwi"/>
</users>

Please note kiwi checks if the provided group already
exists and only creates a group if it is not already present in
the system. As default groups are usually provided by the OS
itself including its preferred group id, you will intentionally
not be able to overwrite group id for existing groups.
This Fixes #2064
2022-05-20 19:23:22 +02:00
Marcus Schäfer
c30ac9f1fb
Handle LUKS type in its own attribute 2022-03-21 23:28:22 +01:00
Marcus Schäfer
74ad1e5744
Allow luks format options
Added new luksformat element which allows to pass
along options to the luksFormat call. This allows users to
switch between LUKS and LUKS2 via e.g

    <luksformat>
        <option name="--type" value="luks2"/>
    </luksformat>

It also allows to pass along a set of options only available
to LUKS2, e.g

    <luksformat>
        <option name="--type" value="luks2"/>
        <option name="--cipher" value="aes-gcm-random"/>
        <option name="--integrity" value="aead"/>
    </luksformat>

In addition to the new attribute the existing luks attribute
can also be specified to read credentials from a keyfile by
using the file:// source locator, e.g

    <type ... luks="file:///path/to/a/keyfile"/>

This Fixes #1898
2022-03-21 21:40:35 +01:00
Marcus Schäfer
4e63703f70
Update descriptions to schema v7.5 2022-03-09 18:19:31 +01:00
David Cassany
332d60f777
Support additional names for docker containers
Docker containers used to support the attribute `additionaltags` which
was used to provide multiple tags for the same image. Since only tags
were supported this commit renames the attribute to `additionalnames`
and now supports tags and names witht he following syntax:

* '<name>:<tag>' -> adds a full docker image reference including name
  and tag
* ':<tag>'       -> adds an additional tag while reusing the former name
* '<name>'       -> adds an additional name while reusing the former tag

Fixes #2045

Signed-off-by: David Cassany <dcassany@suse.com>
2022-03-09 18:19:31 +01:00
Marcus Schäfer
e2f32e8c8a
Added support for collection modules
In CentOS Stream 8 and Red Hat Enterprise Linux 8, there are
Application Streams that are offered in the form of modules
(using Fedora Modularity technology). To build images that use
this content KIWI needs to support to enable/disable various
modules. This commit allows to configure collection modules
in a new element as shown below

<packages type="bootstrap">
    <collectionModule name="module" stream="stream" enable="true|false"/>
</packages>

This Fixes Issue #1999
2021-12-14 22:55:05 +01:00
Marcus Schäfer
7e3297d9d3
Added support for setting up release version
Currently the release version is not set or set to '0'
for package managers which requires a value to operate.
However, in order to support leveraging the same description
across different releases it is important to have the
opportunity to specify a setting for the release version.
This commit adds a new optional attribute to the preferences
section which allows to specify a custom value which
serves as the release version:

<preferences>
    <release-version>TEXT</release-version>
</preferences>

If not specified the default setting as before applies.
Please note the release version information is currently
used in dnf and microdnf package managers only. It might
happen that it gets applied to the other package manager
backends as well. This will happen on demand though.
Related to Issue #1918. This Fixes #1927
2021-12-06 09:54:41 +01:00
David Cassany
7b14694093
Force key attribute from signing element to be treated as a URI
Signed-off-by: David Cassany <dcassany@suse.com>
2021-11-19 13:29:52 +01:00
Marcus Schäfer
350ed05454 Allow to set sign keyfile in repository elements
This commit adds a new and optional child element <signing>
to the repository/source element as shown in the following
example:

<repository>
    <source path="...">
        <signing key="keyfile"/>
    </source>
</repository>

The collection of all keyfiles from all repositories will be
added to the keyring as used by the selected package manager.
Signing keys specified on the commandline and signing keys
specified in the image description will be combined.
This Fixes #1883
2021-11-16 10:15:46 -05:00
Marcus Schäfer
e3e0d888c8
Added support for repo customization script
repo files allows for several customization options
which could not be set by kiwi through the current
repository schema. As the options used do not follow
any standard and are not compatible between package
managers and distributions the only generic way to
handle this is through a script which is invoked
with the repo file as parameter for each file created
to describe a repo for the selected package manager.
This allows users to update/change the repo file content
on their individual needs. In the kiwi description the
path to the custom script can be specified as follows

    <repository ... customize="/path/to/custom_script">
        <source path="..."/>
    </repository>

This Fixes #1896
2021-08-10 10:10:01 +02:00
Marcus Schäfer
47d48c1a89
Update unit- integration tests to schema v74 2021-03-15 16:13:02 +01:00
David Cassany
43bec23db2
Add the schematron rules for installinitrd
This commit adds an schematron rule to limit the presence of
installinitrd element to disk builds including installation media.
2021-01-26 22:21:31 +01:00
David Cassany
6366624ef1
Add the installinitrd element
This commit adds the `<installinitrd>` element in kiwi schema to
facilitate the dracut modules configuration for the installation initrds
on OEM images. Within installinitrd element is possible list the dracut
modules to append, to omit or to just set an static list of dracut
modules to include.

Fixes #1676
Fixes #1683
2021-01-21 16:33:43 +01:00
David Cassany
a01b83a361
Add 'arch' attribute to preferences
This commits adds the attribute 'arch' to preferences. It works
as any other 'arch' attribute within the schema. Preferences defined
with architectures that do not match the host are ignored. If no 'arch'
is provided it matches all any host architecture.

Fixes #1640
2020-12-16 14:00:24 +01:00
Marcus Schäfer
7957374de2
Allow to customize swap volume name
Added a new element <oem-swapname> below the <oemconfig>
section which allows to specify a name for the swap volume
in case the LVM volume manager is used. The default if
not specified continuous to stay at: LVSwap. This
Fixes #1638
2020-12-11 13:13:03 +01:00
Marcus Schäfer
8d2d9c214c
Make oem be a superset of vmx
A vmx image is the same disk as an oem just without the dracut
repart/resize feature. This difference is better handled with
an oemconfig parameter <oem-resize> which allows to switch resize
on or off. The extra image type vmx will be dropped and an XSLT
stylesheet automatically transforms a vmx description to be a
oem image with the resize feature switched off.
This Fixes #1425
2020-09-16 12:56:14 +02:00
Marcus Schäfer
feaf6b0863
Refactor setup of bootloader parameters
The bootloader settings are handled through attributes in the
type element. Over the years some attributes were added and
there are requests for more settings. Therefore the bootloader
setup deservers its own section. With this commit the schema
changes from v7.1 to v7.2 and moves bootloader, bootloader_console
boottimeout and zipl_targettype into a new bootloader subsection
below type. The commit also adds an auto transformation template
such that customers don't have to change their image descriptions.
This is related to Issue #1401
2020-05-08 13:30:43 +02:00
Marcus Schäfer
44a1d78e96
Added new image type: wsl
Support for building appx container images for
Windows Subsystem Linux (WSL). This Fixes #1235
2020-03-26 19:42:25 +01:00
Marcus Schäfer
04b345e7aa
Added support for spare partition fs attributes
Added new type attribute:

```xml
<type ... spare_part_fs_attributes="..."/>
```

which can be a comma separated list of the following currently
supported filesystem attributes:

* no-copy-on-write
* synchronous-updates

See chattr and filesystem manual pages for details on those
attributes. More attributes for the spare part context can be
added on request. This Fixes #1233
2020-01-15 16:15:48 +01:00
Marcus Schäfer
ca75086128
Prevent swap partition to be the last one
In an OEM deployment that requested the creation of a swap
partition via <oem-swap> that swap partition was created
at first boot and was always the last partition on the disk.
This was required because it could not be placed before
any other partition without destroying those partition
contents. This process leaves the system in an inflexible
condition if the storage device can change its geometry
dynamicly as it's the case for SAN systems. The typical
deployment target for OEM images are SAN storage clusters
and it's cumbersome to resize the root partition if swap
is last.

This commit Fixes #1231 and changes the handling of swap if
requested via <oem-swap> as follows:

1. The swap space is created as part of the image build process
   and no longer on first boot of the image via dracut code.
   This increases the size of the non compressed .raw disk image
   by the configured swap space size or the default. The
   compressed versions are not affected since zero initialized
   swap space compresses to almost no space. Deployment of
   the image however also deploys the swap partition which
   increases deployment time. For big swap configurations
   it's advisable to switch off image verification via
   oem-skip-verify. For very big swap configurations it's
   also recommended to prevent kiwi from adding them as part
   of the image and let them be created on first boot via
   a systemd service that e.g places a swap file, or creates
   a swap volume when possible such that the fexibility to
   resize the rootfs is still available.

2. The setup of the swap space is now explicit. It's no longer
   calculated by twice times RAM size because on newer machines
   this could lead to huge numbers. Either the kiwi encoded
   default swap size applies or the user configured value.

3. LVM based oem disks creates the swap space as logical volume.
   The volume is created as part of the image build process
   and no longer on first boot. The swap volume at build time
   of the image is of a minimal size and gets resized on first
   boot.

4. The move of the swap creation into the builder code also
   handles swap per configured device persistency schema like
   any other devices. This means by default swap is mounted
   via by-uuid name and thus also Fixes #1259
2019-11-25 12:05:57 +01:00
David Cassany
80e791d2ef
Make home attribute optional on users definition
This commit makes home attribute of users definition optional. This way
the home directory is created according to the distribution defaults.
Note that `-m` option is passed to user add, thus the home directory is
requested to be created even without having an explicit home path
defined.

Fixes #1025
2019-10-23 15:57:51 +02:00
Marcus Schäfer
defdc23fcf
Follow up patch for SourceType info
The message that display the selected source type was
using the former metalink text which is wrong. This
patch corrects the message and only display it if a
sourcetype was specified
2019-09-30 16:39:16 +02:00
Marcus Schäfer
30e18d1398
Added support for fscreateoptions attribute
Along with the fsmountoptions attribute there is now also the
fscreateoptions attribute which allows to control the options
used for creating the filesystem. Please note, it's not kiwi's
task to validate that the given option string is supported
by the selected filesystem. This means providing wrong values
here will cause the build to fail at the time the filesystem
gets created. This Fixes #1109
2019-07-18 15:55:39 +02:00
Marcus Schäfer
ab59d4d217
Delete obsolete repository types
Deleted red-carpet, slack-site, up2date-mirrors, urpmi and yast2
from the allowed values list of the repository type attribute.
This Fixes #1029
2019-04-22 23:15:42 +02:00
Marcus Schäfer
4a21fcfb05
Auto upgrade all image descriptions to v7.0 schema 2019-04-05 14:28:55 +02:00
Marcus Schäfer
ed6c11f7d6
Added get_description method to XMLState
In preparation to access the contents of the <description>
section this pull requests adds a simple method to read
the contents.
2019-02-26 15:20:21 +01:00
Marcus Schäfer
f8265bb607
Added new preferences subsection
In the preferences section the following optional subsection
can be configured:

   <rpm-locale-filtering>true|false</rpm-locale-filtering>

If set to true the default locales POSIX, C, and C.UTF-8 are
applied as rpm install_lang macro. If the locale section is
configured in addition the list is extended by that information
too
2019-02-08 16:56:56 +01:00
Marcus Schäfer
fad1c0f1ef
Added support for %_install_langs rpm macro
During the image build the custom rpm macro %_install_langs
is configured with the <locale> setup from the KIWI XML
description. This allows to filter language specific packages
on the rpm level and Fixes #771
2019-02-07 16:05:25 +01:00
David Cassany
f0612486dd
Add history metadata for container builds
This commit adds the history section in contianerconfig. With it
'author', 'created_by' and 'comment' can be customized. In addition
'created' is always included with the image creation date time.
'created_by' entry is set to 'KIWI __version__' by default if nothing
is provided.

Fixes #852
2018-11-08 15:33:04 +01:00
David Cassany
dd21e6c8d7
Add '--add-container-label' flag
This commits adds a command line flag to add a label for container image
types. The flag can be used multiple times.

Fixes #770
2018-07-06 14:11:00 +02:00
David Cassany
87769a3201 Add additionaltags containerconfig attribute
This commit adds `additionaltags` attribute, so multiple tags to
a container image can be defined in a comma separated value.

Fixes #713
2018-05-14 17:04:07 +02:00
David Cassany
f055ac1296 Add uninstall pacakges type
This commit adds a new `uninstall` type for packages. Packages listed
with this type will be removed by the package manager cleaning also any
unneeded dependency. The removal is executed after running `config.sh`.

Also in this commit `delete` type for packages is now executed after
`uninstall` packages, meaing it also happens after `config.sh`.

Fixes #625
2018-05-04 15:00:31 +02:00
David Cassany
9dcf00e4d1 Some improvements on size calculation
This commit simplifies the unpartitioned area size calculation.

Fixes #709 and it is related to fate#323874
2018-04-23 15:45:38 +02:00
David Cassany
74aa8a5c14 Adding unpartitioned size attribute
This commit adds the possibility of setting some unpartitioned area
after the systemdisl partition into the image.

Fixes #709
2018-04-20 17:04:33 +02:00
Marcus Schäfer
4fc38a2b09
XSL Auto update descriptions due to schema change 2018-03-23 09:42:24 +01:00
David Cassany
967bde8385 Add profile dependencies
With this commit the profile can include other profiles as a dependency.
This way it is possible build an image defined by multiple profiles by just
calling a single composed profile from the command line.

Fixes #658
2018-03-12 09:18:54 +01:00
Marcus Schäfer
f304802c53 Auto update all schema descriptions to v6.8 2018-01-17 10:19:37 +01:00
Marcus Schäfer
c1668bcfc5 Added additional required attr schematron rule
The new rule allows to check for required attributes for a specific
image type and is used for the filesystem attribute which is required
for the image type oem, vmx and pxe. This Fixes #476
2017-09-12 12:39:49 +02:00
Marcus Schäfer
77fa8de510
Make get_initrd_system a state method
Make sure the default initrd_system is set to dracut
for the vmx image type and to kiwi if no initrd_system
is specified. This allows to simplify other code parts
as we can trust there is a value set
2017-09-06 18:01:37 +02:00
Marcus Schäfer
e59270c09b
Added handling of formatoptions attribute
Custom disk format options passed in the formatoptions
attribute were not handled. In addition options with a
value passed to qemu were handled in the wrong way.
This commit addresses both problems and Fixes #463
2017-08-11 15:46:40 +02:00
David Cassany
642b514a59 Add runtimecheck for mediacheck attribute on non x86 hosts
This commit rearranges some method and variable names and includes
a new runtimecheck to ensure the mediacheck attribute is not set
when building non x86 images.

Patch related to bsc#1049304
2017-07-27 15:44:37 +02:00
Marcus Schäfer
821f20291d Auto update image descriptions to schema v6.7 2017-07-27 14:46:47 +02:00
Marcus Schäfer
d7d631c8a7 Apply schema v6.6 stylesheet to XML descriptions
Updates all XML descriptions to latest schema version and
also includes adaptions to the test XML descriptions for
testing the new Xen guest and server setup
2017-07-20 10:34:37 +02:00
David Cassany
3ad92a1477 Translate obs to suse derived from image uris
This commit performs a translation from obs scheme to suse
scheme for derived from image uris when kiwi is running in a
buildservice worker.

Fixes #399
2017-06-30 12:16:58 +02:00