Commit Graph

18 Commits

Author SHA1 Message Date
Marcus Schäfer
29a9d60a38
Allow overlay directories for profiles
In addition to the existing root/ overlay directory which
applies always there can now also be profile specific overlay
directories. If an overlay directory should be applied for
a specific profile this can now be done by placing this data
in a directory that is named the same as the profile name.
2020-04-02 12:58:38 +02:00
Marcus Schäfer
94c7a7cdf6
Added new oem-resize-once element
The new element controls the behavior of the repart/resize code
in the oem-repart dracut module. By default the repart/resize
happens on every reboot and therefore also allows for disk
geometry changes during the livetime of the machine. If the
element is set to false the repart/resize operation happens
only once and then never again. To check for this condition
a new profile environment variable kiwi_rootpartuuid which
holds the PARTUUID of the root partition has been added to
the disk builder.
2020-03-27 10:37:42 +01:00
Marcus Schäfer
3b7f5be918
Complete refactoring of fstab handling
With the new Fstab class from prior pull request there is an
opportunity to handle all fstab related actions to be done
by that class. This commit extends the Fstab class with an
add_entry method such that we can avoid the extra lists
holding raw fstab lines in e.g the disk builder. In the end
all fstab related data is stored in an instance of the Fstab
class. This also extends the KIWI api by an fstab management
class. Related to #1329 and #1349
2020-03-18 16:01:13 +01:00
Marcus Schäfer
bc372a12b1
Validate and order final fstab file
On write of the final fstab file read, validate and order
the entries. This is related to Issue #1349
2020-03-17 11:25:56 +01:00
Marcus Schäfer
546fe7c3db
Skip nodev devices for size calculations
Added a static list of mountpoints used for devices that
are not associated with a physical device like /proc and
use that information in the exclude list for calculating
the image byte size. This Fixes #1363
2020-03-14 20:45:16 +01:00
Marcus Schäfer
7160b7faa1
Fixed handling of fillup templates
Systems using a template tool to generate config files
might not be effective when they see the intermediate
config files we need from the host to let certain package
managers work correctly. Therefore the cleanup code in
kiwi takes care to restore from an optionally existing
template file if no other custom variant is present.
This Fixes bsc#1163978
2020-02-24 18:03:22 +01:00
David Cassany
75a91385e4
Do not create empty macros file
This commit makes sure to empty RPM macros files are created during
the build. Additionally it also ensures that no needless `rm` and `mkdir`
calls are done.

Fixes #1316
2020-02-18 14:08:30 +01:00
Marcus Schäfer
775b9a6c8f
Fixed ppc kernel lookup
On power the kernel is named e.g vmlinux-4.12.14-197.29-default
kiwi was missing that name match. Related to Issue #1325
2020-01-28 11:27:30 +01:00
David Cassany
1466a6c69a
Make use of Path.which including root_dir parameter
This commit refactors the use of Path.which in several parts of the
code. Since dd4d2ed78 the Path utility is capable to run Path.which
on certain chroot env, thus no need to adapt the PATH environment
variable.

Fixes #1281
2020-01-22 16:12:08 +01:00
David Cassany
686dafc9e4
Remove RootBind.move_to_root method
This commit removes the RootBind.move_to_root method as this can all be
done by using the Path.move_to_root utility method. This allows
to drop the RootBind attribute in PackageManager classes and focus
path manipulation methods into a common utility.

Related to #1281
2020-01-20 16:17:24 +01:00
Marcus Schäfer
550cccdbea
Refactor kernel version lookup
For the lookup of the kernel version kiwi provided a small
C program that reads the first bytes of the kernel binary
and extracts the version information. Given the various
compression formats and also the problem of kernel files
that contains the decompressor code which could be anything
it has turned out to be difficult to provide a stable tool
to read the version from the binary. Therefore the code in
kiwi was refactored to read the version via regexp match
from the filename which also makes kversion an obsolete
tool. This Fixes #1308
2020-01-11 22:31:02 +01:00
Marcus Schäfer
8c6eeac4a5
Open image files in UTF-8
Post image build metadata like the packages file which are
created from data produced by the package manager can contain
multibyte characters and should be written into files opened
with the UTF-8 encoding. The same applies to the image imported
XML description. This Fixes #1290
2019-12-05 09:26:31 +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
179503f3b1
Allow use of relative paths for dir:<path> URIs
This commit allows the use of relative paths for local URIs using the
the following format:

dir:<path>

This is helpful to set in config.xml local URIs for repositories.

Fixes #1261
2019-11-14 15:19:40 +01:00
Marcus Schäfer
b265be128c
Merge pull request #1249 from OSInside/refactor_logging
Refactor logging
2019-10-24 11:10:29 +02:00
Marcus Schäfer
bdb7123fa1
Refactor use of logging facility
Use getLogger method instead of a global log object
Also use caplog fixture to capture log messages in
unit tests. This Fixes #1244
2019-10-23 17:54:27 +02: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
David Cassany
4b3a105026
Re-structure unit tests folders
This commit relocates unit tests to a folder structure that matches
the source code structure.

Fixes #1128
2019-10-21 14:00:05 +02:00