Commit Graph

16 Commits

Author SHA1 Message Date
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
David Cassany
563f258586
Fix order in fstab
Any mount point directly under / should be just right after the root
mountpoint and before the custom mountpoints based on user's subvolume
configuration.

Fixes #1349 and bsc#1164310
2020-03-17 07:07:38 +01:00
Marcus Schäfer
4f5e6f18ff
Fixed file name for config.bootoptions file
The dracut code in 90kiwi-dump/kiwi-dump-image.sh looks for a
file matching ${image_uri}.config.bootoptions but the install
code packs a file named pxeboot.${image_uri}.config.bootoptions
into the tarball. Thus without renaming the file it won't
be found. Also the documentation mentions the file to be
named ${image_uri}.config.bootoptions. This commit fixes the
install code to match the dracut boot code and the documentation
2020-03-06 15:52:49 +01:00
David Cassany
e670b4a760
Make squashfs compression configurable
This commit adds the `squashfscompression` attribute in type element. It
can take `gzip`, `zstd`, `xz`, `lzo`, `lz4` or `none`. The default is `xz`.

Fixes #1315
2020-02-24 10:40:57 +01:00
Al
ad33c037dc Split kiwi-dump into 2 modules to allow inserting a module after the image dump and before system reboot 2020-02-11 10:04:19 -08:00
David Cassany
141f384ec3
Add .append file for PXE images
This commit creates the .append file for PXE images. This file
is only created for initrd based images and includes the
UUID of the rootfs and any parameter added by the user within
the 'kernelcmdline' attribute.

Fixes #1327
2020-02-06 09:03:48 +01:00
Marcus Schäfer
e35a0356a8
Make PXE oem deployment genericly useable
When deploying a disk image via PXE the initrd contained a config
file which connects it to a certain image. This has the disadvantage
that no other image could be deployed with it. This commit changes the
deployment code in a way that the config file is read from the
network if the disk is deployed via PXE. The tarball created by
kiwi provides the image connected config file but users now have
the opportunity to create their own boot configurations which allows
deployment of different images with the same kiwi built deployment
initrd. This Fixes #1298 and is one first step into a more generic
PXE support offered by kiwi.
2020-01-21 12:10:33 +01:00
Marcus Schäfer
1a3d0dadb3
Fixed order of fstab entries
If a volume manager is used the volumes are added before the
root filesystem(/) entry in fstab. This does not hurt because
at boot time systemd manages the mounting of the rootfs prior
to any other information in the fstab file but it's conceptually
broken. Users justifiably can expect the fstab entries in the
correct order such that mounting from top to bottom leads
to a consistent root filesystem state.
2020-01-17 15:10:54 +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
07a796254b
Merge pull request #1272 from OSInside/swap_not_last
Swap not last
2019-11-25 14:43:44 +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
c8ec226664
Include grub.cfg inside the efi partition
This commit ensures the grub.cfg file is included within the vfat efi
partition.

This fixes #1271 and bsc#1157354
2019-11-22 09:39:59 +01:00
Marcus Schäfer
726eeacee5
Fixed zipl bootloader setup for s390 images
The preparation to call zipl and the call itself were wrong.
For whatever reason the kernel image the initrd are moved
to another location prior to calling zipl. That move broke
the system because no kernel/initrd existed at the expected
place anymore. In addition the zipl call itself was issued
from a the wrong directory. Also no config file was written
as an after effect of the refactoring in Issue #1194. This
Fixes #1173 and bsc#1156694
2019-11-14 12:01:06 +01: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
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