Commit Graph

66 Commits

Author SHA1 Message Date
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
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
Dan Čermák
d28a7e935c
New method: Path.access - thin wrapper arround os.access
This function calls os.access, but first checks whether the input parameters are
sane, instead of simply returning false when the file in question does not exist
or an invalid mode was specified.
2019-03-26 15:20:49 +01:00
Marcus Schäfer
95a287eaf5
Merge pull request #933 from SUSE/workaround_zypper_failed_to_cache_rpm_database
Fix Failed to cache rpm database on zypper addrepo
2019-02-06 15:15:09 +01:00
Marcus Schäfer
dd1052ac99
Handle location of the rpm DB on the macro level
The location of the rpm database is no longer a standard
path one can trust. Some distributions put it to /var/lib
others to /usr/lib. This introduces the problem of dealing
with different locations between the bootstrapping (host rpm)
phase and the image installation (image rpm) phase.

This commit implements a solution based on an intermediate
rpm database configuration. KIWI creates the macros.kiwi file
inside of the image root which is read by any call of rpm
in the inner and outer system. During bootstrap phase the
rpm dbpath from the host system is used and later in the
install phase the dbpath from the rpm package as it was
installed by the target image distribution is used. In case
of a dbpath difference the database is automatically moved
to the new location by setting the _dbpath_rebuild macro
to the correct location. At the end the custom KIWI macro
is deleted.

As this process allows custom macro defintions during the
KIWI run it also serves as the base for a solution to
Issue #771 which will be done in a follow up request to
this commit.

Also the workaround for bsc#1112357 which uses a static
dbpath to store an optionally given signing key will be
addressed with this commit. The macro setup happens before
the import_trusted_keys method which makes any specification
for a strict dbpath obsolete.

Last the implementation deletes the obsolete
dump_reload_package_database code. rpm is able to automatically
do the conversion of different db versions such that the code
in kiwi is obsolete. In addition that code only worked for
rather old db versions. The public API has not changed though,
but the method is marked obsolete and does nothing anymore.

In addition to the deletion of obsolete code a new API
method post_process_install_requests_bootstrap has been
introduced to handle actions required after bootstrap
and before installing of packages from inside the new image
2019-02-06 11:55:42 +01:00
Marcus Schäfer
3482be44f0
Fix Failed to cache rpm database on zypper addrepo
Occasionally zypper fails when adding the repo with the
rpm error message 'Failed to cache rpm database'. I was
not able to find out why this happens and I also could
not find a way to reproduce it safely. However this
commit adds a workaround that seems to fix the issue
when it happens. If the first call of zypper addrepo
fails kiwi now issues the exact same call again and
only if that fails too an exception is thrown

In addition the patch changes the zypper call and avoids
the option --type. That option is marked legacy and ignored
by zypper but causes a misleading warning message
2019-02-06 11:41:45 +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
David Cassany
fda157296e
Add Codec utils for bytes literals decoding
In case of a literal decoding failure it tries to decode
the result in utf-8. This is handy in python2 environments where
python and the host might be using different charset configurations.
In python3 this issue seams to be solved.

Fixes #829 and bsc#1110871
2018-10-08 15:48:51 +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
Marcus Schäfer
41970d3dd4
Cleanup api doc strings
This cleans up and fixes the api documentation for the
public interface of the projects toplevel source code
files and Fixes #697
2018-04-16 16:10:04 +02:00
David Cassany
de47635af3 Remove vmdk metadata update procedure
This commit removes the method _update_vmdk_descriptor from
DiskFormatVmdk class. The code part causes vmdk format issues
in current up to date hipervisors such as VMWarePlayer 14 or
Virtualbox 5.2. Removing this code does not produce any failure,
at most can only imply loosing some features provided by open-vm-tools
package.

Fixes #591
2018-01-30 14:20:45 +01:00
David Cassany
afbf2687c8 Extend CommandCapabilities to also check version 2018-01-16 16:53:59 +01:00
David Cassany
de2b32cbed Add max size post build command
This commit includes a post build constraint validation into the
Result class. With this commit any file included to the result
tuple is verified not to exceed the maximum size configured into
the runtime configuration file config.yml.

Fixes #468
2017-11-17 12:48:52 +01: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
9e8eb94d6d Support for layered docker images
This commit includes support for building layered docker. A new
layer is added on top of the base image referenced by `derived_from`
attribute.
2017-03-13 20:20:24 +01: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
eaac155067 Add extension validation and data access
If an extension section exists the xml data in this section
is validated against the RelaxNG schema which must be part
of the xmlcatalog for the used extension namespace. If the
data validates the method get_extension_xml_data can be used
to access the etree parse result for each of the extension
configurations
2016-12-01 10:45:17 +01:00
Marcus Schäfer
cab73318bc Merge pull request #200 from SUSE/solver
Solver
2016-11-22 09:46:56 +01:00
Marcus Schäfer
119e96dc8f Added Sat solver class
Added implementation for Solver class based on the SUSE
libsolv C library and the solv python binding
2016-11-21 12:02:01 +01:00
Marcus Schäfer
39d5db9881 Fixed kernel name lookup
Complete the list of kernel names for the lookup. Normally
the kernel package provides a symlink to the actual kernel
image file. However if the link does not exist we extend the
search to a collection of names for possible kernel images.
The new list now also covers kernel names as used for arm

Along with the change this patch also provides an option to
raise an exception if the kernel lookup did not find any
kernel, which is used for the get_kernel() request in the
dracut initrd system setup where it is mandatory to find
a kernel image.

This fixes bnc#1010874
2016-11-21 09:07:50 +01:00
Marcus Schäfer
cdac18a92c Implemented SolverRepositoryRpmDir
Add support for local rpm-dir repositories
2016-11-08 18:17:51 +01:00
Marcus Schäfer
ebeb43eea6 Implement SolverRepositoryBase
Base class and interface for building a SAT solvable from
a given repository
2016-11-08 18:17:51 +01:00
Marcus Schäfer
16fdb5d978 Initial structure to support SAT solvables
A SAT solvable can be used together with python-solv to implement
performant package solving tasks. This is the initial structure
to allow the creation of such solvable files from specified
repositories. We will support the repo types yast2, rpm-md and
rpm-dir in the first place.
2016-11-08 18:15:37 +01:00
Marcus Schäfer
c9c71f4dc5 Added kiwi image resize command
The image resize command allows to resize a disk image
and its optional disk format to a new disk geometry
2016-10-18 10:13:41 +02:00
Marcus Schäfer
de76321da7 Added resize_raw_disk method in DiskFormatBase
Allow to increase the disk geometry of a disk image file
in order to create free space on this disk
2016-10-18 10:08:05 +02:00
Marcus Schäfer
6a611b2e91
Fixed secure boot setup for iso media
Provide the shim loader and the shim signed grub loader in the
required boot path. Normally this task is done by the shim-install
tool. However, shim-install does not exist on all distributions
and the script does not operate well in CD environments from which
we generate live and/or install media. Thus shim-install is used
if possible at install time of the bootloader because it requires
access to the target block device. In any other case the kiwi
fallback code applies
2016-09-30 15:00:22 +02:00
Marcus Schäfer
7cee5f9d41
Refactor DiskBuilder class
The DiskBuilder class is able to build a disk its corresponding
format and the installation image to install this disk by using
the InstallImageBuilder. However all three tasks were handled
in a row which lead to the problem that resources like active
mount processes were still open when e.g the disk format is
created. The race conditions produced here lead to an undefined
state of the resulting disk format and/or install image. In
order to avoid this the DiskBuilder class has been refactored
in a way that each tasks is an atomic operation which is
freeing its resources after success
2016-09-23 21:46:39 +02:00
Marcus Schäfer
93fae352ab
Added docstring for KiwiDescriptionConflict 2016-08-10 21:38:20 +02:00
David Cassany
0fdd209e73 Command validation
This commit includes a validation in Command.run and Command.call
in order to verify the existance of the command before running it.
It case it is not found in the specified environment it raises a
KiwiCommandNotFound Exception.
2016-08-05 18:38:27 +02:00
David Cassany
6a93cb83c4 extending kiwi/archive/tar 2016-07-22 17:11:52 +02:00
Marcus Schäfer
1eb337049b Refactor profile for volume setup
Don't use volume names in bash variables. In addition that
removes the name limitations we had for volume names
Related to #39
2016-07-05 15:54:25 +02:00
Marcus Schäfer
30260cc496 Merge pull request #97 from SUSE/exceptions-doc-strings
Exceptions doc strings
2016-06-15 15:54:29 +02:00
Marcus Schäfer
8d0df28296
Grammar fixes for doc strings 2016-06-15 13:01:27 +02:00
Marcus Schäfer
9aea83a7c1 Add documentation for Exceptions 2016-06-15 10:19:04 +02:00
Marcus Schäfer
4ca75860e7
Handle XML per content or file more explicit 2016-06-14 11:53:43 +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
91afaad923
Be more flexible for isoinfo lookup
isoinfo can either be provided by the community package in
/usr/lib/genisoimage/isoinfo or by the mkisofs package from
J. Schilling in /usr/bin/isoinfo. kiwi should be smart enough
to lookup which tool is installed. /usr/bin/isoinfo will be
preferred
2016-04-19 10:07:21 +02:00
Marcus Schäfer
8e6812dcf6
Update inline API documentation 2016-04-11 15:09:26 +02:00
Marcus Schäfer
d8c8480fd4
Make sure import_description preserves archives 2016-03-24 16:00:48 +01:00
Marcus Schäfer
8fb633257b
Delete obsolete shim setup code from kiwi
Due to the use of shim-install the code in kiwi to setup
for secure boot is no longer needed
2016-03-09 18:33:16 +01:00
Marcus Schäfer
147c0706eb
Refactor grub2 bootloader installation
Make use of grub2-install to install the bootloader
2016-02-25 17:18:31 +01:00
Marcus Schäfer
bdd80502b8
Added result bundler 2016-02-15 00:08:55 +01:00
Marcus Schäfer
a7fb5649f5 Refactor internal boot image task
Make a factory out of the task and allow to have e.g
a dracut boot image task at a later point in time.
The BootImageBase class creates an interface for this
implementation. So far only BootImageKiwi is implemented
2016-02-11 11:19:57 +01:00
Marcus Schäfer
a1aab40cae
Added git like command completion
Provide a 'Did you mean' log message for unclear task names
2016-02-09 21:12:03 +01:00
Marcus Schäfer
ff09a80349
Allow alternative locations for grub installation
Different distributions install grub2 to different places.
Therefore kiwi should not use a fixed location but allow
to lookup grub data at several places
2016-02-09 15:28:06 +01:00
Marcus Schäfer
f2ff481bf2
Added support for kiwi --compat
The --compat call will trigger the call of the kiwicompat
tool written to support legacy kiwi commandlines. An example
could look like the following call:

    sudo kiwi --compat -- --build /my/description --type vmx -d /my/dest

Please be aware the -- is required to tell docopt to treat all
options as parameters
2016-02-04 15:06:56 +01:00
Marcus Schäfer
6a0292c958
Added fix_boot_catalog and relocate_boot_catalog 2016-01-27 12:36:44 +01:00
Marcus Schäfer
9fc642b1f8
Added BootLoaderInstallZipl class 2016-01-24 21:29:06 +01:00
Marcus Schäfer
ccdfc108da
Finished BootLoaderConfigZipl class and tests 2016-01-22 15:48:02 +01:00
Marcus Schäfer
1ede864322
Added BootLoaderConfigZipl class
The implementation is still unfinished
2016-01-21 17:06:19 +01:00