Commit Graph

53 Commits

Author SHA1 Message Date
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
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
501d8a8955 Allow bootloader="custom" for bootloader attribute
If specified as such the bootloader configuration and
installation will be skipped. However the editbootinstall
and editbootconfig scripts will still be called. This
Fixes #235
2017-02-09 15:54:24 +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
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
d36c404af3
Fixup handling for root_is_readonly_snapshot
The information was not passed to the VolumeManager instance
2016-11-15 12:27:23 +01: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
6c98a17c12
Write fstab to kiwi boot image only
For the dracut initrd system the call happens in the system
root tree which already provides the fstab data
2016-10-19 22:12:51 +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
1f85063007 Handle target_removable in kiwi disk builder 2016-10-14 08:31:41 +02:00
Marcus Schäfer
275190dfcf
Do not bundle the raw disk if a format is setup
Only bundle the compressed version of the .raw disk image
if no disk format like qcow2, vmdk, etc... is specified.
Fixes #159
2016-10-10 12:25:57 +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
bb26fc71b7 Call grub2-install as chroot operation
In addition to the chrooted call make sure all volumes from
the volume manager (if used) are mounted at call time
2016-09-27 15:40:43 +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
72341dbfb0
Mount boot volumes on grub install
If there are volumes below /boot they need to be mounted before
grub2-install / shim-install is called in order to make sure all
data is available in the volume
2016-09-26 16:53:11 +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
Marcus Schäfer
319fb9e6e4
Adapt to common python style
Private methods should start with _f() not __f()
2016-06-15 16:27:45 +02:00
Marcus Schäfer
ec35b4029c Add attribute <type ... overlayroot=true|false/>
Allow to activate the overlay root setup for disk images
2016-06-01 08:40:51 +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
4124d545e0
Refactor subformat classes
Add a generic store_to_result method which allows to store
the format result files into an instance of Result. This
allows to customize result handling per format when needed
2016-05-11 19:18:22 +02:00
Marcus Schäfer
685c830e45 Add shared cache location to Defaults 2016-04-29 14:30:15 +00:00
Marcus Schäfer
24011064b3
Handle fsmountoptions attribute in all builders 2016-04-26 12:40:23 +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
9fd988f4e5
Update builder inline API documentation
References #49
2016-04-13 12:52:25 +02:00
Marcus Schäfer
773033eebe
Refactor SystemSetup class
the information about the description_dir is part of the
provided xml_state instance. There is no need to pass that
information along twice
2016-03-24 16:41:47 +01: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
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
aa6d327a27
Continue Refactor into subpackage
Move Kernel class to system namespace
2016-03-08 14:53:56 +01:00
Dinar Valeev
24c27b8a97 Add support for POWER architecture
Implements requirements for the partition and bootloader setup
in order to build images for ppc64 architectures. Fixes #18
2016-03-08 11:54:09 +01:00
Marcus Schäfer
612c574148
Continue Refactor into subpackage
system install, update, size, users, result should have their own namespace
2016-03-07 17:33:39 +01:00
Marcus Schäfer
f5da3dd117
Release mount after data sync for volume managers 2016-03-06 14:38:39 +01:00
Marcus Schäfer
ec92ffdba1
Fixed LVM volume setup for oem image type
For the oem image type the requested volume sizes are applied
on first boot of the appliance. Therefore inside of the image
the volumes only needs to be created with their minimum required
size
2016-03-04 17:20:48 +01:00
Marcus Schäfer
00fb222bc3
Fixed kernel names for dracut initrd system
If dracut is used as initrd system we should not use the
kiwi one shot names linux.vmx, initrd.vmx but stick with
the official naming convention for kernel and initrd which
is kernel-<version>, initrd-<version>
2016-03-02 21:38:02 +01:00
Marcus Schäfer
d0fa83681f
Added support for using dracut initrd
As of today only the kiwi initrd could be used with an image
build. This commit adds a new initrd_system attribute and
allows to select between kiwi and dracut as initrd system.
Please note the dracut initrd does not support all features
of the kiwi initrd. This fixes #25
2016-02-29 20:52:25 +01:00
Marcus Schäfer
f644d39a2f
Continue Refactor into subpackage
storage operations should have their own namespace
2016-02-29 11:37:27 +01:00