Commit Graph

58 Commits

Author SHA1 Message Date
Marcus Schäfer
f278e8fe57
Added support for system wide config file
If there is no user specific config file we are also
looking for a system wide /etc/kiwi.yml file
2018-08-08 18:13:00 +02:00
David Cassany
9dcf00e4d1 Some improvements on size calculation
This commit simplifies the unpartitioned area size calculation.

Fixes #709 and it is related to fate#323874
2018-04-23 15:45:38 +02:00
David Cassany
74aa8a5c14 Adding unpartitioned size attribute
This commit adds the possibility of setting some unpartitioned area
after the systemdisl partition into the image.

Fixes #709
2018-04-20 17:04:33 +02:00
Marcus Schäfer
4fdf4b646a
Use dracut modules based on feature use
As the kiwi build dracut initrd is a generic one which
includes all installed dracut modules we missed a way to
exclude modules from beeing incorporated even if we know
it would not be needed. One example is the multipath module
which would only be useful if the oem multipath scan is
configured in the image description
2018-03-08 15:58:38 +01:00
Marcus Schäfer
d8bc0e3dcd
Cleanup misleading method name 2018-02-04 20:19:45 +01:00
Marcus Schäfer
bcd170a04d
Fixed kiwi dracut config for the final system
Once the image has been deployed on the target and the
system is up and running some of the kiwi dracut modules
used for deployment are no longer needed and should not be
taken into account when another dracut call happens on the
system.
2018-01-27 11:14:48 +01:00
Marcus Schäfer
2ffcb26f15
Provide a get_boot_names method in boot classes
The naming schema for an initrd file name depends on the
boot image type as well as on the underlaying initrd
creation toolkit. In order to encapsulate that in a clear
interface the code to know about the correct names has
been moved into the classes which are responsible for
it and out of the builder/disk class
2018-01-24 16:57:27 +01:00
Marcus Schäfer
d582dc90bd Implementation of dracut kiwi-dump module
Provide the capabilities of the oem install code as
dracut module. The implementation covers the result
of the installiso="true" configuration. Installation
from remote sources still needs to be done and will
follow in an extra pull request. This addresses
Issue #576
2018-01-16 16:24:58 +01:00
Marcus Schäfer
af81710407
Merge pull request #548 from SUSE/post_build_constraints
Add max size post build command
2017-11-21 10:33:31 +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
065b277ff1 Added dracut kiwi oem module and library
A new dracut module kiwi-repart used to be the successor of
the custom kiwi oemboot code to repartition the disk has
been added. Along with the module a dracut library kiwi-lib
will also be delivered.
2017-11-15 11:23:01 +01:00
Marcus Schäfer
50ab40c8e1 Support overlay disk images via dracut
Using the kiwi-overlay module to boot up systems configured
with the overlayroot="true" attribute in the system image
XML configuration. Fixes #65
2017-09-06 17:08:10 +02:00
David Cassany
5c78697d33 Export *.verified also for images based on apt-get
This commit includes support in system/setup.py to run a package
verification also for images based in apt-get package-manger

Related to #457
2017-08-02 17:30:35 +02:00
David Cassany
4777431c93 Include .packages file for apt-get based images
This commit renames export_rpm_packages_list method to
export_packages_list and it includes support for listing
debian packages if apt-get package manager is used.

Fixes #457
2017-08-02 15:06:19 +02:00
Marcus Schäfer
bc1089b257 Refactor code which deals with Xen
Provide two methods is_xen_guest and is_xen_server which
are used instead of the former machine domain and firmware
processing. Issue #429
2017-07-20 10:42:49 +02:00
David Cassany
ee8482d0a2 Exclude kiwi files from images
This commit from one hand includes a
get_exclude_list_for_root_data_sync method in Defaults which returns
a list of the files used by KIWI that should not be part of the
resulting image. From the other hand makes use of the exclusion
default list in live, archive and container images, it fixes #423.
2017-07-17 11:37:11 +02:00
Marcus Schäfer
d4674e30c5 Fixup detection of grub directory name
In order to put grub data to boot/grub2 or boot/grub a check for
the grub2-tool vs. grub-tool name is performed. This requires
access to the image root directory on a file basis which is not always
applicable. When setting up the grub bootloader for e.g EFI boot on
an iso image the rootfs can't be directly accessed because the iso
image contains the rootfs in a compressed format. This commit
refactors the check to be generic for all image types
2017-06-07 23:40:36 +02:00
David Cassany
617859b3a4 Include signing-key feature for boot images
This commit extends the behavior of --signing-key options in order
to import the provided key file into the boot image, in addition to
the regular image root tree.

Related to #342
2017-05-31 10:04:06 +02:00
Marcus Schäfer
f3522456e5
Set default dracut output format to match upstream 2017-05-12 15:29:50 +02:00
Marcus Schäfer
49aa4097fe
Added dracut output file format detection
Unfortunately the dracut initrd output file format varies between
the different Linux distributions. Tools like lsinitrd, and also
grub2 rely on the initrd output file to be in that format.
Thus when kiwi uses dracut the same file format should be used
all over the place in order to stay compatible with what the
distribution does. Fixes #325
2017-05-12 12:53:19 +02:00
Marcus Schäfer
6cc0b2085d Flake cleanup for unit tests 2017-03-07 13:03:10 +01:00
Marcus Schäfer
37c1e1e3a1
Allow to convert GPT into MBR
The type attribute force_mbr allows to convert a system selected
for use with a GPT to use an MBR (msdos table). The attribute
only takes effect on image configurations which would select the
GPT partitioner. This Fixes #236
2017-02-20 16:27:52 +01:00
Marcus Schäfer
9728b698a2
Added handling for spare_part attribute
Add a spare partition right before the root partition of
the configured size. Fixes #234
2017-02-08 17:19:37 +01:00
Marcus Schäfer
865f3bb2ca
Delete all traces of vboot firmware
The vboot firmware setup was a workaround on arm for the
chromebook platform several years ago. From a todays
perspective the setup and the way to boot would be different
and obsoletes the special case implementation. Thus this
is gone now. Related to Issue #234
2017-02-08 15:53:10 +01:00
David Cassany
6029c81a91 Fixup duplication of btrfs toplevel volume
If using root btrfs snapshot, the default toplevel subvolume is set to
/@/.snapshots/1/snapshot, thus all defined subvolumes are mounted
under that cusomized default subvolume. For the first time
subvolumes are mounted it is fine to include /@/.snapshots/1/snapshot
prefix as root is not yet set to that specific path, however in any
future mount this path prefix is not needed any more, as the root
get mounted in /@/.snapshots/1/snapshot by default. Fixes (bsc#1015549)
2017-01-18 14:29:29 +01:00
Marcus Schäfer
996d9f4abe
Fixed setup_disk_image_config in bootloader setup
The parameter for the uuid is not enough to handle all
supported disk geometries. If the disk has an extra boot
partition the bootloader setup must read the boot data
from the boot partition but must set the root for the
kernel cmdline to the root partition. Therefore the
interface needs to change and must provide both the
boot_uuid and the root_uuid in oder to allow the method
to setup the correct values
2016-11-24 13:29:08 +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
ca6b56d2f6 Merge pull request #174 from SUSE/cache-location-configurable
Cache location configurable
2016-10-27 16:43:45 +02:00
Marcus Schäfer
12696b01b8 Merge pull request #173 from SUSE/attr_co_constraints
Attribute co-constraints based on image type
2016-10-26 14:40:59 +02:00
Marcus Schäfer
c91820aa27 Cleanup unit tests using sys.argv
The tests should restore to the default argv option set
as provided by the test_helper
2016-10-25 17:51:57 +02:00
David Cassany
8257f65c33 Some tests slightly modified in order to improve coverage
This commit improves some example kiwi files and tests in order
to achieve a 100% code coverage.
2016-10-24 14:35:09 +02:00
David Cassany
25bb84b148 Corrections on test kiwi description files
Some attributes needed to be changed in the test xmls. With this
commit all the description files are consistent with the new co-
occurrence constraints.
2016-10-24 13:07:06 +02:00
Marcus Schäfer
fc66a350bd config.partids only required for kiwi initrd
If dracut is used as initrd system an unused config.partids
file is generated. The partition id information is only used
by kiwi boot code not by dracut boot code. Related to
bnc#1005246
2016-10-24 09:23:11 +02:00
Marcus Schäfer
050c6f413d
Make sure dracut initrd is copied correctly 2016-10-20 16:30:49 +02:00
Marcus Schäfer
368a9b1cbb Call dracut in system root tree
Change BootImageDracut class to call dracut in the specified
system root directory and not in a self prepared new root environment.
dracut reads scripts and dracut module configurations from the
installed system components, e.g kdump. Therefore calling it
from an isolated runtime environment creates an initrd which is
not matching the system components. Fixes bnc#1005246
2016-10-18 12:22:01 +02:00
Marcus Schäfer
527fbf6a60 Evaluate root_is_readonly_snapshot in disk builder 2016-10-06 09:30:44 +02:00
Marcus Schäfer
bd57391403
Make sure fstab exists in initrd creation system 2016-09-27 11:56:26 +02:00
Marcus Schäfer
1b6bf65beb
Umount volumes prior to bootloader installation 2016-09-27 11:26:27 +02:00
Marcus Schäfer
ef54157d39
Make sure boot image dump is cleaned up 2016-09-23 22:13:00 +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
dc96cb479a Add root, boot and efi partitions to fstab
Make sure the above partitions are added to the generic fstab
with their label or uuid at build time
2016-09-22 16:41:16 +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
fa3eba6cf5 Make sure volumes are mounted prior to install 2016-09-20 16:35:25 +02:00
Marcus Schäfer
46c15618bc
Fixed building of install image
If dracut is requested as initrd_system in combination with
building an installiso we have to overrule the initrd_system
setup for building the install image. The code to install
an image is kiwi's oem install code and unknown to dracut.
The process will end up using dracut as initrd in the system
image but kiwi's initrd on the install image
2016-06-22 17:00:53 +02:00
Bo Maryniuk
80900e46c5 Bring byte strings to Py2 compatibility in ISO 2016-06-08 11:46:36 +02:00
Bo Maryniuk
06b95b727d Replace 'builtins.open' with patch_open decorator 2016-06-07 17:54:24 +02:00
Marcus Schäfer
c79afab617 Support for overlay disk images
overlay disk images uses a readonly root partition and are
overlayed using overlayfs to hook in a cow based read-write
space. This commit implements the basic disk setup.
Implementation to boot such a disk in the kiwi boot code
is still missing, as well as the investigation if dracut
is able to boot such a disk too. References #65
2016-06-01 08:40:51 +02:00
Marcus Schäfer
6df0282d1c Added support for SELinux file security contexts
Systems using SELinux require the filesystem data to be labeled
according to a security context configuration. kiwi now checks
for the presence of /etc/selinux/targeted/contexts/files/file_contexts
and labels accordingly if it exists. This Fixes #52
2016-04-25 12:50:10 +02:00
Marcus Schäfer
32c553bbd2
Cleanup use of partition id maps
For the partition setup the Disk class uses dictionaries
to map the partition name to the partition number. However
there are public partition names such as 'kiwi_BootPart'
and kiwi internal partition names such as 'boot'. The code
should make it more clear which mapping table is used
2016-04-14 15:38:31 +02:00
Marcus Schäfer
08d39049bc Added support for virtual boot partition on arm
Triggered by the firmware="vboot" setup an EFI setup plus a
raw partition without filesystem is created as first partition.
The size of the partition can be controlled by the vbootsize
attribute. The vboot feature is used by the arm architecture
to provide a space in the partition table for custom code as
required by e.g the chromebook. The final customization of the
vboot space is board specific and can't be implemented in a
generic way in kiwi. For finalizing the vboot space the script
hooks editbootconfig and editbootinstall can be used
This is related to Issue #17
2016-03-22 16:20:51 +01:00