Commit Graph

185 Commits

Author SHA1 Message Date
Marcus Schäfer
186c5bb4fa
Allow to setup the environment blob for grub
Added new <environment> section to the existing <bootloadersettings>
section which allows to specify environment variables for setting
up an environment blob for the selected loader. With this commit
we add support for grub by using grub2-editenv. Other loaders
do not yet have an implementation or does not support environment
blobs. Settings will be ignored for unsupported loaders.
This Fixes #2922

Co-authored-by: Rhys Oxenham <rhys.oxenham@suse.com>
2026-01-22 16:05:21 +01:00
Rhys Oxenham
88107398f5
Adding support for import of custom certificates
This commit adds support for providing custom CA certificates
during the build process. It allows a user to specify one ore
more CA file(s) via the new <certificates> section and/or
via the command line. The certificate files will be imported
directly after the image bootstrap has finished (where the
required CA update tools are available), but before any
further packages are retrieved, solving for situations where
the chroot environment needs certificates, e.g. when there's
a proxy server in the build environment.

Co-authored-by: Marcus Schaefer <marcus.schaefer@gmail.com>
2026-01-06 17:01:36 +01:00
Marcus Schäfer
8b4d124878
Add support for eficsmpart_id attribute
Allow custom partition number also for the
EFI CSM (legacy BIOS) partition
2026-01-01 01:39:42 +01:00
Marcus Schäfer
7cae923cae
Add support for custom part id attributes
efipart_id, rootpart_id, bootpart_id in <type> and
part_id in <partition>. Allow to specify a custom partition
number instead of the default numbering schema 1-N
2026-01-01 01:39:42 +01:00
Marcus Schäfer
9292a84d20
Improve grub console setup
The console attribute in the bootloader section was used to
target both, output and input console setup using a space separator.
However, there can be multiple consoles specified for output
and input consoles and that turns the idea to handle both in
one attribute into a mess. This commit drops the console attribute
and offers two new attributes output_console and input_console which
can define multiple consoles each using space as a separator.
For example:

    <bootloader ... output_console="console serial" input_console="console"/>

This change comes with a schema version bump to v8.4
An automatic XSL transformation template for the old console
attribute into the new output_console and input_console
attributes is also part of this commit.

This Fixes #2886
2025-11-24 17:50:11 +01:00
Marcus Schäfer
d3283644aa
Add label attribute for <partition> section
Allow to specify a filesystem label as part of a <partition>
definition. So far the label was set by the name of the
partition. With the new label attribute, a filesystem label
different from the partition name can be set. This commit
also updates/fixes the documentation in this regard.
2025-07-08 16:37:38 +02:00
Alejandro Perez
b57dbd2d9a
Add driver configuration support for dracut initrd
Add driver configuration support for dracut initrd

Add support for specifying kernel drivers to be included or omitted
in the dracut initrd configuration. This extends the existing dracut
configuration capabilities like in the following example

<initrd action="add">
    <dracut driver="erofs"/>
</initrd>
2025-06-16 12:12:06 +02:00
Dirk Müller
28ed67e456
Use f-strings where feasible
This is a slightly shorter and easier to read syntax
2025-06-02 22:59:11 +02:00
Marcus Schäfer
b3181f177b
Add support for <initrd> section as part of <type>
Extend scope and content of the <initrd> section to be allowed
as part of the <type> section. This allows to specify custom
call options and modules for the dracut tool. In particular
this commit implementes support for passing the uefi option
to dracut to enable building an UKI EFI binary as follows:

<initrd action="setup">
    <dracut uefi="true"/>
</initrd>

This Fixes #2809 and Fixes #2408
2025-05-19 11:55:36 +02:00
Marcus Schäfer
1753b85e12
Add support for selecting the overlay read-only fs
Add new overlayroot_readonly_filesystem attribute which allows
to select for either squashfs or erofs as the read-only filesystem
in an OEM overlay disk setup.
2025-05-08 22:07:04 +02:00
Marcus Schäfer
313f296587
Added <oem-ramdisk-size> element
So far it was only possible to specify the size of the ramdisk
via the kernel commandline option: ramdisk_size. In a remote
deployment it was therefore required to carry this size as a
mandatory information to the deployment server. With this commit
we allow to specify the size for the ramdisk to be configured as
part of the image configuration which makes this information
also available inside of the initrd. If provided the ramdisk_size
kernel commandline option still takes precedence over the
<oem-ramdisk-size> setting to avoid any behavior change and to
still allow dynamic overrides of the ramdisk size.
2025-04-09 18:17:32 +02:00
Marcus Schäfer
5018b58e86
Add support for Alpine
Add apk repository and package manager support and provide
an integration test build for the Alpine distribution
2025-04-01 10:44:41 +02:00
Marcus Schäfer
fdfa3b7494
Support arch attribute for <users> section
Allow to setup users per arch. This Fixes #2737
2025-03-24 15:06:02 +01:00
Marcus Schäfer
2edcfed120
Rename btrfs_root_is_snapshot
Rename btrfs_root_is_snapshot to btrfs_root_is_snapper_snapshot.
This happens in preparation for the changes suggested in #2697
where we want to get rid of snapper specific btrfs code which
will be available in snapper natively soon. To make sure a btrfs
layout specific to snapper(and SUSE), the implicitly used attribute
named btrfs_root_is_snapshot now becomes explicit and its new
name will indicate that snapper sits behind it. Along with the
rename a XSLT stylesheet to automatically convert the old name
into the new name for schema v8.3 will be performed.
2025-01-13 10:22:55 +01:00
Marcus Schäfer
2e9550382e
Added provide/require system files for containers
Added the attributes provide_system_files and require_system_files
to control the provider and requester of system files in
container image builds. systemfiles is a metadata file which
contains all files from the package database at call time.
It is used in flake-pilot to provision the systemfiles data
from the host into the container instance. One possible use
case for this data is a flake registration which uses a
base container that is derived from a runtime container but
all data from the runtime should be provisioned from the
host. Using this feature tightly couples the flake to the
host OS distribution and version.
2024-11-28 15:22:47 +01:00
Marcus Schäfer
b922d8ba2d
Added IBM Secure Execution support on s390
IBM SEL(Secure Execution for Linux) is supported for s390
KVM guests. SEL images used to start a confidential computing
protected guest contain an encrypted boot image which encapsulates
the kernel the initrd and the bootparams. The encrypted Image is
provided by the KVM/hypervisor to the Embedded zFirmware of the
system (the ultravisor device). The decryption keys are hardware
based and each system has an individual keypool unique to that
system. The root filesystem is LUKS encrypted with a random key
produced by kiwi at build time and kept inside of the initrd which
exists only inside of the encrypted boot image and the encrypted
rootfs to allow kernel updates. The commit to support secure
execution also comes with an integration test that provides
profiled image builds to target SUSE's LinuxONE as well
as IBM Cloud systems.
2024-11-21 10:24:04 +01:00
Marcus Schäfer
a349c055c4
Add new containers section
Allow to specify references to OCI containers in the
image description like in the following example:

<containers source="registry.suse.com" backend="podman">
    <container name="some" tag="some" path="/some/path"/>
</containers>

During the kiwi process the containers are fetched into a
temporary location and a systemd service is configured to
one time load the containers into the local registry at
first boot of the system. This Fixes #2663
2024-10-19 18:30:45 +02:00
Marcus Schäfer
f986570313
Add quota attribute to volume section
Allow to set quota per volume for the btrfs filesystem
This Fixes #2651
2024-09-26 11:49:02 +02:00
Marcus Schäfer
0209b13818
Add support for erofs
erofs is an alternative readonly filesystem that can be
used as alternative to squashfs. This Fixes #2633
2024-09-13 15:04:45 +02:00
Marcus Schäfer
23c67da9e3
Merge pull request #2586 from OSInside/nitro_enclaves
Add new builder for enclaves
2024-09-10 14:50:13 +02:00
Marcus Schäfer
3e5023e84b
Add support for architectures in deb source file
When apt resolves packages on a multiarch repo it can happen
that dependencies for packages from other architectures are
pulled into the solver process but are not provided by any
repository. To overcome this behavior the repository can
be setup to serve packages only for a specified architecture
or list of architectures. This is related to
OSInside/kiwi-descriptions#102
2024-09-09 11:03:15 +02:00
Marcus Schäfer
0506844986
Add new builder for enclaves
Add new EnclaveBuilder class which allows to build initrd-only
image types. The first enclave implementation covers aws-nitro
images produced via the eif_build tooling.
2024-09-07 22:23:59 +02:00
Marcus Schäfer
d149ab09db
Get rid of debootstrap
Replace debootstrap with an apt-get based pre-download of
packages followed by a dpkg-deb extraction.
This Fixes #2599
2024-08-02 21:57:04 +02:00
Marcus Schäfer
78238a993c
Add <file> directive to incorporate custom files
Usually custom files are managed by placing them as overlay
files or archives. However, overlay files must be structured
inside of a root/ subdirectory and archive files are binary
data. It is therefore not straight forward to just reference
one or more files as source files to the image description
to be placed into the image. This commit adds a new <file>
element which allows to do this. This Fixes #1953
2024-07-17 18:16:23 +02:00
Marcus Schäfer
5b3c761ca1
Allow to set custom ISO Application ID
Add new <type ... application_id="..."/> attribute to be set in
the ISO header main block. The application ID was used as identifier
in the legacy initrd code from former kiwi versions. Because of
this there is still the compat layer which sets an App ID as MBR
identifier string unless the new application_id overwrites it.
This Fixes #1810
2024-07-12 10:23:21 +02:00
Marcus Schäfer
8a6aed12ae
Add new eficsm type attribute
Allow to produce EFI/UEFI images without hybrid CSM
capabilities. This Fixes #2407
2024-07-11 21:40:19 +02:00
Marcus Schäfer
9c8f0b0879
Add support for arch selector on volumes
The optional <volume ... arch=""/> attribute allows to create
the volume only if it matches the specified host architecture.
Multiple architecture names can be specified as comma separated
list.
2024-07-04 10:58:37 +02:00
Marcus Schäfer
9cd8e19aed
Add support for arch attr in repository element
Allow to provide different repository sections per architecture
2024-06-01 20:55:02 +02:00
Marcus Schäfer
1737219b2e
Add support for stopsignal in containerconfig
Allow to specify the stopsignal via the containerconfig
element as the following example shows

<type image="docker">
    <containerconfig ...>
        <stopsignal>SIGINT</stopsignal>
    </containerconfig>
</type>

This Fixes #2543
2024-05-02 16:27:14 +02:00
Alberto Planas
f7aa0e5982
kiwi.rnc: define bls parameter for bootloader 2024-04-25 19:38:56 +02:00
Marcus Schäfer
8dcef0a5d5
Update major schema version from 7.6 -> 8.0
With the switch to schema v8.x we allow for non compatible
changes in regards to the v7.x stream. Thus this commit also
deletes the support for clicfs from the schema
2024-01-11 09:30:07 +01:00
Marcus Schäfer
c6d8235fa6
Fixed grub terminal setup
The grub terminal setup is divided into the setting for the output
and the input console. For both settings different parameters exists.
So far kiwi did not differentiate between the two parts of the
console setup and that could lead to a wrong setting if only one
value is provided in kiwi's console= attribute which lead to the
grub setting, GRUB_TERMINAL=value. If value is set to e.g gfxterm
grub takes this for both input and output and it's obviously
wrong for the input. To make this less error prune the kiwi code
changes with this commit to set GRUB_TERMINAL_INPUT and
GRUB_TERMINAL_OUTPUT rather than GRUB_TERMINAL and also runs sanity
checks on the provided values if they are applicable. The information
for setting up the console in the schema stays untouched though.
That's because it's used for all bootloaders and also because grub
supports multiple values for the console in/out setting in one
GRUB_TERMINAL variable even though kiwi does no longer use it.
To make this clear for the users also the documentation for the
console attribute setup has been updated. If we want to wish two
distinct attributes for input and output console settings a schema
change and also differentiation between bootloaders is needed and
that I only see for the kiwi-10 branch if at all. This Fixes #2419
2024-01-08 18:02:27 +01:00
Leif Liddy
b0195b7fda
allow value of GRUB_TERMINAL to be empty
allow value of GRUB_TERMINAL to be empty. When setting grub_console="none"
this now leads to an empty setting of GRUB_TERMINAL in the /etc/default/grub
system configuration file. This Fixes #2261
2023-08-25 09:14:20 +02:00
Marcus Schäfer
a31ef6a144
add btrfs_set_default_volume attribute
By default kiwi runs btrfs set-default on the volume that is
considered the default volume according to the btrfs settings
and defaults. btrfs_set_default_volume="false" allows
to deactivate this action. Along with the change also the
misleading name of the btrfs_create_toplevel_subvolume has
been changed to root_is_subvolume
2023-07-27 16:18:23 +02:00
Marcus Schäfer
cc2ba15a88
Add parent attribute to volume setup
For the btrfs volume management, allow to put a volume into a specific
parent volume. If not specified the volume is below the default volume
This Fixes #2316
2023-07-26 09:21:09 +02:00
Marcus Schäfer
1844e80fbf
Add btrfs_create_toplevel_subvolume attribute
Allow to explicitly select if a toplevel subvolume should
be created or not. To avoid a behavior change, kiwi will
create a toplevel based btrfs structure if this attribute
is not specified. However, a deprecation message to inform
about future behavior change will be printed. This is
related to Issue #2316
2023-07-26 09:21:09 +02:00
Olaf Kirch
95c8edfa99 Add improvements for fully encrypted disk images
This commit adds more flexibility when using LUKS
encrypted images. In addition support for key derivation
on user provided passwords has been added. The following
new attributes were added to the schema:

type.luks_randomize
  allow to enable/disable the data randomizing if luks
  encryption is used

type.luks_pbkdf
  When LUKS unlocks a key slot using a user provided
  password, it uses a so-called key derivation function
  to derive a symmetric encryption key from the password.
  Not all boot loaders support all KDF algorithms, hence
  this attribute can be used to select a specific algorithm

bootloader.use_disk_password
  When /boot is encrypted, make the boot loader store the
  password in its configuration file (in cleartext). This
  is useful for full disk encryption images

Signed-off-by: Olaf Kirch <okir@suse.com>
2023-07-05 12:29:51 +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
Marcus Schäfer
e8bb1cd04b
Add support for dnf5 package manager
dnf5 is the next generation of the dnf package manager.
dnf5 is not a drop in replacement to dnf which is the reason
why this commit adds a new interface class for package and
repository management under a new name: dnf5. Beginning with
Fedora >= 39 dnf5 will be the standard. Thus the requirements
on the packaging level were adapted too.
This Fixes #2300
This Fixes #2262
2023-06-12 13:58:36 +02:00
Marcus Schäfer
41875f57ea
Add support for creating delta containers
Add new attribute delta_root="true|false" which in combination with
derived_from="OCI-base-image" allows to create a delta root tree
only containing the differences between the OCI-base-image and the
actions taken by the kiwi prepare step. Based on the delta root tree
the subsequent image creation process starts. Such an incomplete
root tree is only useful under certain circumstances which is also
the reason why the feature is only available to the oci and docker
image types.
2023-03-16 17:06:15 +01: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
6d5b0f95d1
Support DM integrity legacy options
Add a new attribute integrity_legacy_hmac="true|false" which
allows to use old flawed HMAC calculation (does not protect superblock).
Add a new attribute integrity_legacy_padding="true|false" which
allows to use inefficient legacy padding. Do not use these attributes
until compatibility with a specific old kernel is required!
2022-09-14 09:59:26 -04:00
Marcus Schäfer
52991f4d2a
Limit repo alias names to be a safe POSIX name
Characters like spaces or other symbols used in repo alias names
can cause the package manager to fail setting up the repo. Thus
this patch changes the schema to only allow for safe POSIX names
matching: {pattern = "[a-zA-Z0-9_\-\.]+"}. This Fixes #2170
2022-09-01 19:51:59 +02:00
Marcus Schäfer
6d40ccffce
Support custom size for embedded EFI FAT image
For ISO images (live and install) the EFI boot requires an embedded
FAT image. As of now a fixed size of 20M was used which leads to a
problem if the EFI image or the initrd or the kernel is bigger than
20M. With the new attribute:

    efifatimagesize="nonNegativeInteger"

we can now set a different value for the FAT image. Please note the
value must be aligned to the also customizable efipartsize value
which allows to configure the size of the EFI partition
2022-08-07 19:12:56 +02:00
Marcus Schäfer
30eb1c1a5b
Correct setfiles relabeling
This change was inspired by a change done on Fedora's livecd-tools
from here: livecd-tools/livecd-tools#236. The patch corrects issues
with the setfiles SELinux relabel command. The issues become apparent
when the host and guest policies differ. Thus it becomes required
to explicitly set the policy to decouple from eventual unwanted
host settings.
2022-06-13 13:18:51 +02: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
4f47b1d94b
Add support for prebuilt bootstrap package for apt
When using the apt packagemanager kiwi required the use of
debootstrap to create the initial rootfs. This works as long
as there is always a main distribution repository available
which follows the structure of the official debian mirrors.
However if such a main distribution is not present or an
alternative layout like e.g OBS repos is used, debootstrap
will refuse to work. To allow for an alternative and without
the dependency to debootstrap kiwi supports using a prebuilt
bootstrap package providing the mini rootfs to serve as
the bootstrap result. As all other package managers properly
supports installation into an empty new root, this feature
was only added when using the apt packagemanager
2022-05-18 11:19:51 +02:00
Marcus Schäfer
61e4f05f1b
Add support for partition cloning
Support creating block level clones of certain partitions
used in the image. Clones can be created from the root, boot
and any partition listed in the <partitions> element.
2022-05-05 17:00:36 +02:00
Marcus Schäfer
e7e8c3bf42
Add support for dm integrity with secret key
Allow to protect the opening of the integrity data map and
journal through a keyfile. For setting the key file two new
optional type attributes were added:

* integrity_keyfile
* integrity_metadata_key_description

The key file format must be correct according to the selected
integrity algorithm. As of now the kiwi default hmac-sha256
algorithm is used with the selected keyfile

The optional integrity_metadata_key_description attribute
allows to specify a custom description of an integrity key
as it is expected to be present in the kernel keyring. The
information is placed in the integrity metadata block. If
not specified kiwi creates a key argument string instead
which is based on the given integrity_keyfile filename.
The format of this key argument is:

:BASENAME_OF_integrity_keyfile_WITHOUT_FILE_EXTENSION
2022-05-04 16:04:37 +02:00
ozboss
18dbe55725
Add option to set LUKS type to luks1 (#2126)
Add option to set LUKS type to luks1

So far the LUKS type could be set to luks and luks2. However, what luks
version the value 'luks' evaluates to depends on how the distributor has
packaged luks. Thus it's possible that 'luks' is either luks1 or luks2. To
also have the opportunity to explicitly specify luks1 this commit adds
the opportunity in the schema.
2022-05-04 15:28:57 +02:00