The support for delta_root allows to build a delta container
image from a given base container. Due to the refactoring of
the kiwi code base using context managers no explicit deletion
of instances happens anymore. This uncovered a weakness of
the delta root code at the level of the overlay mount. At
the time of the umount there are still active temporary
mount handlers which keeps the mountpoint busy. In order to
fix this properly also the PackageManager factory is now
a context manager and the Repository factory received a
cleanup method which is called when the PackageManager goes
out of scope. This refactoring also fixes the busy state
when building deltas
Change the SystemPrepare class to context manager.
All code using SystemPrepare was updated to the following
with statement:
with SystemPrepare(...) as system_prepare:
system_prepare.some_member()
This completes the refactoring from finalizers to
context managers and Fixes#2412
This commits makes use of rsync default options to sync
the root-tree of the boot image for custom initrds.
Fixes bsc#1207128 where it was noted hardlinks
were not preserved inside the initrd.
Signed-off-by: David Cassany <dcassany@suse.com>
So far kiwi was looking up kernels only on /boot. Including
other bootloaders it's no longer required that the kernel
packages of the distributions provides the kernel in /boot
Thus kiwi's lookup needs to be extended to other places
which is done by this commit.
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
The method _get_boot_image_output_file_format_from_dracut_code
is used in kiwi to match parts of the dracut code for the used
output file format. Beginning with dracut-056 the code part
checked has changed syntactically such that the match did
no longer work. This commit increases the scope of the match
and replace pattern and Fixes#2149
The modifications in this commit allows the unit tests
to run on both, pytest 6.x (nose test layout) and the new
pytest 7.x (xunit test layout). This Fixes#2072 in a
much nicer way. Thanks much to @smarlowucf
This reverts commit 0dc2e803e0.
The pytest interface from version v6 to v7 has received
changes which requires the tests to be adapted to work for
either the old or the new interface. As there are still many
distributions which uses v6 as the standard we decided to
revert back the adaptions done to support v7 and create
a version requirement to v6 in .virtualenv.dev-requirements.txt
This Fixes#2072
The pytest interface setup() method call has changed
in a way that an additional parameter is passed to
the method which leads to a python error at invocation
time if the setup method does not define it.
If an image is build without a kernel kiwi fails due to
some code paths expecting the presence of kernel modules
and or kernel binaries. This commit fixes this and allows
creating an image without installing a kernel.
So far we called dracut with --xz which forces the initrd
to be xz compressed. There are other compression formats
used by the distributions and they might differe from xz.
The selection for a compression tool is done by a dist
configuration in dracut.conf.d which is provided by the
distributions as they see fit. For us this means not
forcing dracut into a specific compression setting allows
to make use of the distro provided setting and also
allows to change/override this setting by an overlay
file. This Fixes bsc#1192975
Moving use of mkdtemp, NamedTemporaryFile and TemporaryDirectory
into its own class called Temporary: By default all temporary
data is created below /var/tmp but can be changed via the
global commandline option --temp-dir. This Fixes#1870
In newer versions of dracut /dev and /proc must be mounted
for dracut to work correctly. If not present the resulting
initrd is incomplete. This Fixes#1867
In the custom kiwi initrd build process a temporary directory
holding a copy of the initrd root tree is created. That data
got never cleaned up. This commit uses a TemporaryDirectory
object from the tempfile module to make sure it gets deleted
once the execution scope is done. This Fixes#1837
Embedded systems and other customer use cases sometimes
doesn't require an initrd. So far the initrd creation was
a mandatory step in the process. With this commit it's
possible to configure <type ... initrd_system="none"/>
and therefore skip the creation and setup of an initrd.
Using this feature comes with a price. Without an initrd
the task of mounting the specified root=DEVICE_SPEC now
becomes a task of the kernel. If the kernel doesn't have
the required filesystem driver compiled in or the mount
process of the device is not just a simple mount
action, the boot of such an appliance will fail
Unfortunately the architecture reported by uname is not
necessarily the same name as used in the repository metadata.
Therefore it was not a good idea to set the architecture
and manage the name via a mapping table. It also has turned
out that repo arch names are distro specific which causes
more complexity on an eventual mapping table. In the end
this commit changes the way how the repository architecture
is setup in a way that we only set the architecture if
a name was explicitly specified such that the user keeps
full control over it without any mapping magic included
This Fixes bsc#1185287
This commit mainly refactors the DiskBuilder class. Then install builder
and dracut boot image refactors are mostly to drop no longer needed
code. The refactors tries to make the build simpler and easier to read and
also prevent the reuse of the BootImage instance used for the main image
when creating the installation media (this aplies only for
dracut based images).
Fixes#873
The option --target-arch allows to set the architecture
used to build the image. By default this is the host
architecture. Please note, if the specified architecture
name does not match the host architecture and is therefore
requesting a cross architecture image build, it's important
to understand that for this process to work a preparatory
step to support the image architecture and binary format
on the building host is required and is not considered a
responsibility of kiwi. There will be a followup effort
on providing a plugin for kiwi which should be used to
manage the needed binfmt settings for cross arch image
builds
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#1676Fixes#1683
Instead of placing the file into .coveragerc use the
no cover pragma to skip code paths that can never be
reached from being counted in the coverage report.
This affects the abstract constructors in the Factory
classes
This commit refactors the BootImage factory to be a real
factory and to add type hints such that its use from an api
perspective is clear and enforced. Related to Issue #1498
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
When building a custom kiwi initrd the root directory
has the permissions of the mkdtemp created directory
but should have the permissions of a linux root dir
which is 0755. This Fixes#1394
In preparation to allow a chroot operation into the loop
mounted disk this commit refactors the process when filesystems
gets umounted and also fixes the canonical order for calling
the destructors. Related to Issue #1464
The current way to detect the dracut output file format was
based on a lookup of the format used in the dracut tool itself.
However there are distributions like Ubuntu which calls dracut
and passes the name of the initrd file as options to the call.
This invalidates the checking done by kiwi. The only chance
for kiwi to do the same than the distributions does is by
looking for an initrd file pre-created by the package
installations and use the same format. Only if no such initrd
file exists the former format detection code applies. The
additional code expects any initrd file to match the glob
pattern 'init*'. This Fixes#1450
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.
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