Commit Graph

78 Commits

Author SHA1 Message Date
Marcus Schäfer
de7ee77b84
Follow up fix for grub2 setup in live builder
The live iso builder still used a fixed boot/grub2 path
but due to the refactoring this path is now distro dependant
and should be obtained dynamically
2017-04-10 15:04:33 +02:00
Marcus Schäfer
e16dc8702b
Support editbootconfig also for the iso type
This Fixes #274
2017-03-24 11:09:54 +01:00
Marcus Schäfer
de7e49a6cf
Fixup pxe builder
filesystem image rootfs was not in toplevel
2017-03-20 12:53:58 +01:00
Marcus Schäfer
6346658ab3
Fixup pxe builder
Generate a tarball containing all relevant pxe boot result
files instead of a bunch of extra files. This also turns
the pxe builder to be compatible again with the legacy
kiwi pxe bundler
2017-03-20 11:32:30 +01:00
Marcus Schäfer
aae800ae6d
Don't create shasum over an md5 file 2017-03-17 16:09:41 +01:00
David Cassany
f71f7aea18 Refactor RootImport to keep images with a default name
RootImport has been refactored so the image is kept with a known
name that can be obtained with the Defaults class.
2017-03-15 09:47:35 +01:00
Marcus Schäfer
ad2ca8d2aa
Refactor ContainerBuilder
Use Checksum instance to run a checksum match
Check for existence of base image at earliest opportunity
when constructing a ContainerBuilder
2017-03-14 10:22:59 +01:00
Marcus Schäfer
0f68081211 Handle derived image as Uri instance 2017-03-13 20:20:24 +01:00
David Cassany
98d56ea34f Refactored RootImport and included checksum validation
First, commit refactors RootImport in order to also copy
the imported image after sychronizing the import.

Second, it includes a checksum of the copied image which is
validated in later steps.
2017-03-13 20:20:24 +01:00
David Cassany
9e8eb94d6d Support for layered docker images
This commit includes support for building layered docker. A new
layer is added on top of the base image referenced by `derived_from`
attribute.
2017-03-13 20:20:24 +01:00
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
3e6848ed88 Refactor docker container creation
Instead of creating a simple tarball the tools umoci and skopeo
from the docker tool chain are used to create official docker
images. Along with those tools more information to describe a
container has been added to the schema. A complete container
setup now consists of the following elements

<type image="docker">
    <containerconfig name="..." maintainer="..." user="..." workingdir="...">
        <entrypoint execute="command">
            <argument name="option"/>
            ...
        </entrypoint>
        <subcommand execute="command">
            <argument name="option"/>
            ...
        </subcommand>
        <expose>
            <port number="..."/>
            ...
        </expose>
        <volumes>
            <volume name="..."/>
            ...
        </volumes>
        <environment>
            <env name="variable" value="value"/>
            ...
        </environment>
        <labels>
            <label name="..." value="..."/>
            ...
        </labels>
    </containerconfig>
</type>
2017-02-27 15:28:38 +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
760c88682f
Update container builder code to new schema layout 2017-01-09 11:30:01 +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
228c2cdf38 Merge pull request #152 from SUSE/fix_secure_boot_for_iso_media
Fixed secure boot setup for iso media
2016-10-01 21:18:20 +02:00
David Cassany
7b7010482c Added forcing UDF filesystem for large images
Included -udf flag to force UDF filesystem usage
2016-09-30 17:35:41 +02:00
Marcus Schäfer
6a611b2e91
Fixed secure boot setup for iso media
Provide the shim loader and the shim signed grub loader in the
required boot path. Normally this task is done by the shim-install
tool. However, shim-install does not exist on all distributions
and the script does not operate well in CD environments from which
we generate live and/or install media. Thus shim-install is used
if possible at install time of the bootloader because it requires
access to the target block device. In any other case the kiwi
fallback code applies
2016-09-30 15:00:22 +02:00
David Cassany
404b71aedc Added support for mkisofs
genisoimage and mkisofs tools are slightly different so this commit
makes sure all flags are supported in both tools.
2016-09-30 12:11:03 +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
ffbfaf772d
Fixed pxe install archive md5 file
The md5 sum must be created from the uncompressed version
of the disk image
2016-09-13 12:01:30 +02:00
Marcus Schäfer
31844bffd8 Added missing trigger file for oem pxe install
The config.vmxsystem trigger file was missing in the oem
install initrd used when deploying a disk image over pxe
2016-09-13 11:14:29 +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
e0c83d6516 Merge pull request #73 from SUSE/runtime-checker
Runtime checker
2016-05-08 19:47:06 +02:00
Marcus Schäfer
400468a455 Cleanup use of temporary directories
All mkdtemp created directories are created with the 'kiwi_'
prefix. In addition all code parts which leaves tmpdirs in
the system after kiwi is done were fixed
2016-05-04 11:05:03 +02:00
Marcus Schäfer
685c830e45 Add shared cache location to Defaults 2016-04-29 14:30:15 +00:00