Commit Graph

64 Commits

Author SHA1 Message Date
Marcus Schäfer
e3e0d888c8
Added support for repo customization script
repo files allows for several customization options
which could not be set by kiwi through the current
repository schema. As the options used do not follow
any standard and are not compatible between package
managers and distributions the only generic way to
handle this is through a script which is invoked
with the repo file as parameter for each file created
to describe a repo for the selected package manager.
This allows users to update/change the repo file content
on their individual needs. In the kiwi description the
path to the custom script can be specified as follows

    <repository ... customize="/path/to/custom_script">
        <source path="..."/>
    </repository>

This Fixes #1896
2021-08-10 10:10:01 +02:00
Marcus Schäfer
47d48c1a89
Update unit- integration tests to schema v74 2021-03-15 16:13:02 +01:00
David Cassany
43bec23db2
Add the schematron rules for installinitrd
This commit adds an schematron rule to limit the presence of
installinitrd element to disk builds including installation media.
2021-01-26 22:21:31 +01:00
David Cassany
6366624ef1
Add the installinitrd element
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 #1676
Fixes #1683
2021-01-21 16:33:43 +01:00
David Cassany
a01b83a361
Add 'arch' attribute to preferences
This commits adds the attribute 'arch' to preferences. It works
as any other 'arch' attribute within the schema. Preferences defined
with architectures that do not match the host are ignored. If no 'arch'
is provided it matches all any host architecture.

Fixes #1640
2020-12-16 14:00:24 +01:00
Marcus Schäfer
7957374de2
Allow to customize swap volume name
Added a new element <oem-swapname> below the <oemconfig>
section which allows to specify a name for the swap volume
in case the LVM volume manager is used. The default if
not specified continuous to stay at: LVSwap. This
Fixes #1638
2020-12-11 13:13:03 +01: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
feaf6b0863
Refactor setup of bootloader parameters
The bootloader settings are handled through attributes in the
type element. Over the years some attributes were added and
there are requests for more settings. Therefore the bootloader
setup deservers its own section. With this commit the schema
changes from v7.1 to v7.2 and moves bootloader, bootloader_console
boottimeout and zipl_targettype into a new bootloader subsection
below type. The commit also adds an auto transformation template
such that customers don't have to change their image descriptions.
This is related to Issue #1401
2020-05-08 13:30:43 +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
04b345e7aa
Added support for spare partition fs attributes
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
2020-01-15 16:15:48 +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
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
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
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
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
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
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
f304802c53 Auto update all schema descriptions to v6.8 2018-01-17 10:19:37 +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
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
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
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
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
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
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
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
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
David Cassany
21dfce6595 Parse arch attribute as a comma separated list
This commit ensure that the arch attribute of each package section
is parsed as a comma separated list. This way, as in previous kiwi
versions, each package might be suitable for one or more specified
architectures.
2016-11-24 12:26:04 +01:00
Marcus Schäfer
45d9a1eaa3
grub.cfg: Fixes for btrfs as rootfs
This addresses the following issues

* An image based on btrfs using the entire boot as a subvolume
  causes grub to be unable to find its config file. Thus kiwi
  now raises an exception in this situation

* Don't prefix the bootpath with the snapshot path if the
  btrfs root is placed in a snapshot. Instead the file
  etc/default/grub must be written/updated with the
  SUSE_BTRFS_SNAPSHOT_BOOTING variable set to true. Once
  this is done the bootpath is consistently set to /boot
  no matter which snapshot is active
2016-11-09 17:15:56 +01:00
David Cassany
25bb84b148 Corrections on test kiwi description files
Some attributes needed to be changed in the test xmls. With this
commit all the description files are consistent with the new co-
occurrence constraints.
2016-10-24 13:07:06 +02:00
Marcus Schäfer
9ee697f87a
Add evaluation of machine's vmconfig_entry
As part of the machine section it is possible to setup a custom
entry which is stored in the machine configuration file. The
evaluation of such an entry for the vmdk (.vmx) config file
was still missing. This Fixes #122
2016-08-23 12:03:18 +02:00