Hello community, here is the log from the commit of package python-kiwi for openSUSE:Factory checked in at 2018-02-16 21:39:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kiwi (Old) and /work/SRC/openSUSE:Factory/.python-kiwi.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kiwi" Fri Feb 16 21:39:00 2018 rev:19 rq:576012 version:9.12.9 Changes: -------- --- /work/SRC/openSUSE:Factory/python-kiwi/python-kiwi.changes 2018-02-09 15:43:33.875968878 +0100 +++ /work/SRC/openSUSE:Factory/.python-kiwi.new/python-kiwi.changes 2018-02-16 21:39:02.319278839 +0100 @@ -1,0 +2,82 @@ +Mon Feb 12 16:48:17 CET 2018 - [email protected] + +- Bump version: 9.12.8 → 9.12.9 + +------------------------------------------------------------------- +Mon Feb 12 15:55:46 CET 2018 - [email protected] + +- Update .virtualenv.dev-requirements.txt + + sphinx 1.7.0 is not compatible with travis-sphinx + thus we stick with 1.6.7 until travis-sphinx followed + the sphinx changes + +------------------------------------------------------------------- +Mon Feb 12 14:51:17 CET 2018 - [email protected] + +- Add restrictions to Path.remove_hierarchy + + When an iso file is used as repo, this iso will be loop mounted on + the host and bind mounted into the image root as long as the image + builds. When the mount is released a recursive cleanup of the complete + path happens. This is done by calling Path.remove_hierarchy. However + if a sub path of the mount path contains a system root directory + which is mandatory for the Linux root system it is not allowed + to be deleted even if it is empty at the time of the mount cleanup. + Thus this patch adds a lookup for protected directory names and + only runs the recursive deletion as long as no protected member + is part of the path. This fixes bsc#1080301 + +------------------------------------------------------------------- +Sat Feb 10 22:49:25 CET 2018 - [email protected] + +- Initial support for building Debian/Ubuntu packages in spec + + This adds support for producing the main kiwi package as well as the + packages for the dracut modules to be used when building Debian-based + distribution images with KIWI. + + The Debian/Ubuntu package is built using debbuild: https://github.com/ascherer/debbuild + +------------------------------------------------------------------- +Fri Feb 9 15:38:16 CET 2018 - [email protected] + +- Fixed build_pxe_root_filesystem documentation + + The article still used filename references from v7 code stream + This patch updates the docs to match the sources it refers to + +------------------------------------------------------------------- +Wed Feb 7 14:38:47 CET 2018 - [email protected] + +- Update dropped features documentation + + The information on the partition based install method was + unclear and misleading. This patch clarifies the documentation + in this regard + +------------------------------------------------------------------- +Wed Feb 7 14:22:58 CET 2018 - [email protected] + +- Delete obsolete ovf format value + + Support for ova has been added which makes the ovf format + value obsolete and redundant + +------------------------------------------------------------------- +Tue Feb 6 15:55:55 CET 2018 - [email protected] + +- OVA: Print a user-friendly message if ovftool is not available + +------------------------------------------------------------------- +Tue Feb 6 15:55:29 CET 2018 - [email protected] + +- OVA: Require ovftype="vmware" + +------------------------------------------------------------------- +Mon Feb 5 18:33:10 CET 2018 - [email protected] + +- Expand consistency check for grub efi package to cover debian based + and RH distros + +------------------------------------------------------------------- @@ -28,0 +111,11 @@ +Mon Feb 5 10:13:14 CET 2018 - [email protected] + +- Fix style error + +------------------------------------------------------------------- +Mon Feb 5 09:29:07 CET 2018 - [email protected] + +- Early exit if firmware is efi or uefi but the expected grub module is + not part of the package list + +------------------------------------------------------------------- @@ -162,0 +256,9 @@ +Fri Jan 26 12:19:18 CET 2018 - [email protected] + +- Add support for building OVA images + + Implement support for format="ova" using VMware's ovftool. We use the + vmdk format as a basis and then just call ovftool to convert *.vmdk + + *.vmx to an OVA. + +------------------------------------------------------------------- @@ -169,0 +272,10 @@ + +------------------------------------------------------------------- +Fri Jan 26 11:02:39 CET 2018 - [email protected] + +- flake8: Use a more conservative max-complexity setting + + Set the default threshold to 12 and annotate the outliers with + "noqa: C901". Most of the cases are due to lack of switch statement in + python, but there are some worth titying up. Now we can grep for them + :). ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kiwi.spec ++++++ --- /var/tmp/diff_new_pack.509du0/_old 2018-02-16 21:39:03.283244039 +0100 +++ /var/tmp/diff_new_pack.509du0/_new 2018-02-16 21:39:03.287243894 +0100 @@ -16,7 +16,13 @@ # -%{!?python2_sitelib:%global python2_sitelib %{python_sitelib}} +%{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc} +%{!?__python2: %global __python2 /usr/bin/python2} + +# Expanded form required for debbuild's simpler engine +%if %{undefined python2_sitelib} +%global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%endif # translate version id to distribution name as it is used in kiwi # generic approach @@ -92,14 +98,40 @@ %define distro fedora-25.0 %endif +# Ubuntu +# Use xenial templates for 16.04 and newer +%if 0%{?ubuntu} >= 1604 +%define distro ubuntu-xenial +%endif + +# Debian +# Use the stretch templates for 9 and newer +%if 0%{?debian} >= 9 +%define distro debian-stretch +%endif + +%if 0%{?debian} || 0%{?ubuntu} +%global is_deb 1 +%global pygroup python +%global sysgroup admin +%global develsuffix dev +%else +%global pygroup Development/Languages/Python +%global sysgroup System/Management +%global develsuffix devel +%endif + Name: python-kiwi -Version: 9.12.8 +Version: 9.12.9 Release: 0 Provides: kiwi-schema = 6.6 Url: https://github.com/SUSE/kiwi Summary: KIWI - Appliance Builder Next Generation License: GPL-3.0+ -Group: Development/Languages/Python +Group: %{pygroup} +%if %{_vendor} == "debbuild" +# Needed to set Maintainer in output debs +%endif Source: %{name}.tar.gz Source1: %{name}-boot-packages Source2: %{name}-rpmlintrc @@ -109,12 +141,15 @@ BuildRequires: python3-devel BuildRequires: python3-setuptools %endif -BuildRequires: python-devel +BuildRequires: python-%{develsuffix} BuildRequires: python-setuptools %if 0%{?suse_version} BuildRequires: shadow BuildRequires: update-alternatives %endif +%if 0%{?debian} || 0%{?ubuntu} +BuildRequires: passwd +%endif %if 0%{?fedora} || 0%{?rhel} BuildRequires: chkconfig %endif @@ -127,12 +162,16 @@ # python2-kiwi %package -n python2-kiwi Summary: KIWI - Appliance Builder Next Generation -Group: Development/Languages/Python +Group: %{pygroup} Provides: python-kiwi = %{version}-%{release} %if 0%{?fedora} || 0%{?suse_version} Recommends: jing %endif +%if 0%{?debian} || 0%{?ubuntu} +Requires: python-yaml +%else Requires: python-PyYAML +%endif Requires: python-docopt Requires: python-future Requires: python-lxml @@ -172,6 +211,13 @@ Requires: zypper Provides: kiwi-packagemanager:zypper %endif +%if 0%{?debian} || 0%{?ubuntu} +Requires: debootstrap +Requires: gdisk +Requires: multipath-tools +Requires: qemu-utils +Requires: squashfs-tools +%endif Requires: dosfstools Requires: e2fsprogs Requires: genisoimage @@ -183,12 +229,15 @@ Requires: parted Requires: rsync Requires: tar >= 1.2.7 +%if %{_vendor} != "debbuild" +# Not supported with debbuild yet %ifarch %arm aarch64 Requires: u-boot-tools %endif %ifarch s390 s390x Requires: s390-tools %endif +%endif %description -n python2-kiwi Python 2 library of the KIWI Image System. Provides an operating system @@ -270,7 +319,7 @@ %package -n kiwi-tools Summary: KIWI - Collection of Boot Helper Tools -Group: System/Management +Group: %{sysgroup} %description -n kiwi-tools This package contains a small set of helper tools used for the @@ -278,10 +327,11 @@ first boot of an appliance. The tools are not meant to be used outside of the scope of kiwi appliance building. +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %package -n kiwi-pxeboot Summary: KIWI - PXE boot structure -Group: System/Management +Group: %{sysgroup} Requires: syslinux %if 0%{?fedora} || 0%{?rhel} Requires(pre): shadow-utils @@ -293,14 +343,20 @@ This package contains the basic PXE directory structure which is needed to serve kiwi built images via PXE. %endif +%endif %package -n dracut-kiwi-lib Summary: KIWI - Dracut kiwi Library -Group: System/Management +Group: %{sysgroup} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: bc Requires: cryptsetup -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: btrfs-progs Requires: gdisk %else @@ -309,7 +365,6 @@ %endif Requires: coreutils Requires: curl -Requires: device-mapper Requires: dialog Requires: e2fsprogs Requires: grep @@ -319,7 +374,13 @@ Requires: pv Requires: util-linux Requires: xfsprogs +%if 0%{?debian} || 0%{?ubuntu} +Requires: dmsetup +Requires: xz-utils +%else +Requires: device-mapper Requires: xz +%endif %ifarch s390 s390x Requires: s390-tools %endif @@ -330,8 +391,13 @@ %package -n dracut-kiwi-oem-repart Summary: KIWI - Dracut module for oem(repart) image type -Group: System/Management +Group: %{sysgroup} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dracut-kiwi-lib %description -n dracut-kiwi-oem-repart @@ -341,12 +407,17 @@ %package -n dracut-kiwi-oem-dump Summary: KIWI - Dracut module for oem(install) image type -Group: System/Management +Group: %{sysgroup} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dmraid Requires: dracut-kiwi-lib Requires: kexec-tools -%if 0%{?suse_version} +%if 0%{?suse_version} || 0%{?debian} || 0%{?ubuntu} Requires: multipath-tools %endif %if 0%{?fedora} || 0%{?rhel} @@ -364,15 +435,24 @@ %package -n dracut-kiwi-live Summary: KIWI - Dracut module for iso(live) image type -Group: System/Management +Group: %{sysgroup} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut -Requires: device-mapper +%endif Requires: dialog -Requires: dracut Requires: e2fsprogs Requires: util-linux Requires: xfsprogs -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?debian} || 0%{?ubuntu} +Requires: dmsetup +%else +Requires: device-mapper +%endif +Requires: dracut +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: genisoimage %else Requires: cdrkit-cdrtools-compat @@ -384,8 +464,13 @@ %package -n dracut-kiwi-overlay Summary: KIWI - Dracut module for vmx(+overlay) image type -Group: System/Management +Group: %{sysgroup} +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dracut Requires: util-linux @@ -397,7 +482,7 @@ %if 0%{?suse_version} %package -n kiwi-boot-requires Summary: KIWI - buildservice package requirements for boot images -Group: System/Management +Group: %{sysgroup} Provides: kiwi-boot:netboot Provides: kiwi-boot:oemboot Provides: kiwi-filesystem:btrfs @@ -415,7 +500,7 @@ Requires: skopeo Requires: umoci Requires: xfsprogs -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: btrfs-progs %else Requires: btrfsprogs @@ -437,7 +522,7 @@ %package -n kiwi-man-pages Summary: KIWI - manual pages -Group: System/Management +Group: %{sysgroup} %description -n kiwi-man-pages Provides manual pages to describe the kiwi commands @@ -456,13 +541,14 @@ %install # Install Python 2 version -python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} +python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} %if 0%{?fedora} || 0%{?suse_version} # Install Python 3 version -python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} +python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} %endif +%if %{_vendor} != "debbuild" # init alternatives setup mkdir -p %{buildroot}%{_sysconfdir}/alternatives @@ -487,6 +573,7 @@ mkdir -p %{buildroot}/srv/tftpboot/$i ;\ done %endif +%endif %if 0%{?fedora} || 0%{?rhel} install -m 755 -d %{buildroot}/%{_defaultdocdir}/python-kiwi @@ -536,6 +623,7 @@ --remove kiwicompat %_bindir/kiwicompat %endif +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %pre -n kiwi-pxeboot #============================================================ @@ -548,6 +636,7 @@ -r -s /bin/false tftp fi %endif +%endif %files -n python2-kiwi %defattr(-,root,root,-) @@ -586,11 +675,10 @@ %files -n kiwi-tools %defattr(-, root, root) -%exclude %{_bindir}/kiwi -%exclude %{_bindir}/kiwicompat -%exclude %{_bindir}/kiwi-ng* -%exclude %{_bindir}/kiwicompat-* -%{_bindir}/* +%{_bindir}/dcounter +%{_bindir}/isconsole +%{_bindir}/kversion +%{_bindir}/utimer %files -n dracut-kiwi-lib %defattr(-, root, root) @@ -612,6 +700,7 @@ %defattr(-, root, root) %{_usr}/lib/dracut/modules.d/90kiwi-overlay +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %files -n kiwi-pxeboot %defattr(-, root, root) @@ -622,6 +711,7 @@ %dir /srv/tftpboot/upload %dir /srv/tftpboot/boot %endif +%endif %if 0%{?suse_version} %files -n kiwi-boot-requires ++++++ python-kiwi.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/.bumpversion.cfg new/kiwi-9.12.9/.bumpversion.cfg --- old/kiwi-9.12.8/.bumpversion.cfg 2018-02-05 17:02:18.000000000 +0100 +++ new/kiwi-9.12.9/.bumpversion.cfg 2018-02-12 16:48:17.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 9.12.8 +current_version = 9.12.9 commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/.virtualenv.dev-requirements.txt new/kiwi-9.12.9/.virtualenv.dev-requirements.txt --- old/kiwi-9.12.8/.virtualenv.dev-requirements.txt 2018-02-05 10:45:01.000000000 +0100 +++ new/kiwi-9.12.9/.virtualenv.dev-requirements.txt 2018-02-12 15:56:49.000000000 +0100 @@ -37,7 +37,12 @@ generateDS # for building documentation -sphinx + +# sphinx 1.7.0 is not compatible with travis-sphinx +# thus we stick with 1.6.7 until travis-sphinx followed +# the sphinx changes +sphinx==1.6.7 + sphinx_rtd_theme sphinxcontrib-spelling pyenchant diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/PKG-INFO new/kiwi-9.12.9/PKG-INFO --- old/kiwi-9.12.8/PKG-INFO 2018-02-05 17:07:18.000000000 +0100 +++ new/kiwi-9.12.9/PKG-INFO 2018-02-12 16:53:24.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kiwi -Version: 9.12.8 +Version: 9.12.9 Summary: KIWI - Appliance Builder (next generation) Home-page: http://suse.github.io/kiwi Author: Marcus Schaefer Binary files old/kiwi-9.12.8/boot_arch.tgz and new/kiwi-9.12.9/boot_arch.tgz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi.8 new/kiwi-9.12.9/doc/build/man/kiwi.8 --- old/kiwi-9.12.8/doc/build/man/kiwi.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi \- Creating Operating System Images . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::image::info.8 new/kiwi-9.12.9/doc/build/man/kiwi::image::info.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::image::info.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::image::info.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::IMAGE::INFO" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::IMAGE::INFO" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::image::info \- Provide detailed information about an image description . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::image::resize.8 new/kiwi-9.12.9/doc/build/man/kiwi::image::resize.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::image::resize.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::image::resize.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::IMAGE::RESIZE" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::IMAGE::RESIZE" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::image::resize \- Resize disk images to new geometry . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::result::bundle.8 new/kiwi-9.12.9/doc/build/man/kiwi::result::bundle.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::result::bundle.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::result::bundle.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::RESULT::BUNDLE" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::RESULT::BUNDLE" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::result::bundle \- Bundle build results . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::result::list.8 new/kiwi-9.12.9/doc/build/man/kiwi::result::list.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::result::list.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::result::list.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::RESULT::LIST" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::RESULT::LIST" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::result::list \- List build results . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::system::build.8 new/kiwi-9.12.9/doc/build/man/kiwi::system::build.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::system::build.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::system::build.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::BUILD" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::SYSTEM::BUILD" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::system::build \- Build image in combined prepare and create step . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::system::create.8 new/kiwi-9.12.9/doc/build/man/kiwi::system::create.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::system::create.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::system::create.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::CREATE" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::SYSTEM::CREATE" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::system::create \- Create image from prepared root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::system::prepare.8 new/kiwi-9.12.9/doc/build/man/kiwi::system::prepare.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::system::prepare.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::system::prepare.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::PREPARE" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::SYSTEM::PREPARE" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::system::prepare \- Prepare image root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/build/man/kiwi::system::update.8 new/kiwi-9.12.9/doc/build/man/kiwi::system::update.8 --- old/kiwi-9.12.8/doc/build/man/kiwi::system::update.8 2018-02-05 17:07:12.000000000 +0100 +++ new/kiwi-9.12.9/doc/build/man/kiwi::system::update.8 2018-02-12 16:53:13.000000000 +0100 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH "KIWI::SYSTEM::UPDATE" "8" "Feb 05, 2018" "9.12.8" "kiwi" +.TH "KIWI::SYSTEM::UPDATE" "8" "Feb 12, 2018" "9.12.9" "kiwi" .SH NAME kiwi::system::update \- Update/Upgrade image root system . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/source/building/build_oem_disk.rst new/kiwi-9.12.9/doc/source/building/build_oem_disk.rst --- old/kiwi-9.12.8/doc/source/building/build_oem_disk.rst 2018-01-30 15:15:42.000000000 +0100 +++ new/kiwi-9.12.9/doc/source/building/build_oem_disk.rst 2018-02-07 14:44:41.000000000 +0100 @@ -38,6 +38,8 @@ hybrid installation system which contains the OEM disk image and is capable to install this image on any target disk. +.. _deployment_methods: + Deployment Methods ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/source/building/build_pxe_root_filesystem.rst new/kiwi-9.12.9/doc/source/building/build_pxe_root_filesystem.rst --- old/kiwi-9.12.8/doc/source/building/build_pxe_root_filesystem.rst 2018-01-30 15:15:42.000000000 +0100 +++ new/kiwi-9.12.9/doc/source/building/build_pxe_root_filesystem.rst 2018-02-09 15:37:23.000000000 +0100 @@ -86,8 +86,8 @@ .. code:: bash - $ cp initrd-netboot-suse-*.gz /srv/tftpboot/boot/initrd - $ cp initrd-netboot-suse-*.kernel /srv/tftpboot/boot/linux + $ cp *.initrd.xz /srv/tftpboot/boot/initrd + $ cp *.kernel /srv/tftpboot/boot/linux 5. Copy the system image and its MD5 sum to :file:`/srv/tftpboot/image`: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/source/conf.py new/kiwi-9.12.9/doc/source/conf.py --- old/kiwi-9.12.8/doc/source/conf.py 2018-02-05 17:02:18.000000000 +0100 +++ new/kiwi-9.12.9/doc/source/conf.py 2018-02-12 16:48:17.000000000 +0100 @@ -93,7 +93,7 @@ # built documents. # # The short X.Y version. -version = u'9.12.8' +version = u'9.12.9' # The full version, including alpha/beta/rc tags. release = version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/doc/source/overview/legacy_kiwi.rst new/kiwi-9.12.9/doc/source/overview/legacy_kiwi.rst --- old/kiwi-9.12.8/doc/source/overview/legacy_kiwi.rst 2018-01-30 15:15:42.000000000 +0100 +++ new/kiwi-9.12.9/doc/source/overview/legacy_kiwi.rst 2018-02-07 14:44:41.000000000 +0100 @@ -74,65 +74,58 @@ The following features have been dropped. If you make use of them consider to use the legacy KIWI version. -* Split systems - - The legacy KIWI version supports building of split systems - which uses a static definition of files and directories marked - as read-only or read-write. Evolving technologies like overlayfs - makes this feature obsolete. - -* ZFS filesystem - - The successor for ZFS is Btrfs in the opensource world. All major - distributions put on Btrfs. This and the proprietary attitude of - ZFS obsoletes the feature. - -* Reiserfs filesystem - - The number of people using this filesystem is decreasing. For image - building reiserfs was an interesting filesystem however with Btrfs and - XFS there are good non inode based alternatives out there. Therefore we - don't continue supporting Reiserfs. - -* Btrfs seed based live systems - - A Btrfs seed device is an alternative for other copy on write - filesystems like overlayfs. Unfortunately the stability of the seed - device when used as cow part in a live system was not as good as we - provide with overlayfs and clicfs. Therefore this variant is no longer - supported. We might think of adding this feature back if people demand - it. - -* lxc container format - - lxc has a successor in docker based on the former lxc technology. - Many distributions also dropped the lxc tools from the distribution - in favour of docker. - -* OEM Recovery/Restore - - Recovery/Restore in the world of images has been moved from the - operating system layer into higher layers. For example, in private and - public Cloud environments disk and image recovery as well as backup - strategies are part of Cloud services. Pure operating system recovery - and snapshots for consumer machines are provided as features of the - distribution. SUSE as an example provides this via Rear - (Relax-and-Recover) and snapshot based filesystems (btrfs+snapper). - Therefore the recovery feature offered in the legacy KIWI version - will not be continued. - -* OEM Partition Install - - The feature allows to install an image partition based. - Instead of selecting a target disk the user selects target partitions. - Target partitions could be on several disks. Each partition of an image - had to be mapped on a selectable target partition. In the end it has - turned out that a lot of user experience in a very sensitive area of - the operating system is required. Combined with a high risk to do the - wrong thing and more user interaction to install the system. This is - contrary to the idea of images which should allow to give the user a - functional entity at hand, dump it and be happy. Thus the partition - based install method will not be continued. +Split systems + The legacy KIWI version supports building of split systems + which uses a static definition of files and directories marked + as read-only or read-write. Evolving technologies like overlayfs + makes this feature obsolete. + +ZFS filesystem + The successor for ZFS is Btrfs in the opensource world. All major + distributions put on Btrfs. This and the proprietary attitude of + ZFS obsoletes the feature. + +Reiserfs filesystem + The number of people using this filesystem is decreasing. For image + building reiserfs was an interesting filesystem however with Btrfs and + XFS there are good non inode based alternatives out there. Therefore we + don't continue supporting Reiserfs. + +Btrfs seed based live systems + A Btrfs seed device is an alternative for other copy on write + filesystems like overlayfs. Unfortunately the stability of the seed + device when used as cow part in a live system was not as good as we + provide with overlayfs and clicfs. Therefore this variant is no longer + supported. We might think of adding this feature back if people demand + it. + +lxc container format + lxc has a successor in docker based on the former lxc technology. + Many distributions also dropped the lxc tools from the distribution + in favour of docker. + +OEM Recovery/Restore + Recovery/Restore in the world of images has been moved from the + operating system layer into higher layers. For example, in private and + public Cloud environments disk and image recovery as well as backup + strategies are part of Cloud services. Pure operating system recovery + and snapshots for consumer machines are provided as features of the + distribution. SUSE as an example provides this via Rear + (Relax-and-Recover) and snapshot based filesystems (btrfs+snapper). + Therefore the recovery feature offered in the legacy KIWI version + will not be continued. + +Partition based install method in OEM install image + The section :ref:`deployment_methods` describes the supported OEM + installation procedures. The legacy KIWI version also provided a method + to install an image based on the partitions of the OEM disk image. + Instead of selecting one target disk to dump the entire image file to, + the user selects target partitions. Target partitions could be located + on several disks. Each partition of the OEM disk image must be mapped + on a selectable target partition. It turned out, users needed a lot of + experience in a very sensitive area of the operating system. This is + contrary to the idea of images to be dumped and be happy. Thus the + partition based install method will not be continued. Compatibility ------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/builder/disk.py new/kiwi-9.12.9/kiwi/builder/disk.py --- old/kiwi-9.12.8/kiwi/builder/disk.py 2018-01-30 10:24:10.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/builder/disk.py 2018-02-07 14:10:14.000000000 +0100 @@ -563,7 +563,7 @@ ) self.system_boot = filesystem - def _build_and_map_disk_partitions(self): + def _build_and_map_disk_partitions(self): # noqa: C901 self.disk.wipe() if self.firmware.legacy_bios_mode(): log.info('--> creating EFI CSM(legacy bios) partition') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/container/oci.py new/kiwi-9.12.9/kiwi/container/oci.py --- old/kiwi-9.12.8/kiwi/container/oci.py 2017-10-25 12:23:42.000000000 +0200 +++ new/kiwi-9.12.9/kiwi/container/oci.py 2018-02-07 14:10:14.000000000 +0100 @@ -52,7 +52,7 @@ * labels: container labels * xz_options: string of XZ compression parameters """ - def __init__(self, root_dir, custom_args=None): + def __init__(self, root_dir, custom_args=None): # noqa: C901 self.root_dir = root_dir self.oci_dir = None self.oci_root_dir = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/defaults.py new/kiwi-9.12.9/kiwi/defaults.py --- old/kiwi-9.12.8/kiwi/defaults.py 2018-01-30 10:24:10.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/defaults.py 2018-02-12 13:03:40.000000000 +0100 @@ -514,7 +514,7 @@ :rtype: list """ return [ - 'gce', 'qcow2', 'vmdk', 'vmx', 'vhd', 'vhdx', + 'gce', 'qcow2', 'vmdk', 'ova', 'vmx', 'vhd', 'vhdx', 'vhdfixed', 'vdi', 'vagrant.libvirt.box' ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/partitioner/__init__.py new/kiwi-9.12.9/kiwi/partitioner/__init__.py --- old/kiwi-9.12.8/kiwi/partitioner/__init__.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/kiwi/partitioner/__init__.py 2018-02-07 14:10:14.000000000 +0100 @@ -39,7 +39,7 @@ * :attr:`storage_provider` Instance of class based on DeviceProvider """ - def __new__(self, table_type, storage_provider): + def __new__(self, table_type, storage_provider): # noqa: C901 host_architecture = platform.machine() if host_architecture == 'x86_64': if table_type == 'gpt': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/path.py new/kiwi-9.12.9/kiwi/path.py --- old/kiwi-9.12.8/kiwi/path.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/kiwi/path.py 2018-02-12 16:41:10.000000000 +0100 @@ -90,13 +90,27 @@ def remove_hierarchy(self, path): """ Recursively remove an empty path and its sub directories - ignore non empty paths and leave them untouched + ignore non empty or protected paths and leave them untouched :param string path: path name """ Command.run( - ['rmdir', '-p', '--ignore-fail-on-non-empty', path] + ['rmdir', '--ignore-fail-on-non-empty', path] ) + path_elements = path.split(os.sep) + protected_elements = [ + 'boot', 'dev', 'proc', 'run', 'sys', 'tmp' + ] + for path_index in reversed(range(0, len(path_elements))): + sub_path = os.sep.join(path_elements[0:path_index]) + if path_elements[path_index - 1] in protected_elements: + log.warning( + 'remove_hierarchy: path {0} is protected'.format(sub_path) + ) + return + Command.run( + ['rmdir', '--ignore-fail-on-non-empty', sub_path] + ) @classmethod def which( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/runtime_checker.py new/kiwi-9.12.9/kiwi/runtime_checker.py --- old/kiwi-9.12.8/kiwi/runtime_checker.py 2018-01-22 19:28:52.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/runtime_checker.py 2018-02-07 14:10:14.000000000 +0100 @@ -245,7 +245,9 @@ kernel_package_sections.append(package) for package in kernel_package_sections: - if boot_xml_state.package_matches_host_architecture(package): + if boot_xml_state.package_matches_host_architecture( + package + ): boot_kernel_package_name = package.get_name() if boot_kernel_package_name: @@ -412,6 +414,34 @@ if overlayroot and firmware == 'uefi': raise KiwiRuntimeError(message) + def check_grub_efi_installed_for_efi_firmware(self): + """ + If the image is being built with efi or uefi firmware setting + we need a grub(2)-*-efi package installed. The check is not 100% + as every distribution has different names and different requirement + but it is a reasonable approximation on the safe side meaning the + user may still get an error but should not receive a false positive + """ + message = dedent('''\n + Firmware set to efi or uefi but not grub*efi* package is + part of the image build. + ''') + firmware = self.xml_state.build_type.get_firmware() + if firmware in ('efi', 'uefi'): + grub_efi_packages = ( + 'grub2-x86_64-efi', # SUSE + 'grub-efi', # Debian based distros have grub-efi-* + 'grub2-efi' # RedHat + ) + package_names = \ + self.xml_state.get_bootstrap_packages() + \ + self.xml_state.get_system_packages() + for grub_package in grub_efi_packages: + for package_name in package_names: + if package_name.startswith(grub_package): + return True + raise KiwiRuntimeError(message) + def check_xen_uniquely_setup_as_server_or_guest(self): """ If the image is classified to be used as Xen image, it can diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/schema/kiwi.rnc new/kiwi-9.12.9/kiwi/schema/kiwi.rnc --- old/kiwi-9.12.8/kiwi/schema/kiwi.rnc 2018-01-22 19:28:47.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/schema/kiwi.rnc 2018-02-07 14:44:41.000000000 +0100 @@ -1416,7 +1416,7 @@ k.type.format.attribute = ## Specifies the format of the virtual disk. attribute format { - "gce" | "ovf" | "ova" | "qcow2" | "vagrant" | "vmdk" | + "gce" | "ova" | "qcow2" | "vagrant" | "vmdk" | "vdi" | "vhd" | "vhdx" | "vhd-fixed" } >> sch:pattern [ id = "format" is-a = "image_type" @@ -1840,7 +1840,7 @@ div { k.vmdisk.disktype.attribute = ## The type of the disk as it is internally handled - ## by the VM (ovf only) + ## by the VM (ova only) attribute disktype { text } k.vmdisk.controller.attribute = ## The disk controller used for the VM guest (vmdk only) @@ -2404,11 +2404,17 @@ # div { k.machine.ovftype.attribute = - ## The OVF configuration type + ## The OVF configuration type. + ## The Open Virtualization Format is a standard for describing + ## virtual appliances and distribute them in an archive also + ## called Open Virtual Appliance(OVA). The standard describes + ## major components associated with a disk image. The exact + ## specification depends on the product using the format + ## and is specified in KIWI as the OVF type. attribute ovftype { "zvm" | "powervm" | "xen" | "vmware" } k.machine.HWversion.attribute = ## The virtual HW version number for the VM configuration - ## (vmdk and ovf) + ## (vmdk and ova) attribute HWversion { xsd:integer } k.machine.arch.attribute = ## the VM architecture type (vmdk only) @@ -2418,20 +2424,20 @@ attribute xen_loader { "hvmloader" | "pygrub" | "pvgrub" } k.machine.guestOS.attribute = ## The virtual guestOS identification string for the VM - ## (vmdk and ovf, note the name designation is different for the two + ## (vmdk and ova, note the name designation is different for the two ## formats) attribute guestOS { text } k.machine.min_memory.attribute = - ## The virtual machine min memory in MB (ovf only) + ## The virtual machine min memory in MB (ova only) attribute min_memory { xsd:nonNegativeInteger } k.machine.max_memory.attribute = - ## The virtual machine max memory in MB (ovf only) + ## The virtual machine max memory in MB (ova only) attribute max_memory { xsd:nonNegativeInteger } k.machine.min_cpu.attribute = - ## The virtual machine min CPU count (ovf only) + ## The virtual machine min CPU count (ova only) attribute min_cpu { xsd:nonNegativeInteger } k.machine.max_cpu.attribute = - ## The virtual machine max CPU count (ovf only) + ## The virtual machine max CPU count (ova only) attribute max_cpu { xsd:nonNegativeInteger } k.machine.memory.attribute = ## The memory, in MB, setup for the guest VM (all formats) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/schema/kiwi.rng new/kiwi-9.12.9/kiwi/schema/kiwi.rng --- old/kiwi-9.12.8/kiwi/schema/kiwi.rng 2018-01-22 19:28:47.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/schema/kiwi.rng 2018-02-07 14:44:41.000000000 +0100 @@ -2108,7 +2108,6 @@ <a:documentation>Specifies the format of the virtual disk.</a:documentation> <choice> <value>gce</value> - <value>ovf</value> <value>ova</value> <value>qcow2</value> <value>vagrant</value> @@ -2825,7 +2824,7 @@ <define name="k.vmdisk.disktype.attribute"> <attribute name="disktype"> <a:documentation>The type of the disk as it is internally handled -by the VM (ovf only)</a:documentation> +by the VM (ova only)</a:documentation> </attribute> </define> <define name="k.vmdisk.controller.attribute"> @@ -3736,7 +3735,13 @@ <div> <define name="k.machine.ovftype.attribute"> <attribute name="ovftype"> - <a:documentation>The OVF configuration type</a:documentation> + <a:documentation>The OVF configuration type. +The Open Virtualization Format is a standard for describing +virtual appliances and distribute them in an archive also +called Open Virtual Appliance(OVA). The standard describes +major components associated with a disk image. The exact +specification depends on the product using the format +and is specified in KIWI as the OVF type.</a:documentation> <choice> <value>zvm</value> <value>powervm</value> @@ -3748,7 +3753,7 @@ <define name="k.machine.HWversion.attribute"> <attribute name="HWversion"> <a:documentation>The virtual HW version number for the VM configuration -(vmdk and ovf)</a:documentation> +(vmdk and ova)</a:documentation> <data type="integer"/> </attribute> </define> @@ -3774,31 +3779,31 @@ <define name="k.machine.guestOS.attribute"> <attribute name="guestOS"> <a:documentation>The virtual guestOS identification string for the VM -(vmdk and ovf, note the name designation is different for the two +(vmdk and ova, note the name designation is different for the two formats)</a:documentation> </attribute> </define> <define name="k.machine.min_memory.attribute"> <attribute name="min_memory"> - <a:documentation>The virtual machine min memory in MB (ovf only)</a:documentation> + <a:documentation>The virtual machine min memory in MB (ova only)</a:documentation> <data type="nonNegativeInteger"/> </attribute> </define> <define name="k.machine.max_memory.attribute"> <attribute name="max_memory"> - <a:documentation>The virtual machine max memory in MB (ovf only)</a:documentation> + <a:documentation>The virtual machine max memory in MB (ova only)</a:documentation> <data type="nonNegativeInteger"/> </attribute> </define> <define name="k.machine.min_cpu.attribute"> <attribute name="min_cpu"> - <a:documentation>The virtual machine min CPU count (ovf only)</a:documentation> + <a:documentation>The virtual machine min CPU count (ova only)</a:documentation> <data type="nonNegativeInteger"/> </attribute> </define> <define name="k.machine.max_cpu.attribute"> <attribute name="max_cpu"> - <a:documentation>The virtual machine max CPU count (ovf only)</a:documentation> + <a:documentation>The virtual machine max CPU count (ova only)</a:documentation> <data type="nonNegativeInteger"/> </attribute> </define> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/storage/subformat/__init__.py new/kiwi-9.12.9/kiwi/storage/subformat/__init__.py --- old/kiwi-9.12.8/kiwi/storage/subformat/__init__.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/kiwi/storage/subformat/__init__.py 2018-02-07 14:44:41.000000000 +0100 @@ -21,6 +21,7 @@ from kiwi.storage.subformat.vhdx import DiskFormatVhdx from kiwi.storage.subformat.vhdfixed import DiskFormatVhdFixed from kiwi.storage.subformat.vmdk import DiskFormatVmdk +from kiwi.storage.subformat.ova import DiskFormatOva from kiwi.storage.subformat.gce import DiskFormatGce from kiwi.storage.subformat.vdi import DiskFormatVdi from kiwi.storage.subformat.base import DiskFormatBase @@ -49,7 +50,7 @@ * :attr:`target_dir` target directory path name """ - def __new__(self, name, xml_state, root_dir, target_dir): + def __new__(self, name, xml_state, root_dir, target_dir): # noqa: C901 custom_args = xml_state.get_build_type_format_options() if name == 'qcow2': return DiskFormatQcow2( @@ -85,7 +86,7 @@ return DiskFormatGce( xml_state, root_dir, target_dir, custom_args ) - elif name == 'vmdk': + elif name == 'vmdk' or name == 'ova': vmdisk_section = xml_state.get_build_type_vmdisk_section() if vmdisk_section: disk_mode = vmdisk_section.get_diskmode() @@ -98,9 +99,14 @@ custom_args.update( {'adapter_type={0}'.format(disk_controller): None} ) - return DiskFormatVmdk( - xml_state, root_dir, target_dir, custom_args - ) + if name == 'vmdk': + return DiskFormatVmdk( + xml_state, root_dir, target_dir, custom_args + ) + else: + return DiskFormatOva( + xml_state, root_dir, target_dir, custom_args + ) elif name == 'vagrant': vagrant_config = xml_state.get_build_type_vagrant_config_section() if vagrant_config: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/storage/subformat/ova.py new/kiwi-9.12.9/kiwi/storage/subformat/ova.py --- old/kiwi-9.12.8/kiwi/storage/subformat/ova.py 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/storage/subformat/ova.py 2018-02-07 14:10:14.000000000 +0100 @@ -0,0 +1,93 @@ +# Copyright (c) 2018 Eaton. All rights reserved. +# +# This file is part of kiwi. +# +# kiwi is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# kiwi is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with kiwi. If not, see <http://www.gnu.org/licenses/> +# +import os +import stat + +# project +from kiwi.storage.subformat.vmdk import DiskFormatVmdk +from kiwi.command import Command +from kiwi.logger import log +from kiwi.utils.command_capabilities import CommandCapabilities + +from kiwi.exceptions import ( + KiwiFormatSetupError, + KiwiCommandNotFound +) + + +class DiskFormatOva(DiskFormatVmdk): + """ + Create ova disk format, based on vmdk + """ + def post_init(self, custom_args): + """ + vmdk disk format post initialization method + + Store qemu options as list from custom args dict + + Attributes + + * :attr:`options` + qemu format conversion options + + * :attr:`image_format` + disk format name: ova + """ + ovftype = self.xml_state.get_build_type_machine_section().get_ovftype() + if ovftype != 'vmware': + raise KiwiFormatSetupError('Unsupported ovftype %s' % ovftype) + self.image_format = 'ova' + self.options = self.get_qemu_option_list(custom_args) + + def create_image_format(self): + # Creates the vmdk disk image and vmx config + super(DiskFormatOva, self).create_image_format() + # Converts to ova using ovftool + vmx = self.get_target_file_path_for_format('vmx') + ova = self.get_target_file_path_for_format('ova') + try: + os.unlink(ova) + except OSError: + pass + ovftool_cmd = ['ovftool'] + if CommandCapabilities.has_option_in_help( + 'ovftool', '--shaAlgorithm', raise_on_error=False): + ovftool_cmd.append('--shaAlgorithm=SHA1') + ovftool_cmd.extend([vmx, ova]) + try: + Command.run(ovftool_cmd) + except KiwiCommandNotFound as e: + log.info('Building OVA images requires VMware\'s ovftool, get it from https://www.vmware.com/support/developer/ovf/') + raise e + # ovftool ignores the umask and creates files with 0600 for some reason + st = os.stat(vmx) + os.chmod(ova, stat.S_IMODE(st.st_mode)) + + def store_to_result(self, result): + """ + Store the resulting ova file into the provided result instance. + + :param object result: Instance of Result + """ + result.add( + key='disk_format_image', + filename=self.get_target_file_path_for_format('ova'), + use_for_bundle=True, + compress=False, + shasum=True + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/storage/subformat/vmdk.py new/kiwi-9.12.9/kiwi/storage/subformat/vmdk.py --- old/kiwi-9.12.8/kiwi/storage/subformat/vmdk.py 2018-02-05 16:58:49.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/storage/subformat/vmdk.py 2018-02-07 14:10:14.000000000 +0100 @@ -57,9 +57,9 @@ Command.run( [ 'qemu-img', 'convert', '-f', 'raw', self.diskname, - '-O', self.image_format + '-O', 'vmdk' ] + self.options + [ - self.get_target_file_path_for_format(self.image_format) + self.get_target_file_path_for_format('vmdk') ] ) self._create_vmware_settings_file() @@ -74,9 +74,7 @@ """ result.add( key='disk_format_image', - filename=self.get_target_file_path_for_format( - self.image_format - ), + filename=self.get_target_file_path_for_format('vmdk'), use_for_bundle=True, compress=False, shasum=True @@ -91,7 +89,7 @@ shasum=False ) - def _create_vmware_settings_file(self): + def _create_vmware_settings_file(self): # noqa: C901 """ In order to run a vmdk image in VMware products a settings file is needed or the possibility to convert machine settings into an ovf @@ -102,7 +100,7 @@ self.xml_state.xml_data.get_displayname() or self.xml_state.xml_data.get_name(), 'vmdk_file': - self.get_target_file_path_for_format(self.image_format), + self.get_target_file_path_for_format('vmdk'), 'virtual_hardware_version': '9', 'guest_os': 'suse-64', 'disk_id': '0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/tasks/system_build.py new/kiwi-9.12.9/kiwi/tasks/system_build.py --- old/kiwi-9.12.8/kiwi/tasks/system_build.py 2018-01-25 09:53:37.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/tasks/system_build.py 2018-02-07 14:10:14.000000000 +0100 @@ -103,7 +103,7 @@ * :attr:`manual` Instance of Help """ - def process(self): + def process(self): # noqa: C901 """ Build a system image from the specified description. The build command combines the prepare and create commands diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/tasks/system_prepare.py new/kiwi-9.12.9/kiwi/tasks/system_prepare.py --- old/kiwi-9.12.8/kiwi/tasks/system_prepare.py 2018-01-25 09:53:37.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/tasks/system_prepare.py 2018-02-07 14:10:14.000000000 +0100 @@ -99,7 +99,7 @@ * :attr:`manual` Instance of Help """ - def process(self): + def process(self): # noqa: C901 """ Prepare and install a new system for chroot access """ @@ -116,6 +116,7 @@ abs_root_path = os.path.abspath(self.command_args['--root']) self.runtime_checker.check_efi_mode_for_disk_overlay_correctly_setup() + self.runtime_checker.check_grub_efi_installed_for_efi_firmware() self.runtime_checker.check_consistent_kernel_in_boot_and_system_image() self.runtime_checker.check_docker_tool_chain_installed() self.runtime_checker.check_volume_setup_has_no_root_definition() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/version.py new/kiwi-9.12.9/kiwi/version.py --- old/kiwi-9.12.8/kiwi/version.py 2018-02-05 17:02:19.000000000 +0100 +++ new/kiwi-9.12.9/kiwi/version.py 2018-02-12 16:48:17.000000000 +0100 @@ -18,5 +18,5 @@ """ Global version information used in kiwi and the package """ -__version__ = '9.12.8' -__githash__ = 'aa27a37a6430bdc3d9d1267dde1ede59065dc2f5' +__version__ = '9.12.9' +__githash__ = 'acfa69617c4e169ded7c0d1036e80261e044a86b' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi/xml_description.py new/kiwi-9.12.9/kiwi/xml_description.py --- old/kiwi-9.12.8/kiwi/xml_description.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/kiwi/xml_description.py 2018-02-07 14:10:14.000000000 +0100 @@ -80,7 +80,7 @@ self.xml_content = xml_content self.extension_data = {} - def load(self): + def load(self): # noqa: C901 """ Read XML description, pass it along to the XSLT processor, validate it against the schema and finally pass it to the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi.egg-info/PKG-INFO new/kiwi-9.12.9/kiwi.egg-info/PKG-INFO --- old/kiwi-9.12.8/kiwi.egg-info/PKG-INFO 2018-02-05 17:07:17.000000000 +0100 +++ new/kiwi-9.12.9/kiwi.egg-info/PKG-INFO 2018-02-12 16:53:23.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: kiwi -Version: 9.12.8 +Version: 9.12.9 Summary: KIWI - Appliance Builder (next generation) Home-page: http://suse.github.io/kiwi Author: Marcus Schaefer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/kiwi.egg-info/SOURCES.txt new/kiwi-9.12.9/kiwi.egg-info/SOURCES.txt --- old/kiwi-9.12.8/kiwi.egg-info/SOURCES.txt 2018-02-05 17:07:18.000000000 +0100 +++ new/kiwi-9.12.9/kiwi.egg-info/SOURCES.txt 2018-02-12 16:53:23.000000000 +0100 @@ -376,6 +376,7 @@ kiwi/storage/subformat/__init__.py kiwi/storage/subformat/base.py kiwi/storage/subformat/gce.py +kiwi/storage/subformat/ova.py kiwi/storage/subformat/qcow2.py kiwi/storage/subformat/vagrant_libvirt.py kiwi/storage/subformat/vdi.py @@ -595,6 +596,7 @@ test/unit/storage_setup_test.py test/unit/storage_subformat_base_test.py test/unit/storage_subformat_gce_test.py +test/unit/storage_subformat_ova_test.py test/unit/storage_subformat_qcow2_test.py test/unit/storage_subformat_template_vmware_settings_test.py test/unit/storage_subformat_test.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/package/python-kiwi-spec-template new/kiwi-9.12.9/package/python-kiwi-spec-template --- old/kiwi-9.12.8/package/python-kiwi-spec-template 2018-01-24 12:05:24.000000000 +0100 +++ new/kiwi-9.12.9/package/python-kiwi-spec-template 2018-02-12 15:56:49.000000000 +0100 @@ -16,7 +16,15 @@ # # https://github.com/SUSE/kiwi/issues # -%{!?python2_sitelib:%global python2_sitelib %{python_sitelib}} + +# If they aren't provided by a system installed macro, define them +%{!?_defaultdocdir: %global _defaultdocdir %{_datadir}/doc} +%{!?__python2: %global __python2 /usr/bin/python2} + +# Expanded form required for debbuild's simpler engine +%if %{undefined python2_sitelib} +%global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%endif # translate version id to distribution name as it is used in kiwi # generic approach @@ -92,6 +100,29 @@ %define distro fedora-25.0 %endif +# Ubuntu +# Use xenial templates for 16.04 and newer +%if 0%{?ubuntu} >= 1604 +%define distro ubuntu-xenial +%endif + +# Debian +# Use the stretch templates for 9 and newer +%if 0%{?debian} >= 9 +%define distro debian-stretch +%endif + +%if 0%{?debian} || 0%{?ubuntu} +%global is_deb 1 +%global pygroup python +%global sysgroup admin +%global develsuffix dev +%else +%global pygroup Development/Languages/Python +%global sysgroup System/Management +%global develsuffix devel +%endif + Name: python-kiwi Version: %%VERSION Provides: kiwi-schema = 6.6 @@ -99,7 +130,11 @@ Url: https://github.com/SUSE/kiwi Summary: KIWI - Appliance Builder Next Generation License: GPL-3.0+ -Group: Development/Languages/Python +%if %{_vendor} == "debbuild" +# Needed to set Maintainer in output debs +Packager: Marcus Schäfer <[email protected]> +%endif +Group: %{pygroup} Source: %{name}.tar.gz Source1: %{name}-boot-packages Source2: %{name}-rpmlintrc @@ -109,12 +144,15 @@ BuildRequires: python3-setuptools BuildRequires: fdupes %endif -BuildRequires: python-devel +BuildRequires: python-%{develsuffix} BuildRequires: python-setuptools %if 0%{?suse_version} BuildRequires: shadow BuildRequires: update-alternatives %endif +%if 0%{?debian} || 0%{?ubuntu} +BuildRequires: passwd +%endif %if 0%{?fedora} || 0%{?rhel} BuildRequires: chkconfig %endif @@ -127,12 +165,16 @@ # python2-kiwi %package -n python2-kiwi Summary: KIWI - Appliance Builder Next Generation -Group: Development/Languages/Python +Group: %{pygroup} Provides: python-kiwi = %{version}-%{release} %if 0%{?fedora} || 0%{?suse_version} Recommends: jing %endif +%if 0%{?debian} || 0%{?ubuntu} +Requires: python-yaml +%else Requires: python-PyYAML +%endif Requires: python-docopt Requires: python-future Requires: python-lxml @@ -172,6 +214,13 @@ Requires: zypper Provides: kiwi-packagemanager:zypper %endif +%if 0%{?debian} || 0%{?ubuntu} +Requires: debootstrap +Requires: qemu-utils +Requires: squashfs-tools +Requires: multipath-tools +Requires: gdisk +%endif Requires: dosfstools Requires: e2fsprogs Requires: genisoimage @@ -183,12 +232,15 @@ Requires: parted Requires: rsync Requires: tar >= 1.2.7 +%if %{_vendor} != "debbuild" +# Not supported with debbuild yet %ifarch %arm aarch64 Requires: u-boot-tools %endif %ifarch s390 s390x Requires: s390-tools %endif +%endif %description -n python2-kiwi Python 2 library of the KIWI Image System. Provides an operating system @@ -271,7 +323,7 @@ %package -n kiwi-tools Summary: KIWI - Collection of Boot Helper Tools License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n kiwi-tools This package contains a small set of helper tools used for the @@ -279,6 +331,7 @@ first boot of an appliance. The tools are not meant to be used outside of the scope of kiwi appliance building. +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %package -n kiwi-pxeboot Summary: KIWI - PXE boot structure @@ -289,19 +342,25 @@ Requires(pre): shadow %endif License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n kiwi-pxeboot This package contains the basic PXE directory structure which is needed to serve kiwi built images via PXE. %endif +%endif %package -n dracut-kiwi-lib Summary: KIWI - Dracut kiwi Library +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: bc Requires: cryptsetup -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: btrfs-progs Requires: gdisk %else @@ -319,13 +378,18 @@ Requires: dialog Requires: pv Requires: curl +%if 0%{?debian} || 0%{?ubuntu} +Requires: xz-utils +Requires: dmsetup +%else Requires: xz Requires: device-mapper +%endif %ifarch s390 s390x Requires: s390-tools %endif License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n dracut-kiwi-lib This package contains a collection of methods to provide a library @@ -333,10 +397,15 @@ %package -n dracut-kiwi-oem-repart Summary: KIWI - Dracut module for oem(repart) image type +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dracut-kiwi-lib License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n dracut-kiwi-oem-repart This package contains the kiwi-repart dracut module which is @@ -345,11 +414,16 @@ %package -n dracut-kiwi-oem-dump Summary: KIWI - Dracut module for oem(install) image type +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dracut-kiwi-lib Requires: kexec-tools Requires: dmraid -%if 0%{?suse_version} +%if 0%{?suse_version} || 0%{?debian} || 0%{?ubuntu} Requires: multipath-tools %endif %if 0%{?fedora} || 0%{?rhel} @@ -357,7 +431,7 @@ %endif Requires: gawk License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n dracut-kiwi-oem-dump This package contains the kiwi-dump dracut module which is @@ -369,20 +443,29 @@ %package -n dracut-kiwi-live Summary: KIWI - Dracut module for iso(live) image type +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: dialog Requires: xfsprogs Requires: e2fsprogs Requires: util-linux +%if 0%{?debian} || 0%{?ubuntu} +Requires: dmsetup +%else Requires: device-mapper +%endif Requires: dracut -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: genisoimage %else Requires: cdrkit-cdrtools-compat %endif License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n dracut-kiwi-live This package contains the kiwi-live dracut module which is used @@ -390,11 +473,16 @@ %package -n dracut-kiwi-overlay Summary: KIWI - Dracut module for vmx(+overlay) image type +%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} || 0%{?debian} +# Ubuntu 16.04 OBS environments refuse to set up due to +# initramfs-tools / dracut conflict and initramfs-tools is required +# to set up the build environment... BuildRequires: dracut +%endif Requires: util-linux Requires: dracut License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n dracut-kiwi-overlay This package contains the kiwi-overlay dracut module which is used @@ -421,7 +509,7 @@ Requires: xfsprogs Requires: umoci Requires: skopeo -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} || 0%{?rhel} || 0%{?debian} || 0%{?ubuntu} Requires: btrfs-progs %else Requires: btrfsprogs @@ -433,7 +521,7 @@ %endif Requires: %(echo `cat %{S:1}|grep %{_target_cpu}:%{distro}:|cut -f3- -d:`) License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n kiwi-boot-requires Meta package for the buildservice to pull in all required packages in @@ -446,7 +534,7 @@ %package -n kiwi-man-pages Summary: KIWI - manual pages License: GPL-3.0+ -Group: System/Management +Group: %{sysgroup} %description -n kiwi-man-pages Provides manual pages to describe the kiwi commands @@ -465,13 +553,14 @@ %install # Install Python 2 version -python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} +python2 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} %if 0%{?fedora} || 0%{?suse_version} # Install Python 3 version -python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} +python3 setup.py install --prefix=%{_prefix} --root=%{buildroot} %{?is_deb:--install-layout=deb} %endif +%if %{_vendor} != "debbuild" # init alternatives setup mkdir -p %{buildroot}%{_sysconfdir}/alternatives @@ -496,6 +585,7 @@ mkdir -p %{buildroot}/srv/tftpboot/$i ;\ done %endif +%endif %if 0%{?fedora} || 0%{?rhel} install -m 755 -d %{buildroot}/%{_defaultdocdir}/python-kiwi @@ -545,6 +635,7 @@ --remove kiwicompat %_bindir/kiwicompat %endif +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %pre -n kiwi-pxeboot #============================================================ @@ -557,6 +648,7 @@ -r -s /bin/false tftp fi %endif +%endif %files -n python2-kiwi %defattr(-,root,root,-) @@ -595,11 +687,10 @@ %files -n kiwi-tools %defattr(-, root, root) -%exclude %{_bindir}/kiwi -%exclude %{_bindir}/kiwicompat -%exclude %{_bindir}/kiwi-ng* -%exclude %{_bindir}/kiwicompat-* -%{_bindir}/* +%{_bindir}/dcounter +%{_bindir}/isconsole +%{_bindir}/kversion +%{_bindir}/utimer %files -n dracut-kiwi-lib %defattr(-, root, root) @@ -621,6 +712,7 @@ %defattr(-, root, root) %{_usr}/lib/dracut/modules.d/90kiwi-overlay +%if %{_vendor} != "debbuild" %ifarch %ix86 x86_64 %files -n kiwi-pxeboot %defattr(-, root, root) @@ -631,6 +723,7 @@ %dir /srv/tftpboot/upload %dir /srv/tftpboot/boot %endif +%endif %if 0%{?suse_version} %files -n kiwi-boot-requires diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/setup.cfg new/kiwi-9.12.9/setup.cfg --- old/kiwi-9.12.8/setup.cfg 2018-02-05 17:07:18.000000000 +0100 +++ new/kiwi-9.12.9/setup.cfg 2018-02-12 16:53:24.000000000 +0100 @@ -10,7 +10,7 @@ [flake8] exclude = xml_parse.py ignore = E501 -max-complexity = 17 +max-complexity = 12 [doc8] max-line-length = 90 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/test/unit/path_test.py new/kiwi-9.12.9/test/unit/path_test.py --- old/kiwi-9.12.8/test/unit/path_test.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/test/unit/path_test.py 2018-02-12 16:41:10.000000000 +0100 @@ -1,4 +1,4 @@ -from mock import patch +from mock import patch, call import os @@ -34,10 +34,15 @@ ) @patch('kiwi.command.Command.run') - def test_remove_hierarchy(self, mock_command): - Path.remove_hierarchy('foo') - mock_command.assert_called_once_with( - ['rmdir', '-p', '--ignore-fail-on-non-empty', 'foo'] + @patch('kiwi.logger.log.warning') + def test_remove_hierarchy(self, mock_log_warn, mock_command): + Path.remove_hierarchy('/my_root/tmp/foo/bar') + assert mock_command.call_args_list == [ + call(['rmdir', '--ignore-fail-on-non-empty', '/my_root/tmp/foo/bar']), + call(['rmdir', '--ignore-fail-on-non-empty', '/my_root/tmp/foo']) + ] + mock_log_warn.assert_called_once_with( + 'remove_hierarchy: path /my_root/tmp is protected' ) @patch('os.access') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/test/unit/runtime_checker_test.py new/kiwi-9.12.9/test/unit/runtime_checker_test.py --- old/kiwi-9.12.8/test/unit/runtime_checker_test.py 2018-01-22 19:28:52.000000000 +0100 +++ new/kiwi-9.12.9/test/unit/runtime_checker_test.py 2018-02-07 14:10:14.000000000 +0100 @@ -108,6 +108,118 @@ runtime_checker.check_consistent_kernel_in_boot_and_system_image() @raises(KiwiRuntimeError) + def test_check_grub_efi_installed_for_efi_firmware_is_efi(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='efi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['foo'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + runtime_checker.check_grub_efi_installed_for_efi_firmware() + + def test_check_grub_efi_installed_for_efi_firmware_is_efi_debian(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='efi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub-efi-amd64'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + def test_check_grub_efi_installed_for_efi_firmware_is_efi_rhel(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='efi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub2-efi-x64'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + def test_check_grub_efi_installed_for_efi_firmware_is_efi_suse(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='efi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub2-x86_64-efi'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + @raises(KiwiRuntimeError) + def test_check_grub_efi_installed_for_efi_firmware_is_uefi(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='uefi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['foo'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + runtime_checker.check_grub_efi_installed_for_efi_firmware() + + def test_check_grub_efi_installed_for_efi_firmware_is_uefi_debian(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='uefi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub-efi-amd64'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + def test_check_grub_efi_installed_for_efi_firmware_is_uefi_rhel(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='uefi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub2-efi-x64'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + def test_check_grub_efi_installed_for_efi_firmware_is_uefi_suse(self): + self.xml_state.build_type.get_firmware = mock.Mock( + return_value='uefi' + ) + self.xml_state.get_bootstrap_packages = mock.Mock( + return_value=['grub2-x86_64-efi'] + ) + self.xml_state.get_system_packages = mock.Mock( + return_value=['bar'] + ) + runtime_checker = RuntimeChecker(self.xml_state) + assert runtime_checker.check_grub_efi_installed_for_efi_firmware() \ + is True + + @raises(KiwiRuntimeError) def test_check_xen_uniquely_setup_as_server_or_guest_for_ec2(self): self.xml_state.build_type.get_firmware = mock.Mock( return_value='ec2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/test/unit/storage_subformat_ova_test.py new/kiwi-9.12.9/test/unit/storage_subformat_ova_test.py --- old/kiwi-9.12.8/test/unit/storage_subformat_ova_test.py 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi-9.12.9/test/unit/storage_subformat_ova_test.py 2018-02-07 14:10:14.000000000 +0100 @@ -0,0 +1,138 @@ +from mock import patch +from mock import call +import mock + +from .test_helper import raises, patch_open + +from kiwi.exceptions import ( + KiwiCommandNotFound, + KiwiFormatSetupError +) + +from kiwi.storage.subformat.ova import DiskFormatOva + + +class TestDiskFormatOva(object): + @patch('platform.machine') + def setup(self, mock_machine): + self.context_manager_mock = mock.Mock() + self.file_mock = mock.Mock() + self.enter_mock = mock.Mock() + self.exit_mock = mock.Mock() + self.enter_mock.return_value = self.file_mock + setattr(self.context_manager_mock, '__enter__', self.enter_mock) + setattr(self.context_manager_mock, '__exit__', self.exit_mock) + mock_machine.return_value = 'x86_64' + xml_data = mock.Mock() + xml_data.get_name = mock.Mock( + return_value='some-disk-image' + ) + xml_data.get_displayname = mock.Mock( + return_value=None + ) + self.xml_state = mock.Mock() + self.xml_state.xml_data = xml_data + self.xml_state.get_image_version = mock.Mock( + return_value='1.2.3' + ) + + self.machine_setup = mock.Mock() + self.xml_state.get_build_type_machine_section = mock.Mock( + return_value=self.machine_setup + ) + self.machine_setup.get_HWversion = mock.Mock( + return_value='42' + ) + self.machine_setup.get_guestOS = mock.Mock( + return_value='suse' + ) + self.machine_setup.get_memory = mock.Mock( + return_value='4096' + ) + self.machine_setup.get_ncpus = mock.Mock( + return_value='2' + ) + + self.machine_setup.get_ovftype = mock.Mock( + return_value='vmware' + ) + + self.disk_format = DiskFormatOva( + self.xml_state, 'root_dir', 'target_dir' + ) + + def test_post_init(self): + self.disk_format.post_init({}) + + @raises(KiwiFormatSetupError) + def test_post_init_bad_ovftype(self): + self.machine_setup.get_ovftype.return_value = 'foobar' + self.disk_format.post_init({}) + + def test_store_to_result(self): + result = mock.Mock() + self.disk_format.store_to_result(result) + assert result.add.call_args_list == [ + call( + compress=False, + filename='target_dir/some-disk-image.x86_64-1.2.3.ova', + key='disk_format_image', + shasum=True, + use_for_bundle=True + ) + ] + + @patch('kiwi.storage.subformat.ova.Command.run') + @patch('os.stat') + @patch('os.chmod') + @patch_open + def test_create_image_format( + self, mock_open, mock_chmod, mock_stat, mock_command + ): + qemu_img_result = mock.Mock() + ovftool_help_result = mock.Mock() + ovftool_help_result.output = """This is a new ovftool + it knows options such as --shaAlgorithm and others + enjoy""" + ovftool_result = mock.Mock() + + command_results = [ + ovftool_result, ovftool_help_result, qemu_img_result + ] + + def side_effect(arg): + return command_results.pop() + + mock_command.side_effect = side_effect + mock_open.return_value = self.context_manager_mock + mock_stat.return_value = mock.Mock(st_mode=0o644) + self.disk_format.create_image_format() + assert mock_command.call_args_list[-1] == call([ + 'ovftool', + '--shaAlgorithm=SHA1', + 'target_dir/some-disk-image.x86_64-1.2.3.vmx', + 'target_dir/some-disk-image.x86_64-1.2.3.ova' + ]) + + @patch('kiwi.storage.subformat.ova.Command.run') + @patch_open + @raises(KiwiCommandNotFound) + def test_create_image_format_no_ovftool( + self, mock_open, mock_command + ): + qemu_img_result = mock.Mock() + ovftool_help_result = mock.Mock() + ovftool_help_result.output = "" + + command_results = [ + ovftool_help_result, qemu_img_result + ] + + def side_effect(arg): + if len(command_results) == 0: + raise KiwiCommandNotFound('ovftool not found') + return command_results.pop() + + mock_command.side_effect = side_effect + mock_open.return_value = self.context_manager_mock + self.disk_format.create_image_format() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.12.8/test/unit/storage_subformat_test.py new/kiwi-9.12.9/test/unit/storage_subformat_test.py --- old/kiwi-9.12.8/test/unit/storage_subformat_test.py 2017-09-15 10:37:16.000000000 +0200 +++ new/kiwi-9.12.9/test/unit/storage_subformat_test.py 2018-02-07 14:10:14.000000000 +0100 @@ -94,6 +94,24 @@ {'adapter_type=controller': None, 'subformat=disk-mode': None} ) + @patch('kiwi.storage.subformat.DiskFormatOva') + def test_disk_format_ova(self, mock_ova): + vmdisk = mock.Mock() + vmdisk.get_controller = mock.Mock( + return_value='controller' + ) + vmdisk.get_diskmode = mock.Mock( + return_value='disk-mode' + ) + self.xml_state.get_build_type_vmdisk_section = mock.Mock( + return_value=vmdisk + ) + DiskFormat('ova', self.xml_state, 'root_dir', 'target_dir') + mock_ova.assert_called_once_with( + self.xml_state, 'root_dir', 'target_dir', + {'adapter_type=controller': None, 'subformat=disk-mode': None} + ) + @patch('kiwi.storage.subformat.DiskFormatVagrantLibVirt') def test_disk_format_vagrant_libvirt(self, mock_vagrant): vagrant_config = mock.Mock()
