Commit Graph

90 Commits

Author SHA1 Message Date
Marcus Schäfer
e51b91cb38
Added OCI tooling interface class
An initiative to formulate industry standards around container
formats and runtime is available at https://www.opencontainers.org
Different tools to implement the specifications had been
created. The purpose of this class and its sub-classes is
to provide a common interface in kiwi to allow using all
tools such that the container support in kiwi covers every
linux distribution no matter what tooling was preferred.
Related to Issue #859
2018-10-30 09:35:58 +01:00
Marcus Schäfer
d30cd0e902
Delete dmraid aka: softraid soft/fakeraid support
In fate#323743 the decision was made to drop dmraid from
the distribution. Along with the low business case for those
controllers and the support for linux softraid via mdadm
we also drop the support in kiwi for oem-ataraid-scan
2018-08-06 12:23:53 +02: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
Marcus Schäfer
c32121704d
Support label attribute in volumes
The optional label attribute in a volume section allows
to specify a filesystem label for the selected volume.
The label setup will have no effect on filesystems
which implements their own volume management like it's
the case for btrfs. This Fixes #738
2018-07-11 13:07:31 +02:00
David Cassany
dd21e6c8d7
Add '--add-container-label' flag
This commits adds a command line flag to add a label for container image
types. The flag can be used multiple times.

Fixes #770
2018-07-06 14:11:00 +02:00
David Cassany Viladomat
29a812a7f7
Merge branch 'master' into containers_multitag_support 2018-05-15 14:38:45 +02:00
Marcus Schäfer
e97629ba47
Make container compression a configuration option
Change the ContainerBuilder class to evaluate on the
configuration options to decide if the container archive
should be compressed or not. By default the archive will
be compressed, thus there is no change to the former behavior
but can be setup in ~/.config/kiwi/config.yml as follows:

container:
  - compress: none|xz

This Fixes #725
2018-05-15 11:18:22 +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
David Cassany
f055ac1296 Add uninstall pacakges type
This commit adds a new `uninstall` type for packages. Packages listed
with this type will be removed by the package manager cleaning also any
unneeded dependency. The removal is executed after running `config.sh`.

Also in this commit `delete` type for packages is now executed after
`uninstall` packages, meaing it also happens after `config.sh`.

Fixes #625
2018-05-04 15:00:31 +02:00
David Cassany
9dcf00e4d1 Some improvements on size calculation
This commit simplifies the unpartitioned area size calculation.

Fixes #709 and it is related to fate#323874
2018-04-23 15:45:38 +02:00
David Cassany
74aa8a5c14 Adding unpartitioned size attribute
This commit adds the possibility of setting some unpartitioned area
after the systemdisl partition into the image.

Fixes #709
2018-04-20 17:04:33 +02:00
Marcus Schäfer
4fc38a2b09
XSL Auto update descriptions due to schema change 2018-03-23 09:42:24 +01:00
Marcus Schäfer
73fb397717
Allow to configure iso tool category
Switch to xorriso by default but allow to setup cdrtools
in the runtime configuration file
2018-03-22 11:18:54 +01:00
David Cassany
703747c718 Make build type mandatory in XMLState 2018-03-14 17:59:23 +01:00
David Cassany Viladomat
990f7ed1a8
Merge pull request #660 from SUSE/profile_dependencies
Add profile dependencies
2018-03-12 11:44:35 +01:00
David Cassany
967bde8385 Add profile dependencies
With this commit the profile can include other profiles as a dependency.
This way it is possible build an image defined by multiple profiles by just
calling a single composed profile from the command line.

Fixes #658
2018-03-12 09:18:54 +01:00
Marcus Schäfer
4fdf4b646a
Use dracut modules based on feature use
As the kiwi build dracut initrd is a generic one which
includes all installed dracut modules we missed a way to
exclude modules from beeing incorporated even if we know
it would not be needed. One example is the multipath module
which would only be useful if the oem multipath scan is
configured in the image description
2018-03-08 15:58:38 +01: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
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
f304802c53 Auto update all schema descriptions to v6.8 2018-01-17 10:19:37 +01:00
Marcus Schäfer
fce043d6eb Only add package manager on image package requests (#550)
If an image description only contains package requests
from a bootstrap section but no image packages, it's not
required to install a package manager package into the
system
2017-11-21 10:57:36 +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
c1668bcfc5 Added additional required attr schematron rule
The new rule allows to check for required attributes for a specific
image type and is used for the filesystem attribute which is required
for the image type oem, vmx and pxe. This Fixes #476
2017-09-12 12:39:49 +02: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
e59270c09b
Added handling of formatoptions attribute
Custom disk format options passed in the formatoptions
attribute were not handled. In addition options with a
value passed to qemu were handled in the wrong way.
This commit addresses both problems and Fixes #463
2017-08-11 15:46:40 +02:00
Marcus Schäfer
747206b2bf
Fix calculation of needed disk space for oem types
The calculation did not include the minimum volume requirements
if a volume setup exists
2017-08-02 11:57:21 +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
821f20291d Auto update image descriptions to schema v6.7 2017-07-27 14:46:47 +02:00
Marcus Schäfer
ff764f7dd9
Fixup encoding handling for profile file
If an element like displayname or oem-boot-title contains
characters outside of the ascii table this causes trouble
when kiwi writes out the profile file and the code is called
through python2. The reason here is that the default encoding
on write() (and other methods) is set to ascii in python2
and when it receives unicode characters outside of the
ascii spec a UnicodeEncodeError is thrown. Now all of kiwi
is using Unicode which means this does not produce a problem
when calling the code through python3 because the default
encoding is utf-8 there. This patch introduces a method
which allows to change python's default encoding and calls
it at the code point where we write the profile because we
got unicode and we want to write unicode in any case.
This fixes at least one situation for python2-kiwi to
allow the use of non ascii characters in the XML setup.
If other places will be found the same approach should allow
to fix it for python2
2017-07-25 16:58:29 +02:00
Marcus Schäfer
d7d631c8a7 Apply schema v6.6 stylesheet to XML descriptions
Updates all XML descriptions to latest schema version and
also includes adaptions to the test XML descriptions for
testing the new Xen guest and server setup
2017-07-20 10:34:37 +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
David Cassany
3ad92a1477 Translate obs to suse derived from image uris
This commit performs a translation from obs scheme to suse
scheme for derived from image uris when kiwi is running in a
buildservice worker.

Fixes #399
2017-06-30 12:16:58 +02:00
David Cassany
4f18d2da22 Flag --ignore-repos do not ignore imageonly repos
This commit fixes #395, with it, using --ignore-repos, does not
delete imageonly repositories from the description file. This way
imageonly is prepared to be used in the buildservice even when using
the 'obsrepositories:/' reference style.
2017-06-27 10:02:42 +02:00
Marcus Schäfer
6517d3b568 Added RuntimeConfig class
An instance of RuntimeConfig reads in ~/.config/kiwi/config.yml
if present and provides access methods to the expected
information of the config file
2017-06-14 18:13:50 +02:00
David Cassany
475a5ab526 Handle rpm-check-signatures flag for each package manager
This commit adds support for the rpm-check-signatures flag, which
sets the package manager to verify or not each package signature.
By default KIWI assumes no gpg checks are done.
2017-05-15 19:38:53 +02:00
David Cassany
b26969d53c Add clear attribute for entrypoint and subcommand sections
This commit adds the possibility of clearing asny subcommand or
entrypoint. This is relevant for docker derived images, as they
inherit the configuration and it might lead to some bad behavior.
2017-04-24 11:59:45 +02:00
David Cassany
1fe0c9a266 Import root system from a given image
This commit includes the root import feature. A `derived_from`
attribute has been included with the <type> section to make
reference to the image file to import. The image format to import
is assumed to be the same as the build type to import.

The current format supported is docker
2017-03-07 15:14:03 +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
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
3e6848ed88 Refactor docker container creation
Instead of creating a simple tarball the tools umoci and skopeo
from the docker tool chain are used to create official docker
images. Along with those tools more information to describe a
container has been added to the schema. A complete container
setup now consists of the following elements

<type image="docker">
    <containerconfig name="..." maintainer="..." user="..." workingdir="...">
        <entrypoint execute="command">
            <argument name="option"/>
            ...
        </entrypoint>
        <subcommand execute="command">
            <argument name="option"/>
            ...
        </subcommand>
        <expose>
            <port number="..."/>
            ...
        </expose>
        <volumes>
            <volume name="..."/>
            ...
        </volumes>
        <environment>
            <env name="variable" value="value"/>
            ...
        </environment>
        <labels>
            <label name="..." value="..."/>
            ...
        </labels>
    </containerconfig>
</type>
2017-02-27 15:28:38 +01:00
Marcus Schäfer
9728b698a2
Added handling for spare_part attribute
Add a spare partition right before the root partition of
the configured size. Fixes #234
2017-02-08 17:19:37 +01:00
Marcus Schäfer
85f9b2bc4c Added new type attribute spare_part
spare_part receives a size value with an optional unit (M|G)
and is used for disk images to allow the creaton of a spare
partition of the configured size. Issue #234
2017-02-08 16:28:47 +01:00
Marcus Schäfer
865f3bb2ca
Delete all traces of vboot firmware
The vboot firmware setup was a workaround on arm for the
chromebook platform several years ago. From a todays
perspective the setup and the way to boot would be different
and obsoletes the special case implementation. Thus this
is gone now. Related to Issue #234
2017-02-08 15:53:10 +01:00
Marcus Schäfer
7141ee16e4
Added arch attribute for ignore section
The packages subsection <ignore> only accepted a package
name to become ignored. However a <package> subsection
to install a package allows for an arch selection. The
same should apply to ignore a package. In addition the
allowed content for the arch attribute has been changed
from simple text to a regular expression. Allowed is a
comma seperated list of reserved architecture words like
they are displayed by uname -m
2017-02-01 15:30:06 +01:00
Marcus Schäfer
d2c5f64434
Added support for package locking for zypper
Zypper supports the al (add lock) command which allows to ignore
a package in the dependecny resolution process. This is useful
to prevent installation of a package which was pulled in by e.g
a recommendation flag from the spec file. Packages marked to be
ignored are not handled for apt and yum right now. Using this
feature together with an unsupported package manager backend
results in a warning to the user
2017-02-01 11:14:32 +01:00
Marcus Schäfer
374be7c042 Completion for grub bootloader configuration
The configuration files /etc/sysconfig/bootloader and
/etc/default/grub needs to be created/updated with the
relevant values regarding the bootloader setup done by
kiwi. This Fixes #226
2017-01-23 17:24:04 +01:00
Marcus Schäfer
2411c3352d Added attributes element in volume type 2017-01-20 10:26:14 +01:00
Marcus Schäfer
760c88682f
Update container builder code to new schema layout 2017-01-09 11:30:01 +01:00
Marcus Schäfer
3c7ba8b924
Auto update image descriptions to schema v6.5 2017-01-09 11:04:10 +01:00
Marcus Schäfer
f549b03886 Added DiskFormatVagrantLibVirt class
Allow to build vagrant boxes for the libvirt provider
This Fixes #15
2016-12-12 11:27:19 +01:00