Commit Graph

34 Commits

Author SHA1 Message Date
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
Marcus Schäfer
f954861f89 Added support for hybrid GPT
Embedding an MBR into a GPT is required for a collection of
boards, e.g arm rapberry PI. The kiwi configuration provides
a new attribute called

    <type ... gpt_hybrid_mbr="true|false"

which allows to control if the GPT should be hybrid or not.
On build procedures which do not create a GPT the attribute
has no effect. This references Issue #17
2016-03-18 21:41:14 +01:00
Marcus Schäfer
b9eb921b50
Fixed use of dracut initrd system for arm platform 2016-03-17 16:31:53 +01:00
Marcus Schäfer
c4c3c7054f
Fixed 32bit x86 builds
Put it all under the ix86 namespace
2016-03-16 17:31:46 +01:00
Marcus Schäfer
f97dbf6fda
Refactor grub2 EFI support
EFI support was target specific to the x86_64 architecture
This commit changes the structure to allow more architectures
supporting EFI. Thus the arm64 EFI support has been added
as a plus
2016-03-16 12:57:25 +01:00
Marcus Schäfer
e6cc5bfa09 Move from nose to pytest
nose is no longer maintained, thus we have to move to another
testing system. This commit updates the tox setup and all tests
to use pytest instead of nose.
2016-03-14 12:23:14 +01:00
Marcus Schäfer
e4ff01ea7a
Add handling for OPAL firmware setup on ppc64
This adds a capability of creating an image for Bare metal POWER
platform, where firmware parses grub2.cfg and simply kexecs into
an image kernel
2016-03-10 15:01:30 +01:00
Marcus Schäfer
1e9b6dd9d6 Use shim-install to setup EFI secure boot 2016-03-09 18:12:38 +01:00
Marcus Schäfer
b3c8d071de
Move builder test cases to match namespace 2016-03-08 15:15:08 +01:00