Commit Graph

1138 Commits

Author SHA1 Message Date
Marcus Schäfer
38482cc70c
Merge pull request #1560 from OSInside/set_default_values_for_containers
Get default maintainer and author from image description
2020-09-21 15:50:22 +02:00
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
David Cassany
ac7bed3221
Get default maintainer and author from image description
This commit sets the maintainer and author metadata from the description
section of the image in they are not explicitly specified in
container-config section.

In addition it sets the default container name to `system-container`
instead of `systemContainer` as uppercase letters are not valid for
docker container references.

Fixes #1419
2020-09-21 10:24:31 +02:00
Marcus Schäfer
7506c651c6
Merge pull request #1552 from OSInside/oem_superset_of_vmx
Make oem be a superset of vmx
2020-09-16 15:00:37 +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
David Cassany
cb7b7673e8
Fix the early boot grub.cfg file
This commit makes sure that the early boot configuration files
for grub make use of the proper boot path and omiting the `/boot`
prefix if there is a dedicated boot partition.

Fixes #1553
2020-09-16 11:35:00 +02:00
David Cassany
3bb2ab77fb
Include loadenv as a default module for grub images
This commit includes the 'loadenv' module to the list of basic grub
modules. This makes sure the module is included in any grub-mkimage
that KIWI does.

Fixes #1547
2020-09-14 22:07:23 +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
988404ff9f
Support dynamic linux/linuxefi in any case
Instead of restricting the dynamic linux vs. linuxefi setup
to a specific grub version, support this setup for any version
of grub. This Fixes bsc#1175729 and bsc#1176134
2020-09-08 18:14:15 +02:00
Marcus Schäfer
5ec3386afd
Merge pull request #1521 from OSInside/grub_loader_entries_option_handling
Make sure kernel options are respected by grub
2020-08-10 15:11:31 +02:00
David Cassany Viladomat
fc85191564
Merge pull request #1519 from OSInside/fix_scope_of_remove_hierarchy
Fixed scope of remove_hierarchy
2020-07-27 12:20:04 +02:00
Marcus Schäfer
d7cd5b555d
Make sure kernel options are respected by grub
Set options variable in grub loader/entries to match the
kiwi image description setup. This adaption currently
happens only when building in OBS because in this env
the options setup done by grub is a complete mess.
2020-07-22 22:33:15 +02:00
Marcus Schäfer
1c5fcfaecd
Merge pull request #1516 from OSInside/fix_grub_setup_in_efi_path
Fixed grub setup in EFI/BOOT directory
2020-07-22 14:16:44 +02:00
Marcus Schäfer
3698e31bdf
Fixed scope of remove_hierarchy
The remove_hierarchy method walked through the entire path
it was given. That included the root path which is beyond
its scope. This Fixes #1515
2020-07-22 11:32:28 +02:00
Marcus Schäfer
b9824f7b62
Fixed corrections in BootLoaderSpec grub config
Distributions like Fedora RawHide or CentOS8 applies to the
grub BootLoaderSpec as described here:

    https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec

Part of the spec is that menu entries are handled in extra files
below /boot/loader/entries. Unfortunately the grub2-mkconfig code
has still no clue how to find the correct root device in special
environments like obs workers or in overlay systems. To fixup the
result of grub2-mkconfig there is code in kiwi which needs to be
adapted because the file that contains the wrong information is
now no longer grub.cfg but some /boot/loader/entries/*.conf file.
This commit solves the issue.
2020-07-22 10:36:24 +02:00
Marcus Schäfer
3255264d4c
Fixed grub setup in EFI/BOOT directory
kiwi copied the same grub.cfg file as it exists in boot/grub2
to the efi path. This is wrong as the setup in the efi boot
directory is used to enable normal grub loading and not providing
the user grub configuration. In addition the changes here makes
sure that the early grub boot code is placed into the system
in any EFI case except for secure boot when shim-install is
present. If shim-install is present it also creates the early
grub boot setup such that kiwi doesn't have to do it.
This Fixes #1491 and Fixes bsc#1172908
2020-07-22 09:41:08 +02:00
Marcus Schäfer
8a7d2d8678
Merge pull request #1514 from OSInside/rsync_inline
Use rsync in inplace transfer mode
2020-07-20 10:36:47 +02:00
Marcus Schäfer
47167fd486
Use rsync in inplace transfer mode
Using the --inplace option in rsync helps to save space on
syncing the rootfs data and prevents e.g OBS workers from
running out of VM space when transfering root filesystem
data. Also using --inplace allows to keep hardlinks intact.
This is related to bsc#1096738
2020-07-15 16:56:28 +02:00
Marcus Schäfer
6b2c4f88bb
Don't keep copy of grub2-install in the system
To prevent shim-install from calling grub2-install in uefi mode
kiwi temporary replaces the tool by a noop. This acts as a
workaround for an issue in shim-install. However the workaround
left a file copy of grub2-install in the system which should
not happen. This commit Fixes bsc#1173226 and Fixes #1490
2020-07-15 14:38:47 +02:00
David Cassany
4f0bdddddc
Do not create a md5 checksum output file for archive images
This commit removes the creation of the md5 file that includes a
checksum of the image binary for the `tbz` image type. Removing it
as this is the only image type that includes it as part of the result
and because the bundle procedure already creates a sha256 file out of
the results, so there is still the chance to produce validation
checksums.
2020-07-08 06:53:11 +02:00
Marcus Schäfer
ed22674468
Merge pull request #1495 from OSInside/factory_refactor
Refactor FileSystem Factory
2020-07-07 10:57:58 +02:00
Christian Schneemann
61803a30bd
Fixed oem recovery tar parameter order
Reorder tar parameters

When building an oem-image with oem-recovery set to true a tar error appears saying:
"The following options were used after any non-optional arguments in archive create or
update mode". This commit fixes the order of arguments to tar to avoid the error condition.
Fixes #1501
2020-07-03 10:33:05 +02:00
Marcus Schäfer
0fee3bbb60
Refactor FileSystem Factory
With regards to Issue #1486 a discussion came up that the
way factories are implemented are questionable when thinking
about strong typing for the public kiwi interface. This
commit refactors the FileSystem factory to be a real factory
and to add type hints such that its use from an api perspective
is clear and enforced.
2020-06-29 22:38:31 +02:00
Marcus Schäfer
301abaaffc
Merge pull request #1493 from OSInside/fix_live_ISOs
Fixes live ISOs
2020-06-25 16:42:30 +02:00
David Cassany
6c165ec7a9
Fixes live ISOs
This commit fixes iso images. Due to a change introduced in c7ed1cf
live ISOs were no longer booting as the rootfs.img filesystem was
copied to the squashfs container while being still mounted. Because of
that, at boot time, it refused to mount.

This commit adds umount method for the filesystem base class, so it
can be umounted before deleting the instance.

Fixes #1489 and bsc#1173356
2020-06-25 16:30:32 +02:00
David Cassany
6196893261
Remove /etc/sysconfig/language support
As of SLE15 and onwards /etc/sysconfig/language is considered to be
obsolete and just kept for compatibility purposes. Thus there is no
need to manage the file anymore.

Fixes #1471
2020-06-12 15:43:37 +02:00
Marcus Schäfer
c009e6a393
Fixed permissions of custom boot image root dir
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
2020-06-09 13:55:44 +02:00
Marcus Schäfer
fe123fb267
Added new post disk sync script hook
Allow to put a disk.sh script as part of the image description
which is called for the disk image types `vmx` and `oem`
only and runs after the synchronisation of the root tree into the
disk image loop file. At call time of the script the device name
of the currently mapped root device is passed as a parameter.
The chroot environment for the call is the mounted disk itself
which makes this different from the config.sh/images.sh caller
environment. This Fixes #1464
2020-06-06 16:29:24 +02:00
Marcus Schäfer
e9e1b00b09
Fixed VolumeManager cleanup
instances of VolumeManager creates temporary directories but
only stores the latest one. The cleanup leaves former directories
behind which is fixed by this commit
2020-06-02 15:04:55 +02:00
Marcus Schäfer
c7ed1cfc29
Allow to access disk root after sync_data
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
2020-06-02 12:52:49 +02:00
Marcus Schäfer
d7f0f72afb
Merge pull request #1458 from OSInside/fix_dracut_outfile_format_detection
Fixed dracut output file format detection
2020-05-26 15:15:20 +02:00
David Cassany
70bf9e98de
Fix the patch applied on grub.cfg
This commit fixes the patch applied on grub.cfg when EFI mode is
selected and grub < 2.04. There are some distros that make use of the
`linux16` command instead of `linux` in grub configuration, this commit
extends the regex to also consider `linux16` command.
2020-05-26 12:41:15 +02:00
Marcus Schäfer
f57f0ff96a
Fixed apt and pacman repository unit tests
The way the post_init method was used to test custom arguments
leads to a broken I/O wrapper. As consequence the test failed
when called with "pytest -s" and also leaves files around from
other test I/O redirections.
2020-05-26 11:48:15 +02:00
Marcus Schäfer
ecf0110ace
Merge pull request #1456 from OSInside/fix_linuxefi_mod
Fix scope for linuxefi grub config adaption
2020-05-25 16:21:13 +02:00
Marcus Schäfer
f1303396f9
Fixed dracut output file format detection
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
2020-05-25 14:31:49 +02:00
Marcus Schäfer
500fab909c
Fixed line ending of sha256 bundler file
The .sha256 file does not end with a newline. This Fixes #1449
2020-05-25 12:44:19 +02:00
Marcus Schäfer
024c3b6834
Fix scope for linuxefi grub config adaption
In kiwi we support a one time patch for the grub config file
that changes the static use of linuxefi to be dynamic. In
grub2 >= 2.04 all this has already been fixed but for grub2
version older than this version we applied the patch. The
patch however was only applied based on the presence of a
grub setting named GRUB_USE_LINUXEFI. It has turned out that
this variable is a custom extension not part of grub upstream
which makes the test functional only on distributions that
supports this setting. The use of linuxefi however is code
that belongs to grub upstream. Therefore this patch changes
the scope of the one time patch to be only based on the
version of grub no matter if GRUB_USE_LINUXEFI is supported
by the distro or not. This Fixes #1453
2020-05-25 12:33:19 +02:00
Marcus Schäfer
9218a9abdb
Fixed root device setup in vendor grubenv
In addition to the root device setup in grub.cfg we also
need to patch the vendor grubenv file which contains an
invalid kernelopts value written by grub2-mkconfig under
the conditions explained in Issue #1287. This Fixes
Issue #1454
2020-05-23 19:22:05 +02:00
Marcus Schäfer
9618a5189d
Fixed parse result description reference
The object that holds the parse result also contains an
information about description_dir and derived_description_dir.
The change on the markup processing impacted the value for
description_dir to be no longer the origin (user provided)
directory. That broke any reference of files that belongs
to the description directory like custom scripts config.sh,
images.sh and so on.
2020-05-22 14:31:43 +02:00
Marcus Schäfer
16450e685f
Merge pull request #1447 from OSInside/fix_apt_include_repositories
Fix default repositories for APT
2020-05-22 10:08:07 +02:00
David Cassany
edb7cc96c7
Fix default repositories for APT
This commit fixes the default repositories configuration for APT.

Fixes #1439
2020-05-20 13:00:52 +02:00
Marcus Schäfer
e9a154d207
Merge pull request #1437 from OSInside/yaml_support
Support multiple markup formats
2020-05-20 11:43:23 +02:00
David Cassany
542769c882
Fix signing keys management for APT
This commit fixes the management of the trusted keyring for apt
repositories. It creates a `trusted.gpg` keyring with the provided
signing keys so APT can check against that the configured repositories.

Fixes #1440
2020-05-18 12:17:56 +02:00
Marcus Schäfer
4720d21283
Support multiple markup formats
Allow to read multiple markup formats. Supported are XML
and YAML. The parsing and transformation is based on the
anymarkup module. The use of anymarkup is optional and
implemented as an on demand loading module. If a user
uses a yaml config file or a request to convert into
yaml is made without an installed anymarkup module an
exception is thrown
2020-05-15 13:59:22 +02:00
Marcus Schäfer
5faa984f83
Fixed zypper error code validation
The error code 127 - command not found, was not treated as
an error. This commit adds 127 to be an error condition
along with the other 1xx error codes from zypper that are
handled as errors. This Fixes #1430
2020-05-13 12:25:42 +02:00
Marcus Schäfer
9fddb90a6b
Allow setup of serial line in bootloader
So far kiwi used a static serial line setup of the console
type was configured to use a serial console. However if
different parameters are needed there was no way to change
the static setup. This commit adds a new bootloader attribute
called serial_line which allows to specify the serial line
parameters for the grub bootloader e.g

    serial_line="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"

Please note serial_line takes the value as it is given and
adds this as a line to the grub configuration or as content
to the variable GRUB_SERIAL_COMMAND. No further validation
of the information takes place by kiwi. This Fixes #1401
2020-05-13 11:25:42 +02:00
David Cassany
7e43b86cd9
Fix string formatting
After a flake8 upgrade to v3.8.0 these changes were required to pass
the `tox -e check` validation.
2020-05-12 14:51:36 +02:00
Marcus Schäfer
d276394660
Support grub timeout_style parameter
Grub supports a style setting that influences the display of
the menu depending on the configured timeout value. With this
patch kiwi allows to specify the style via a new bootloader
parameter named timeout_style="hidden|countdown". If not set
the grub default applies which shows the menu in any case.
This Fixes bsc#1165730 and Fixes #1404
2020-05-11 12:38:28 +02:00
Marcus Schäfer
65dfa6d02e
Merge pull request #1433 from OSInside/refactor_xml_bootloader_settings_format
Refactor xml bootloader settings format
2020-05-11 10:55:36 +02:00
Marcus Schäfer
1e4b57e480
Merge pull request #1432 from OSInside/poc_pacman_for_arch
Adding support for Pacman package manager
2020-05-08 16:46:27 +02:00