Commit Graph

87 Commits

Author SHA1 Message Date
Marcus Schäfer
9487a189ed Implement obsrepositories source on derived_from
The following reference to a derived container:

    obsrepositories:/container#latest

Will be translated into the following buildservice
local path:

    /usr/src/packages/SOURCES/containers/_obsrepositories/container#latest
2017-04-25 17:48:16 +02:00
Marcus Schäfer
f58d96ea6c Implement obs source on derived_from
The following reference to a derived container:

    obs:/project/repo/container#tag

Will be translated into the following buildservice
local path:

    /usr/src/packages/SOURCES/containers/project/repo/container#tag
2017-04-25 17:48:16 +02:00
David Cassany Viladomat
269a220998 Merge branch 'master' into OCI_images_support 2017-04-24 12:18:53 +02:00
David Cassany
c35f9f3b23 Add support for OCI images
This commit adds support for OCI images. Most of the docker related
code is reused for OCI classes and Docker classes have been refactored
so now they are a splecialization of the OCI classes. It is done this
way since KIWI internally only uses OCI format to operate with
containers, therefore docker images just differ from OCI images by
the way they are packaged or unpackaged.
2017-04-19 16:44:33 +02:00
Neal Gompa
47b799b261 Do not purge the repositories before inserting them
There are no good reasons to be purging the repo directories, especially
when it is common for some distributions (Red Hat/CentOS/Fedora, for example)
to ship repository configuration as packages. Deleting them puts the package
manager in the system into a weird state, so we want to avoid this.
2017-04-13 22:12:41 -04:00
David Cassany
cc5da88c73 Bypass bootstrap procedure if no bootstrap packages section
This commit updates kiwi to bypass bootstrap procedure in case
there is no bootstrap packages section.

It also adds extra validation in root_bind.
2017-04-11 16:02:27 +02:00
Marcus Schäfer
8459843b2a Merge pull request #295 from SUSE/fix_plus_recommended
Add method to setup installation of recommended packages
2017-04-10 19:08:28 +02:00
David Cassany
19bf90073a Add warning logs for unkown base image URIs 2017-04-10 18:12:52 +02:00
David Cassany
1f05b212b3 Add method to setup installation of recommended packages
With this commit package manager are always set to include only
required packages or set to include required and recommended
packages.

This commit fixes #285
2017-04-10 15:28:10 +02:00
David Cassany
0438183ae2 Added support for unknown uri types for base image references
This commits bypasses any URI check if the uri schema is unknown in
RootImport class. This way the URI is bypassed to skopeo if it couldn't
be translated to any known type. That enables referencing images with
any URI supported by skopeo, i.e. DockerHub images.
2017-04-04 16:08:43 +02:00
David Cassany
0fda4f84b3 Keep imported image in OCI format instead of docker
Kiwi always uses OCI format for container manipulations, so it is
easier to assume the image kept between prepare and create step
is also in OCI format, this way less format convertions are needed.
2017-04-04 15:34:10 +02:00
Marcus Schäfer
10917a588f Merge pull request #280 from SUSE/refactor_lock_vs_skip_request
Refactor method name of package manager interface
2017-03-29 17:46:26 +02:00
Marcus Schäfer
249871eaea Added <oem-nic-filter> element
Allow network interface names to be filtered by the given
regular expression. The expression is handled by the bash
regexp operator. Interface names matching the rule will be
filtered out, all others stay. It is also possible to pass
the variable kiwi_oemnicfilter as kernel command line in a
PXE deployment. Fixes #245
2017-03-28 11:26:03 +02:00
Marcus Schäfer
9d2878a132 Use request_package_exclusion method in prepare 2017-03-28 11:19:28 +02:00
Marcus Schäfer
9843778a6e
Throw a proper msg on missing filesystem reference
Don't set a filesystem factor if no filesystem reference is set
2017-03-22 15:34:08 +01:00
Marcus Schäfer
36b8dbca93 Merge pull request #265 from SUSE/layered_docker_images
Support for layered docker images
2017-03-16 09:44:40 +01:00
Marcus Schäfer
3e70f1351b
Allow https location as repository source 2017-03-15 17:27:38 +01:00
David Cassany
f71f7aea18 Refactor RootImport to keep images with a default name
RootImport has been refactored so the image is kept with a known
name that can be obtained with the Defaults class.
2017-03-15 09:47:35 +01:00
Marcus Schäfer
0f68081211 Handle derived image as Uri instance 2017-03-13 20:20:24 +01:00
David Cassany
98d56ea34f Refactored RootImport and included checksum validation
First, commit refactors RootImport in order to also copy
the imported image after sychronizing the import.

Second, it includes a checksum of the copied image which is
validated in later steps.
2017-03-13 20:20:24 +01: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
Marcus Schäfer
e8769b8fca
Refactor Uri constructor
Make repo_type an optional parameter, which is only
required if the specified uri leaves a type choice
2017-03-08 16:06:09 +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
1a5257a0e8 Prevent use of project relative import statements
For details on the motivation of this change please visit:
https://wiki.python.org/moin/FutureProofPython
2017-03-07 11:23:37 +01:00
Marcus Schäfer
3db5a1a606 Add support for repository credentials
The package and solver repository classes did not provide an
interface to deal with repository credentials. This commit
add support for the zypper package manager and the generic
urlopen based download method of the solver class. This
Fixes #246
2017-03-02 15:35:53 +01:00
Marcus Schäfer
1f2a7b49b9
Added uri translation for SUSE factory
The obs uri 'obs://openSUSE:Factory/standard' does not follow
the standard http url translation schema and needed a special
handling in order to resolve correctly
2017-02-03 15:17:27 +01:00
Marcus Schäfer
7e762a6d5e
User format method to form the message 2017-02-01 11:25:00 +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
c3bad3f8f2
Fixup kernel name setup in disk builder
The Kernel instance is the only correct place to ask
for the kernel name. This class has the responsibility
to know information about the selected kernel. The
additional arch based assumption on the kernel name
in the disk builder were wrong. This fixes bnc#1011936
2016-11-24 10:39:10 +01:00
Marcus Schäfer
271a5f25af Fixup code smell for kernel name list
Iterating over only one list item doesn't need a loop
2016-11-21 09:12:31 +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
0416849de3 Merge pull request #188 from SUSE/sat_solver_plugin
SAT solvable interface for package repository types
2016-11-09 09:56:50 +01:00
David Cassany
dc28159b75 Increase the default image size for XFS filesystems
When no size is specified in type section the resulting image size
is calculated using the size of the whole build-root increased by
an empiric factor. Some tests revealed that this factor was not
enough for XFS filesystems. The empiric factor has been increased.

This commit fixes #186
2016-11-08 18:26:58 +01:00
Marcus Schäfer
2549437b4d Add repo_type info to Uri class
This allows to eliminate the repo_type from the paramter list
of the SolverRepository class, which then only needs an instance
of Uri
2016-11-08 18:15:38 +01:00
Marcus Schäfer
4ac554355d
Fixup root init with existing host cache
Creating a new root init with a shared location which already
provides directories of the system failed on init of those
directories. Only create the not yet existing directories
2016-10-31 15:18:28 +01:00
Marcus Schäfer
bde93e42d4
Fixup initial directory creation for new root
During testing of alternative cache locations an init
problem with the var/ directory was observed
2016-10-27 12:02:47 +02:00
Marcus Schäfer
a0debd086b
Allow ftp:// uri style for package repositories 2016-10-17 11:27:55 +02:00
Marcus Schäfer
b7e1e293ec Store kiwi_target_removable in profile env 2016-10-14 08:31:41 +02:00
Marcus Schäfer
719ed8a8ab
Cleanup use of cache location 2016-10-12 11:28:58 +02:00
Marcus Schäfer
f938bf8a83 Create fstab entries for persistent devices
Instead of creating the fstab at boot time, those entries which
are generic and not depending on an unknown device name can be
created as part of the image building process.
2016-09-21 17:07:55 +02:00
Marcus Schäfer
f021b16fff
Added handling for rpm-excludedocs for zypper
In zypper zypp.conf can be setup to prevent the installation
of %doc marked items from rpm packages. The <rpm-excludedocs>
section in the kiwi XML description is used to provide this
functionality. So far this feature is only implemented for
zypper. References #133
2016-09-12 15:58:13 +02:00
David Cassany
139a95bf1e Use str.format for int to string convertion 2016-08-19 17:34:16 +02:00
David Cassany
830a44e5bc Fixes #124 2016-08-19 17:02:07 +02:00
David Cassany
b1a16d0357 Updated xml_state
The changes here modify the method get_users in xml_state in order
to provide a simple list of users instead of nested lists. Also a new
method to get the groups for a given user has been included in
xml_state. This is done in order to slim down and facilitate the
code in kiwi/system/setup.py. This way users and groups can be handled
in more natural way.
2016-08-02 17:20:50 +02:00
David Cassany
c0bcce3404 Updated the user schema layout
Now each user item may or may not have a groups attribute. The
groups attribute is a comma separated list of group names. If
present the first group name will be the login or primary group,
if not present, the underlying toolchain will assign the default
login group for that user.
2016-07-27 12:26:50 +02:00
David Cassany
41ffb048b3 Merge branch 'master' into fix_user_schema_layout 2016-07-26 18:53:30 +02:00
David Cassany
2d361b9f79 Some corrections needed after rebuilding schema and parser 2016-07-26 17:59:25 +02:00
Marcus Schäfer
5078655eb6 Update true/false handling of text nodes
The latest version of generateDS handles <section>true|false</section>
text values in a way that it returns a boolean python type instead
of the text string. With this change the kiwi code has to be adapted
at the level of writing the shell profile which needs the string
value of boolean information
2016-07-26 17:09:13 +02:00
David Cassany
2871ca8150 fixing user schema layout 2016-07-26 16:22:33 +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