Commit Graph

110 Commits

Author SHA1 Message Date
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
ca75086128
Prevent swap partition to be the last one
In an OEM deployment that requested the creation of a swap
partition via <oem-swap> that swap partition was created
at first boot and was always the last partition on the disk.
This was required because it could not be placed before
any other partition without destroying those partition
contents. This process leaves the system in an inflexible
condition if the storage device can change its geometry
dynamicly as it's the case for SAN systems. The typical
deployment target for OEM images are SAN storage clusters
and it's cumbersome to resize the root partition if swap
is last.

This commit Fixes #1231 and changes the handling of swap if
requested via <oem-swap> as follows:

1. The swap space is created as part of the image build process
   and no longer on first boot of the image via dracut code.
   This increases the size of the non compressed .raw disk image
   by the configured swap space size or the default. The
   compressed versions are not affected since zero initialized
   swap space compresses to almost no space. Deployment of
   the image however also deploys the swap partition which
   increases deployment time. For big swap configurations
   it's advisable to switch off image verification via
   oem-skip-verify. For very big swap configurations it's
   also recommended to prevent kiwi from adding them as part
   of the image and let them be created on first boot via
   a systemd service that e.g places a swap file, or creates
   a swap volume when possible such that the fexibility to
   resize the rootfs is still available.

2. The setup of the swap space is now explicit. It's no longer
   calculated by twice times RAM size because on newer machines
   this could lead to huge numbers. Either the kiwi encoded
   default swap size applies or the user configured value.

3. LVM based oem disks creates the swap space as logical volume.
   The volume is created as part of the image build process
   and no longer on first boot. The swap volume at build time
   of the image is of a minimal size and gets resized on first
   boot.

4. The move of the swap creation into the builder code also
   handles swap per configured device persistency schema like
   any other devices. This means by default swap is mounted
   via by-uuid name and thus also Fixes #1259
2019-11-25 12:05:57 +01:00
David Cassany
80e791d2ef
Make home attribute optional on users definition
This commit makes home attribute of users definition optional. This way
the home directory is created according to the distribution defaults.
Note that `-m` option is passed to user add, thus the home directory is
requested to be created even without having an explicit home path
defined.

Fixes #1025
2019-10-23 15:57:51 +02:00
Marcus Schäfer
defdc23fcf
Follow up patch for SourceType info
The message that display the selected source type was
using the former metalink text which is wrong. This
patch corrects the message and only display it if a
sourcetype was specified
2019-09-30 16:39:16 +02:00
Marcus Schäfer
30e18d1398
Added support for fscreateoptions attribute
Along with the fsmountoptions attribute there is now also the
fscreateoptions attribute which allows to control the options
used for creating the filesystem. Please note, it's not kiwi's
task to validate that the given option string is supported
by the selected filesystem. This means providing wrong values
here will cause the build to fail at the time the filesystem
gets created. This Fixes #1109
2019-07-18 15:55:39 +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
ab59d4d217
Delete obsolete repository types
Deleted red-carpet, slack-site, up2date-mirrors, urpmi and yast2
from the allowed values list of the repository type attribute.
This Fixes #1029
2019-04-22 23:15:42 +02:00
Marcus Schäfer
4a21fcfb05
Auto upgrade all image descriptions to v7.0 schema 2019-04-05 14:28:55 +02:00
Marcus Schäfer
c148d661b9
Deleted pxedeploy section
There is no further demand in the client config creation for the
legacy netboot code. Customers using the netboot initrd already
create the client config.<MAC> file manually or through another
system. With the next generation kiwi we also recommend the disk
based network deployment using the dracut capabilities and marked
the netboot code as still supported but on the legacy stream.
Along with the deletion in the schema the following changes
were also done:

* Deleted use of pxedeploy section in implementation
* Increase schema version to v7.0
* Update documentation on schema version update
* Added xsl stylesheet conversion from v6.9 to v7.0
  Automatic schema version upgrade from v6.9 to v7.0 deletes
  the pxedeploy section from any type specification

This Fixes #19
2019-04-05 14:26:54 +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
Marcus Schäfer
b43ac0f24f
Cleanup example_dot_profile_config.xml
Don't use multiple all size volumes
2019-03-07 14:02:55 +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
Dan Čermák
2b17684d2c
Add support to build vagrant boxes with the Virtualbox provider
This commits adds initial support to build Vagrant boxes with the Virtualbox
provider.
- The attribute 'provider' of the option <vagrantconfig> now supports the option
  "virtualbox".
- A new boolean attribute 'virtualbox_guest_additions_present' was added to
  <vagrantconfig>. When set to true, KIWI will assume that guest additions have
  been installed into the base image and configure the shared folders to use
  vboxfs, otherwise rsync will be used.

This fixes #532 (https://github.com/SUSE/kiwi/issues/532).
2019-03-05 15:33:18 +01:00
Marcus Schäfer
ed6c11f7d6
Added get_description method to XMLState
In preparation to access the contents of the <description>
section this pull requests adds a simple method to read
the contents.
2019-02-26 15:20:21 +01:00
Marcus Schäfer
f8265bb607
Added new preferences subsection
In the preferences section the following optional subsection
can be configured:

   <rpm-locale-filtering>true|false</rpm-locale-filtering>

If set to true the default locales POSIX, C, and C.UTF-8 are
applied as rpm install_lang macro. If the locale section is
configured in addition the list is extended by that information
too
2019-02-08 16:56:56 +01:00
Marcus Schäfer
fad1c0f1ef
Added support for %_install_langs rpm macro
During the image build the custom rpm macro %_install_langs
is configured with the <locale> setup from the KIWI XML
description. This allows to filter language specific packages
on the rpm level and Fixes #771
2019-02-07 16:05:25 +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
3346f3028f
Make result compression in the bundler optional
Calling kiwi result bundle will take the image build results
and bundle the relevant image files according to their image
type. Depending on the result configuration this could instruct
the bundler to compress one or more files from the result.
By default this compression is switched off in the bundler but
can be activated to save storage space and speedup download
of the image with the following runtime configuration:

bundle:
  - compress: true|false

If compression is activated the result image has to be
uncompressed before it can be used. This Fixes #901
2019-01-10 16:13:02 +01:00
David Cassany
9601ab669c
Fix disk size calculation for VMX
Disk size calculation must take into account the empty volumes that
are to be mounted in a directory that does not exist in the root tree
otherwise there is KeyError. The result of
storate/setup._calculate_volume_mbytes must be a dict including all
defined volumes.

Fixes #904
2018-12-18 14:56:54 +01:00
David Cassany
f0612486dd
Add history metadata for container builds
This commit adds the history section in contianerconfig. With it
'author', 'created_by' and 'comment' can be customized. In addition
'created' is always included with the image creation date time.
'created_by' entry is set to 'KIWI __version__' by default if nothing
is provided.

Fixes #852
2018-11-08 15:33:04 +01:00
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