Commit Graph

1701 Commits

Author SHA1 Message Date
Marcus Schäfer
71608c1122
Fixed use of fscreateoptions for iso type
The information for fscreateoptions was not passed along to the
tooling if a custom filesystem attribute was specified.
This Fixes #2681
2024-11-25 16:30:53 +01:00
Marcus Schäfer
231c3db62c
Merge pull request #2528 from OSInside/confidental_compute_s390
Confidential compute s390
2024-11-21 11:26:50 +01: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
e44c7f0e55
Fix setup of kiwi environment variables
Some kiwi env vars are initialized with an empty value
and not overwritten if another value is provided. For
the selected variables an empty value setting is not
allowed because the schema also enforces the value to
be set at least once. In addition a helpful option
named --print-kiwi-env was added to the 'image info'
command which allows to print the environment variables
and their values.
2024-11-17 23:40:29 +01:00
Marcus Schäfer
24f32d1bce
Added containers integration with OBS
When building in the Open Build Service (OBS) there is no way
to create outgoing connections from the build workers. To allow
the <containers> section to fetch containers from the SUSE
registry we need to apply an OCI URI translation into a local
path. The actual OCI container image is expected to be provided
by the obs backend on the worker. Along with this commit also an
integration test named test-image-disk-containers is provided.
This Fixes jira#OBS-351
2024-11-11 16:35:59 +01:00
Marcus Schäfer
1ec3b25e91
Remove tox dependency
tox was used as sort of a make target to run unit tests
and more in a python virtualenv. However, since we switched
everything to poetry it's no longer needed to let tox create
the python virtual environments. This commit moves the tox
targets into the Makefile and adapts the github workflow
files accordingly. In addition the scripts container based
tests were re-activated and fixed such that they succeed
again.
2024-11-05 18:03:25 +01:00
Marcus Schäfer
43bb97c621
Fixed zipl caller environment
zipl gets confused with an active sysfs mount inside
the root tree at call time of zipl. This commit
umounts the /sys bind mount in the image tree prior
calling zipl
2024-10-31 23:33:45 +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
cbdddefcff
Fixed debian bootstrap script calls
Run scripts as commands with their native shebang and not
through bash. Not all debian package scripts uses bash, some
of them uses sh which can be a link to dash or other
interpreters. This Fixes #2660
2024-10-17 21:02:31 +02:00
Marcus Schäfer
15b4bbcd8d
Support older apt versions for bootstrap
This Fixes #2660
2024-10-04 11:32:56 +02:00
Marcus Schäfer
ad50bc7d32
Run package scripts in apt bootstrap phase
The bootstrap procedure based on apt only runs a manual
collection of package scripts. This commit refactors the
code that unpacks the bootstrap packages to a python
implementation and adds a method to run the bootstrap
scripts from all packages resolved by apt.
2024-10-04 11:32:56 +02:00
Neal Gompa (ニール・ゴンパ)
9215ac55b8
Merge pull request #2657 from OSInside/volume_quotas
Add quota attribute to volume section
2024-09-26 08:08:18 -04:00
Marcus Schäfer
3c68244fd0
Fix bundle extension for vagrant type
When bundling result files that uses a vagrant type,
kiwi creates them with the extension .vagrant.virtualbox.box
or .vagrant.libvirt.box. The bundler code renames them using
only the .box suffix which is too short as it is missing
the subformat information. This commit fixes it and keeps
this information in the result bundle file name.
This Fixes #2656
2024-09-26 14:00:42 +02:00
Marcus Schäfer
8a087f870a
Use simple quotas (squota) for volumes 2024-09-26 13:28:12 +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
Alyssa Rosenzweig
504343fbd6 Fix globbing with exclude with regex
This fixes a collection of bugs when producing erofs images.

On one hand, this ensures that an exclude of `/sys` doesn't accidentally
match `/lib/libsystemd.so`, only `/sys/whatever`.

On the other hand, this ensures that `/dev/*` does match `/dev/vda` and
not just `/dev///////////`.

This fixes libsystemd.so getting dropped in Kiwi-built FEX images.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2024-09-24 16:19:26 -04:00
Isaac True
ed64dcfa25
test: storage: update clone_device tests with new block size
Signed-off-by: Isaac True <isaac@is.having.coffee>
2024-09-23 10:05:14 +02:00
Marcus Schäfer
21056fa55d
Add missing erofscompression validation
In the filesystem builder I forgot to evaluate the
erofscompression attribute. This Fixes #2647
2024-09-17 15:07:49 +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
Michal Suchanek
301cd1a189 bootloader: Fix up ppc64 bootinfo again
To make the code look pretty extra newline is inserted at the start of
bootinfo file. This appears to break boot on Power9 PowerVM LPARs.
2024-09-12 19:15:43 +02:00
Marcus Schäfer
7ace6fe0c3
Fixed container sync options
Do not exclude/filter any security/xattr capabilities.
2024-09-11 12:21:08 +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
Michal Suchanek
473657e82a Fix ppc64 chrp bootinfo generation 2024-09-10 11:29:05 +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
Kostiantyn Astakhov
3fc6bd9145
add allowExtraConfig and exportFlags to ovftool options
Add allowExtraConfig and exportFlags to ovftool options
2024-09-05 15:50:42 +02:00
Neal Gompa (ニール・ゴンパ)
8c869442cd
Merge pull request #2635 from OSInside/fix_initrd_permissions
Fix initrd permissions
2024-09-05 07:16:51 -04:00
Steffen Winterfeldt
d3d0cce94a
Fix boot support for ISO media on ppc64
add CHRP boot support for ppc64 and add xorriso option to avoid
file name reduction to MS-DOS compatible 8.3 format
2024-09-05 12:39:17 +02:00
Marcus Schäfer
111e457c73
Fix initrd permissions
kiwi stored the initrd for ISO images as 600 which might
be too restrictive. This commit makes sure the initrd is
stored as 644 and Fixes bsc#1229257
2024-09-03 10:11:52 +02:00
Neal Gompa (ニール・ゴンパ)
a4e84b8652
Merge pull request #2630 from OSInside/fix_bundle_extension_for_archive_types
Fix bundle extension for archive types
2024-09-01 11:12:41 -04:00
Marcus Schäfer
9bea24a417
Fix bundle extension for archive types
When bundling result files that uses an archive type like
tbz or docker, kiwi creates them with the extension tar.xz/tar.gz
The bundler code only uses the extension from the last tuple
in a "." split which is wrong for "tar." filenames. This commit
adds an exception to the prefix rule for this output filenames
and Fixes #2628
2024-09-01 16:26:29 +02:00
Marcus Schäfer
a2134f0835
Fix ImageSystem mount procedure
The mount() method did not take custom partitions into account.
This commit fixes it. This Fixes #2619
2024-09-01 15:53:29 +02:00
Marcus Schäfer
bf5dfb4644
Merge pull request #2608 from OSInside/remove-remove-and-rename
Remove Path.remove, Path.rename and refactor Path.which & Path.create
2024-08-26 17:30:50 +02:00
Neal Gompa
7a53e1bd8b
Add support for isomd5sum for tagging iso files
The isomd5sum tool suite is used and available on all supported
distributions except SUSE distributions, and is necessary to produce
conformant ISOs for most Linux distributions.

This change adds support for isomd5sum tool suite for kiwi, though
it does not extend the kiwi-live dracut module to use it. The upstream
dracut dmsquash-live module must be used instead.

Co-authored-by: Dan Čermák <dcermak@suse.com>
2024-08-26 11:49:55 +02:00
Neal Gompa
eb39120ea1 kiwi/builder/live: Clean up leftover dracut configuration file
The existence of this file breaks installers on live media that
sync the full filesystem to disk and are not aware of this configuration
before generating the target system initramfs.
2024-08-24 08:34:03 -04:00
Neal Gompa
c29518626a Allow string versions and test "word" versions
There are descriptions out in the wild that use "non-numeric" versions
in their descriptions, particularly without separators for splitting.

This change switches all of this to strings rather than assuming
numbers and gracefully handles the single word case.
2024-08-23 10:01:27 -04:00
Dan Čermák
17e3d50719
Use shutil.which for Path.which 2024-08-16 18:11:55 +02:00
Dan Čermák
df147cf316
Drop Path.remove & Path.rename
Both methods were only used in one place each and it makes much more sense to
use the pathlib builtin methods instead
2024-08-16 18:11:55 +02:00
Dan Čermák
eac164dd3a
Replace Path.create implementation with pathlib builtin 2024-08-16 18:11:55 +02:00
Marcus Schäfer
3c07603f71
Fixed wrong log level on --logfile
When using --logfile, the log generated there matches the
stdout log (which without --debug, does not include any debug info).
This is in contrast to the automatically generated one in the
output directory, which always does and also not following the
way how it is documented. This Fixes #2503
2024-08-16 12:45:55 +02:00
Marcus Schäfer
e866bc5832
Fixed arch flag for namedCollection
The arch flag in a namedCollection was not taken into account.
This commit fixes this and also makes sure the result information
is sorted and unique like we have it for the package lists.
This Fixes #2600
2024-08-12 09:23:06 +02:00
Marcus Schäfer
4f4e410523
Fix handling of zipl.conf in plain zipl bootloader
When using the plain zipl bootloader kiwi created a /etc/zipl.conf
file. However, this file was only useful during image build as it
points to a loop target device and geometry but does not represent
a proper config file to be used in the running system. In addition
the different distributors provides their own version and layout
of the zipl.conf to be used inside of the system and with their
respective tools. Thus this commit changes the way how kiwi operates
in a way that the zipl.conf used in the initial image only exists
during the image build process. An eventual present /etc/zipl.conf
will not be touched by kiwi. This Fixes #2597
2024-08-09 12:07:48 +02:00
Marcus Schäfer
ff7adbd184
Setup default minimum volume size per filesystem
The former method provided a static value but there are huge
differences for the minimum size requirement of a filesystem.
For example extX is fine with 30MB whereas XFS requires 300MB.
This commit adds a more dynamic default value based on the
used filesystem.
2024-08-08 10:22:22 +02:00
Marcus Schäfer
4b60c92e4a
Increase default volume size
So far 30MB was set as default volume size which is by far
too small for a number of filesystems, e.g btrfs and also XFS.
This commit increases the default volume size such that all
modern filesystems builds if the default volume size is used.
2024-08-07 18:32:04 +02:00
Marcus Schäfer
716bcc4199
Mandatory package scripts for Debian bootstrap
Make sure to run some mandatory package pre/post scripts
such that settings like /etc/passwd, a root user, etc..
exists. This action can also be done in post_bootstrap.sh
but I think it's better to do this in the core code
2024-08-05 22:59:52 +02:00
Marcus Schäfer
ff9790a3ea
Fix test_process_result_bundle_as_rpm 2024-08-03 22:14:40 +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
e23891eadb
Fix test_process_result_bundle_as_rpm
os.path.basename was called on a MagicMock object which
sometimes confused pytest
2024-07-31 16:57:30 +02:00
Marcus Schäfer
e86e5423c0
Do not exclude the .profile env file by default
kiwi's initrd modules read a .profile file which gets included
into the initrd produced at build time. To allow rebuild of a
host-only initrd from the booted system this information should
be present such that it is possible to re-use kiwi initrd code.
2024-07-30 18:16:54 +02:00