Commit Graph

94 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
Marcus Schäfer
4129dbbf1f
Update CA target distribution name
Instead of rhel better name it redhat
2026-01-07 14:51:10 +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
c06ef691bc
Add documentation about new attributes
Add information about eficsmpart_id
2026-01-01 01:39:42 +01:00
Marcus Schäfer
bc08dc8ca0
Add documentation about new attributes
Add information about part_id, efipart_id, rootpart_id
and bootpart_id
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
Alejandro Perez Pestana
2006b4c9fe
Add kernel parameter support for dm-verity options
Implement rd.kiwi.verity_options= parameter to allow runtime customization of veritysetup options

Closes #2837
2025-06-27 09:07:30 +00:00
Dan Čermák
01ef41f3b1
Add support for container-snap as a container-image engine
With this commit, we can now pre-load images using container-snap directly
during the kiwi image build
2025-06-25 16:03:08 +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
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
a2f4ca00d3
Add support for new tarball-based WSL format
With the new image="wsl" type one can build a WSL container
image that uses the new tarball format. This Fixes #2678
2025-05-12 16:22:01 +02:00
Marcus Schäfer
3963e56c91
Add documentation for new attribute
Add details how to use the new overlayroot_readonly_filesystem attribute
2025-05-08 22:07:04 +02:00
Marcus Schäfer
2111bb567d
Add support for GPT targettype on s390
Allow to build s390 images using GPT instead of the old DOS
partition table. zipl has added support to read from GPT.
This Fixes #2694
2025-04-30 12:34:27 +02:00
Marcus Schäfer
72f2237bde
Update documentation
Add information about new apk (Alpine) support
2025-04-01 15:10:12 +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
60becf931f
Improve unit test for archive target_dir
Add a test case with absolute path in the target_dir
to make sure we never unpack the archive to the host
system. The actual issue was resolved together with
the implementation in #1953 and commit
78238a993c
This Fixes #2701
2025-01-30 21:26:00 +01:00
Marcus Schäfer
c9beec2ea7
Fix documentation regarding URI styles
In reference to commit 760a65558f
the support for iso:// URI types was dropped some time ago.
However, the documentation was not properly updated. This
commit fixes it
2025-01-22 10:38:09 +01:00
Marcus Schäfer
35af7b1d3b
Fixed documentation for signing key attribute
The source locator name for local files was incorrect
2025-01-20 09:16:14 +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
0109686c8f
Fix documentation for repo, package gpg settings
In contrast to the documentation, kiwi sets default values
for any gpg setting if not explicitly specified differently.
We want to avoid to inherit a behavior from how the distribution
packages the package manager. This commit fixes the documentation
to be in line with the implementation
2024-12-20 21:59:38 +01:00
Adam Williamson
75c9939f84 xorriso: respect efiparttable and gpt_hybrid_mbr
This should make the xorriso-based ISO build path respect the
'efiparttable' and 'gpt_hybrid_mbr' settings when building a
UEFI-compatible image, making it write a GPT disk label by default
instead of an MBR (msdos) one. If it's building an image that is not
UEFI-compatible it will always write an MBR label, regardless of
this setting.

If 'gpt_hybrid_mbr' is set, xorriso will write an Ubuntu-style
MBR/GPT hybrid partition table, where the MBR partition table
includes a partition with type 00 and the bootable flag, as well
as the partition with type ee required by the UEFI spec. This
mildly violates the UEFI spec but may make the image bootable on
native BIOS or CSM firmwares which refuse to boot from a disk with
no partition marked 'bootable' in the MBR. If 'gpt_hybrid_mbr' is
not set, xorriso will write a strictly UEFI-spec compliant label,
with just the 'protective MBR' required by the UEFI spec (no
bootable partition) and the correct GPT partition table. Note
this is somewhat different from what gpt_hybrid_mbr does for
disk images.

Also, we now pass -compliance no_emul_toc when building ISOs, as
recommended by upstream in
https://lists.gnu.org/archive/html/bug-xorriso/2024-11/msg00012.html
This tool is generally always going to be building ISOs intended
for write-once use, not multi-session use (and which are rarely,
these days, written to physical discs at all anyway).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-12-13 11:13:27 -08:00
Marcus Schäfer
43cd86dfaf
Add random key support for LUKS encryption
Allow to pass luks="random". In random mode use the
generated keyfile as the only key to decrypt. This is
only secure if the generated initrd also gets protected
e.g. through encryption like it is done with the secure
linux execution on zSystems
2024-11-21 10:24:04 +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
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
1aaf9ce414
Update documentation
kiwi no longer uses debootstrap
2024-08-03 22:20:22 +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
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
Neal Gompa
cc0e3283a4 doc: Document the bls option for the grub bootloader 2024-05-02 06:42:27 -04:00
Marcus Schäfer
379ccf2a82
Update documentation
drop documentation for isolinux in API and user docs
2024-01-26 21:25:37 +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
Marcus Schäfer
a9573231f7
Fix documentation for btrfs_set_default_volume
The behavior documentation regarding the fstab entry when
using the btrfs_set_default_volume attribute was wrong.
This commit fixes the docs to match the code. Related
to Issue #2366
2023-09-13 14:34:31 +02:00
Marcus Schäfer
8580b2006b
Fixed root entry in fstab for btrfs layout
A root (/) entry in fstab for btrfs is only required if no
default volume is configured. This commit adapts the code
path which adds an fstab entry for (/) to be effective only
if btrfs_set_default_volume is set to false.

Additionally, the documentation around btrfs_set_default_volume
was clarified to describe the behavior the switch triggers.

This Fixes #2366
2023-09-12 20:03:30 -04:00
Leif Liddy
6c12fae9a2
add info on none console type 2023-08-26 16:59:34 +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
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
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
Hans-Peter Jansen
b79e91816f Documentation: clearify dnf based collection selectors
With 89b5a6f526, the selection of collections was changed to allow
group IDs only for dnf based package installers.
2023-05-25 16:42:38 +02:00
Marcus Schäfer
c304e557b0
Merge pull request #2253 from OSInside/fix_selection_of_write_partition
Fix evaluation of write partition and parameters for overlayroot setup
2023-03-25 01:00:51 +01: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
Marcus Schäfer
3cccace616
Fixed rd.root.overlay.readonly handling
Fix the option implementation to actually do what it is supposed
to do, boot the system in fll read-only mode. In addition a new
parameter named rd.root.overlay.temporary has been introduced
which allows to boot up in read-write mode but the write area
is a tmpfs. Thus persistency only during runtime. Updated the
documentation accordingly
2023-03-08 13:51:02 +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
fe478de901
Added API for BLS and systemd-boot support
Bootloaders implementing the Boot Loader Spec (BLS) are not
directly compatible with the original Bootloader Class design
in kiwi. Because of that an interface class which translates
the original API into calls following BLS was added. This allows
us to keep the implementations in the Builder classes and the
public BootLoader interface untouched. In addition to the BLS
API an implementation to support the systemd-boot loader is
part of this commit too.

An example type definition to use systemd-boot with an EFI
disk image type looks like the following:

    <type image="oem" filesystem="xfs" firmware="efi" bootloader="systemd_boot" efipartsize="200"/>

The implementation uses bootctl and kernel-install tools
provided from systemd and expects a proper integration
of systemd-boot by the distribution maintainers

This Fixes #1935
2022-11-12 17:39:22 +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