The method returned the basename of the tool if it could
be found by Path.which(). But the method's scope has been
changed in a way that the return value of the method must
be the result from Path.which() to allow working on the
full path name.
This commit ensures that when trying to parse the version of a tool
the comparison is done with the longest match for the given regular
expression. This solves cases such in `grub2` where the tool name
already provides some digit that could be seen as a version.
On systems that uses GRUB_USE_LINUXEFI with grub2 version
less than 2.04 there is no support for dynamic EFI
environment checking. In this condition we extend the grub
setup to add this support. The change kiwi does is as
follows:
* Apply only on grub < 2.04
1. Modify 10_linux to set linux/initrd as variables
2. Write hybrid setup as 01_efihybrid
This Fixes bsc#1165960 and bsc#1168480
The creation of the qcow2 format was done in one qemu-img
convert call. That call instructs qemu to compress and
convert in one call. The downside of this approach is that
not all qcow2 options can be used. For example the setup
of:
<type ... formatoptions="preallocation=metadata"/>
failed the build with an error message that compression and
preallocation is not possible at the same time. Thus this patch
changes the way the qcow2 image is created to be done in two
steps. The first step converts the format without compression
and therefore allows for any format option to be used. The
second call only applies the compression and leads to the
final result.
In addition to the existing root/ overlay directory which
applies always there can now also be profile specific overlay
directories. If an overlay directory should be applied for
a specific profile this can now be done by placing this data
in a directory that is named the same as the profile name.
The new element controls the behavior of the repart/resize code
in the oem-repart dracut module. By default the repart/resize
happens on every reboot and therefore also allows for disk
geometry changes during the livetime of the machine. If the
element is set to false the repart/resize operation happens
only once and then never again. To check for this condition
a new profile environment variable kiwi_rootpartuuid which
holds the PARTUUID of the root partition has been added to
the disk builder.
With the new Fstab class from prior pull request there is an
opportunity to handle all fstab related actions to be done
by that class. This commit extends the Fstab class with an
add_entry method such that we can avoid the extra lists
holding raw fstab lines in e.g the disk builder. In the end
all fstab related data is stored in an instance of the Fstab
class. This also extends the KIWI api by an fstab management
class. Related to #1329 and #1349
When building container images an extra create_fstab method
exists that created an empty fstab file. The reasons for this
are historical and also related to appx support from obs.
The obs based support for appx containers was based on the
creation of a kiwi docker image that got modified and turned
into an appx container. Now with native appx support by kiwi
this special fstab handling is no longer needed and should
be deleted. This Fixes#1329
Handling of fstab should be done in its own namespace and class.
The current handling of fstab entries is spread at several places.
There should be only one code that writes the fstab entries and
that code should also care for the correct canonical order of
the mountpoints
Any mount point directly under / should be just right after the root
mountpoint and before the custom mountpoints based on user's subvolume
configuration.
Fixes#1349 and bsc#1164310
Added a static list of mountpoints used for devices that
are not associated with a physical device like /proc and
use that information in the exclude list for calculating
the image byte size. This Fixes#1363
The dracut code in 90kiwi-dump/kiwi-dump-image.sh looks for a
file matching ${image_uri}.config.bootoptions but the install
code packs a file named pxeboot.${image_uri}.config.bootoptions
into the tarball. Thus without renaming the file it won't
be found. Also the documentation mentions the file to be
named ${image_uri}.config.bootoptions. This commit fixes the
install code to match the dracut boot code and the documentation
This commit fixes a regression introduced in 12d84be2. We need to ensure
that `labels` item exist in oci image configuration dict before updating
it and creating it in case it doesn't exist.
This commits fixes the containers label setup in OBS, ensuring that
adding the 'org.openbuildservice.disturl' label does not clear any
other label.
Fixes#1338
Set kiwi.tasks to be the plugin entry point and register
existing task plugins in setup.py. Change the code in
cli.py to auto register plugins using the iter_entry_points
method from the pkg_resources class. This allows for easier
writing of external kiwi plugins.
Systems using a template tool to generate config files
might not be effective when they see the intermediate
config files we need from the host to let certain package
managers work correctly. Therefore the cleanup code in
kiwi takes care to restore from an optionally existing
template file if no other custom variant is present.
This Fixes bsc#1163978
This commit adds the `squashfscompression` attribute in type element. It
can take `gzip`, `zstd`, `xz`, `lzo`, `lz4` or `none`. The default is `xz`.
Fixes#1315
This commit makes sure to empty RPM macros files are created during
the build. Additionally it also ensures that no needless `rm` and `mkdir`
calls are done.
Fixes#1316
This commit creates the .append file for PXE images. This file
is only created for initrd based images and includes the
UUID of the rootfs and any parameter added by the user within
the 'kernelcmdline' attribute.
Fixes#1327
The Open Build Service builds images by identifying the requested dependencies,
downloading them into an isolated environment, regenerating the repository
metadata from scratch with *only* that content, and then passing those
new repositories to be used for building images. This enforces the
reproducibility of the image build process.
However, when building images for Linux distributions that have
AppStreams/modules (such as Red Hat Enterprise Linux/CentOS 8)
in an Open Build Service system, the repository metadata associated
with modules is not present as OBS does not generate it.
This causes the image build to fail because the normal module
content filtering rules make it so that modular RPMs are disabled
unless there is module metadata in the repository that identifies
them and that the module has been configured to be enabled.
As it is not possible for us to satisfy those conditions, instead
we disable modular filtering entirely when we detect that the image
build is occurring inside the build service, as we are reasonably
certain that OBS will not give us bad or broken package sets.
The sat library from the python3-solv plugin does not expose
the flags information as method. Instead the flags value is
a variable pointing to an integer that has a name mapping
in self.solv.Selection from the library.
This commit refactors the use of Path.which in several parts of the
code. Since dd4d2ed78 the Path utility is capable to run Path.which
on certain chroot env, thus no need to adapt the PATH environment
variable.
Fixes#1281
When deploying a disk image via PXE the initrd contained a config
file which connects it to a certain image. This has the disadvantage
that no other image could be deployed with it. This commit changes the
deployment code in a way that the config file is read from the
network if the disk is deployed via PXE. The tarball created by
kiwi provides the image connected config file but users now have
the opportunity to create their own boot configurations which allows
deployment of different images with the same kiwi built deployment
initrd. This Fixes#1298 and is one first step into a more generic
PXE support offered by kiwi.
This commit removes the RootBind.move_to_root method as this can all be
done by using the Path.move_to_root utility method. This allows
to drop the RootBind attribute in PackageManager classes and focus
path manipulation methods into a common utility.
Related to #1281
If a volume manager is used the volumes are added before the
root filesystem(/) entry in fstab. This does not hurt because
at boot time systemd manages the mounting of the rootfs prior
to any other information in the fstab file but it's conceptually
broken. Users justifiably can expect the fstab entries in the
correct order such that mounting from top to bottom leads
to a consistent root filesystem state.
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
This commit avoids requesting non installed dracut modules to the dracut
creation. It bumps a warning message if the module requested by KIWI is
not installed in the root-tree and ignores the request.
This allows the creation of images without including KIWI dracut modules
when the related runtime checks are disabled.
Fixes#1300
For the lookup of the kernel version kiwi provided a small
C program that reads the first bytes of the kernel binary
and extracts the version information. Given the various
compression formats and also the problem of kernel files
that contains the decompressor code which could be anything
it has turned out to be difficult to provide a stable tool
to read the version from the binary. Therefore the code in
kiwi was refactored to read the version via regexp match
from the filename which also makes kversion an obsolete
tool. This Fixes#1308
If shim fallback setup is enabled the grub.cfg is copied to the EFI
partition. This commit makes sure that the grub.cfg is copied to the EFI
partition according to the efi mount point.
Fixes bsc#1159235
Post image build metadata like the packages file which are
created from data produced by the package manager can contain
multibyte characters and should be written into files opened
with the UTF-8 encoding. The same applies to the image imported
XML description. This Fixes#1290
In /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT also contained
the root= information. If grub2-mkconfig runs with that information
it places the root device information twice because grub2-mkconfig
resolves this information itself. This commit prevents the root=
information to be placed in the default grub config and
Fixes bsc#1156908
In addition to the generic grub font directory also lookup
distribution specific font paths in the system and copy the
grub unicode font into it. This Fixes#1253