Commit Graph

42 Commits

Author SHA1 Message Date
Marcus Schäfer
8967c29a12
Added consistency runtime check for the type setup
multiple type sections within one preferences section is allowed
in a kiwi image description. However, if multiple type sections
for the same image attribute are configured only the last type
configuration will be ever reachable. The proposed runtime check
in this commit detects this situation and raises an exception
showing the conflicting types including a solution suggestion
which needs to be based on profiles to distinguish between
types of the same image type name.
2020-09-21 15:25:58 +02:00
Marcus Schäfer
8d2d9c214c
Make oem be a superset of vmx
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
2020-09-16 12:56:14 +02:00
Marcus Schäfer
54ab18c96c
Make oem image use dracut by default
Before this commit an oem image still had the kiwi initrd_system
set as default. As we are decommission the custom kiwi initrd
concept the default should be changed. It is still possible to
use a custom kiwi initrd but it needs to be explicitly requested
via the initrd_system="kiwi" attribute. In addition to the
changed default a runtime check was introduced that checks
the presence of the boot= attribute which only makes sense
in combination with the kiwi initrd_system. If boot= is
set but initrd_system="kiwi" is not, a message is raised that
explains the situation and either requests setting initrd_system
properly or deleting the boot attribute. The change only
affects people who still use oem with a boot="oemboot/..."
setting and no explicit selection of kiwi as the initrd_system.
As these image type configurations should not be in use anyway
because this is all legacy and announced to go away, we
need to make the next step and enforce a new default in
code. This is related to Issue #1299
2020-09-11 09:49:17 +02:00
Marcus Schäfer
8e147b6ff3
Added check_syslinux_installed_if_isolinux_is_used
ISO images that are configured to use isolinux requires the host
to provide a set of syslinux binaries. The runtime check makes
sure to check for this condition early including a proper message.
This Fixes #1376
2020-04-22 11:42:59 +02:00
Marcus Schäfer
44a1d78e96
Added new image type: wsl
Support for building appx container images for
Windows Subsystem Linux (WSL). This Fixes #1235
2020-03-26 19:42:25 +01:00
Marcus Schäfer
46a97c96c7
Added check_volume_setup_defines_reserved_labels
Check to prevent using reserved filesystem labels in LVM
volume definitions
2019-11-25 12:05:57 +01:00
Marcus Schäfer
f8bc05fd42
Refactor use of raises in unit tests
Use raises as context manager instead of a method decorator.
This clearly identifies which code part is expected to raise
an exception. Related to Issue #1128
2019-09-29 19:42:43 +02:00
Dan Čermák
b015b91679
Stop inheriting from object
This is no longer required in Python3
2019-08-22 15:43:27 +02:00
Marcus Schäfer
dab7b8732a
Refactor ISO boot, use grub in EFI mode
Before this commit isolinux was used to boot an ISO and
thus forms a hard requirement. isolinux however only
exists for the x86 platform. This limitation did not
allow to create ISO images for other platforms. With this
commit a refactoring of the ISO boot setup is introduced.

* isolinux is only used if the bios firmware is requested
  and the platform matches the x86 architecture. A runtime
  check will check for this condition and exits early if
  not applicable

* in case of the EFI firmware we already used grub in
  EFI mode but still had isolinux in place for the legacy/CSM
  boot. That part is now also replaced by a platform specific
  grub eltorito image and grub's boot_hybrid.img for hybrid
  boot. On platforms that do not provide those modules the
  support for it will be skipped

With this change in place it's possible to control the ISO
boot layout through the firmware setup and all platform
specific modules are handled as such. Therefore we also
deleted the syslinux requirement. This Fixes #1092
2019-07-02 11:56:02 +02:00
Marcus Schäfer
ca8e7a9534
Make mediacheck runtime check arch independent
The check_mediacheck_only_for_x86_arch runtime check fails on
non x86 architectures but the tagmedia toolchain exists independent
of the platform architecture. This Fixes #1091
2019-05-15 08:55:52 +02:00
Marcus Schäfer
720d34ddd8
Delete check_grub_efi_installed_for_efi_firmware
The motivation is nice to check if the required grub module
package is part of the package list if the efi firmware is
requested, but as long as there is no distribution wide
standard for packaging grub this check will cause more trouble
than it is of help. Currently it failed for the arm architecture
and the grub2-arm64-efi package. We decided to prevent checking
against static lists and dropped this runtime check. Missing
grub modules will be recognized at the grub stage when we
search for them.
2019-04-09 12:08:33 +02:00
David Cassany
c21570ac7b
Add the possibility to disable runtime checks
This commit adds runtime configuration parameters to disable the runtime
checks. This is specially handy if someone does not want to use the kiwi
dracut modules and provide custom ones instead. In orde disable some
runtime check consider a runtime config yaml like:

runtime_checks:
    - disable:
        - check_dracut_module_for_oem_install_in_package_list
        - check_dracut_module_for_live_iso_in_package_list

This commit fixes #893
2019-04-02 16:00:03 +02:00
David Cassany
0baa783965
Add buildah tool support for OCI and Docker types
This commit adds buildah tool support for OCI and Docker types. It
requires buildah and skopeo to be installed in the host. The use of
umoci (kept as default choice) or buildah is configured using the
runtime configuration file; consider the following structure:

```
oci:
    - archive_tool: buildah
```
2019-03-29 10:15:48 +01:00
Marcus Schäfer
00b8213ac9
Check for multiple allsize volumes setup
Added runtime check check_volume_setup_defines_multiple_fullsize_volumes
which reads the volume setup and counts the number of volumes that
define a 'all' volume. Only one is allowed
2019-03-07 11:28:30 +01:00
David Cassany
0f4b0b34bb
Add a runtime check for preferences metadata
This commit adds a runtime check for preferences metadata. More
specfic verifies there is a packagemanager defined and an image version
defined.

Fixes #925
2019-01-28 17:16:31 +01:00
Marcus Schäfer
2983ef0265
Added runtime check for label use
Added check_volume_label_used_with_lvm to check if
custom volume labels are used in the scope of LVM
2018-07-13 10:29:30 +02:00
David Cassany
87769a3201 Add additionaltags containerconfig attribute
This commit adds `additionaltags` attribute, so multiple tags to
a container image can be defined in a comma separated value.

Fixes #713
2018-05-14 17:04:07 +02:00
Marcus Schäfer
a27562d8c4
Update boot description search path
With the move of the boot descriptions in its own package
the kiwi search path needs to be adapted to look for boot
descriptions in /usr/share/kiwi/custom_boot. In addition
a runtime check to exit early if the boot description could
not be found or is not specified will be provided. Related
to Issue #576
2018-02-13 12:27:15 +01:00
Robert Schweikert
d6a67460cb
- Expand consistency check for grub efi package to cover debian based
and RH distros
2018-02-05 18:33:10 -05:00
Robert Schweikert
7cff2e93b9
- Early exit if firmware is efi or uefi but the expected grub module is
not part of the package list
2018-02-05 09:29:07 -05:00
Marcus Schäfer
f704c3c7b2
Added runtime check for dracut-kiwi-oem-dump
The installation of the above mentioned dracut module package
is required for oem images which uses dracut as initrd system
and have the creation of an installation image requested.
This is related to Issue #576
2018-01-17 14:59:59 +01:00
Marcus Schäfer
6f39ddde91
Added runtime check for dracut-kiwi-oem-repart
OEM images if configured to use dracut as initrd system
requires the KIWI provided dracut-kiwi-oem-repart module
2017-11-15 12:41:27 +01:00
Marcus Schäfer
054a7e072b
Extend checkmedia runtime check
In addition to the correct architecture the check also includes
the lookup of the required tagmedia tool to be present on the
building host. This Fixes #538
2017-11-06 16:32:28 +01:00
Marcus Schäfer
77fa8de510
Make get_initrd_system a state method
Make sure the default initrd_system is set to dracut
for the vmx image type and to kiwi if no initrd_system
is specified. This allows to simplify other code parts
as we can trust there is a value set
2017-09-06 18:01:37 +02:00
Marcus Schäfer
f7f8ee0057 Added runtime checks for overlay disk images
Checking if the dracut-kiwi-overlay package will be installed
as part of the build and also for the supported EFI setup
since the EFI secure boot setup would try to perform changes
on the filesystem which is a readonly squashfs, this is not
supported
2017-09-06 17:08:10 +02:00
Marcus Schäfer
b0074c2132 Added runtime check for dracut module on live iso
Live ISO images uses a dracut initrd to boot and requires
the KIWI provided kiwi-live dracut module to be installed
at the time dracut is called. Thus this runtime check
examines if the required package is part of the package
list in the image description
2017-09-06 09:53:18 +02:00
Marcus Schäfer
40b9973611
Update expected compatible major version
every version of umoci/skopeo <= major v1.x.x is expected
to work with the implementation used in kiwi
2017-08-01 15:33:42 +02:00
Marcus Schäfer
2e0bb07665
Extend scope of check_docker_tool_chain_installed
The runtime check only checks for the presence of the docker
tools umoci and skopeo but as we are expecting incompatible
api changes in the next major version release the check has
been extended to look at the major versions of the installed
tools as well. Fixes #454
2017-08-01 10:24:17 +02:00
David Cassany
642b514a59 Add runtimecheck for mediacheck attribute on non x86 hosts
This commit rearranges some method and variable names and includes
a new runtimecheck to ensure the mediacheck attribute is not set
when building non x86 images.

Patch related to bsc#1049304
2017-07-27 15:44:37 +02:00
Marcus Schäfer
d13f1cca29
Added Xen setup runtime validation
Added check_xen_uniquely_setup_as_server_or_guest runtime
check to check for a unique dom0 or domU guest setup
Fixes #429
2017-07-24 16:30:34 +02:00
Marcus Schäfer
dee0a5af7f Refactor handling of obs repositories
* Delete kiwi internal ibs: and suse: types
* Delete handling for --obs-repo-internal and provide a
  compatibility message to the user
* Buildservice download server url and scope can be configured
  via ~/.config/kiwi/config.yml
* Translate obs urls to http in import_repositories_marked_as_imageinclude
* Use new Uri.is_public method in renamed runtime check
  check_image_include_repos_publicly_resolvable
2017-07-05 16:07:29 +02:00
Marcus Schäfer
51c2b42a5d
Fixup check_target_directory_not_in_shared_cache
The runtime check compared the given target path if it starts
with the cache directory /var/cache/kiwi. This however also
matches for e.g /var/cache/kiwi-foo which would be a valid
target directory. This patch changes the matcher in a way to
really check if the target directory points to the same cache
directory structure.
2017-05-15 11:27:02 +02:00
Marcus Schäfer
2ecf8b98b9 Merge pull request #263 from SUSE/no_relative_imports
No relative imports
2017-03-07 15:01:45 +01:00
Marcus Schäfer
6cc0b2085d Flake cleanup for unit tests 2017-03-07 13:03:10 +01:00
Marcus Schäfer
de3441d7f1
Add runtime check for kernel match
If a kiwi initrd is used, the kernel used to build the kiwi
initrd and the kernel used in the system image must be the
same in order to avoid an inconsistent boot setup. This is
related to (bsc#1027610)
2017-03-06 10:57:28 +01:00
Marcus Schäfer
a03a1e0e27 Added runtime check for boot image reference
If an initrd_system different from kiwi is selected for a
vmx (simple disk) image, it does not make sense to setup a reference
to a kiwi boot image description, because no kiwi boot image will be
built. Despite that it does not hurt it's still an inconsistent
setup. This is related to (bsc#1027610)
2017-03-06 09:18:35 +01:00
Marcus Schäfer
889ce8a98b Add check_docker_tool_chain_installed
Runtime check to check for required docker tools umoci and
skopeo. As long as tools tools are not available in the
core distro of all distributions we avoid spec file requirements
and check at runtime if they can be found
2017-02-27 15:28:38 +01:00
Marcus Schäfer
e3bb8e77f1
Added check_volume_setup_has_no_root_definition
The root volume in a systemdisk setup is handled in a special
way. It is not allowed to setup a custom name or mountpoint for
the root volume. Therefore the size of the root volume can be
setup via the @root volume name. This check looks up the volume
setup and searches if there is a configuration for the '/'
mountpoint which would cause the image build to fail
2016-12-05 12:24:57 +01:00
Marcus Schäfer
d4d711f9e3 Make repository an optional element
So far one repository was mandatory in the XML description.
However, this is not required because all repositories can
be specified on the commandline
2016-08-18 15:34:37 +02:00
Marcus Schäfer
a64a3cbc9a
Added check_target_directory_not_in_shared_cache
Runtime checker method to check if the target directory
was set to - or below the shared cache directory
2016-05-04 18:24:11 +02:00
Marcus Schäfer
3b7c4217eb Add check_image_include_repos_http_resolvable
Runtime checker method to check if repositories marked
with the imageinclude attribute are using a publicly
available protocol
2016-04-29 14:30:15 +00:00
Marcus Schäfer
a07bbcac89 Added RuntimeChecker class
An instance of RuntimeChecker allows to semantically check for
error conditions according to the provided image description
and build options. Related to #20
2016-04-29 14:30:01 +00:00