Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-kiwi for openSUSE:Factory checked in at 2022-05-24 20:31:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kiwi (Old) and /work/SRC/openSUSE:Factory/.python-kiwi.new.2254 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kiwi" Tue May 24 20:31:08 2022 rev:97 rq:978738 version:9.24.36 Changes: -------- --- /work/SRC/openSUSE:Factory/python-kiwi/python-kiwi.changes 2022-05-17 17:23:35.403124975 +0200 +++ /work/SRC/openSUSE:Factory/.python-kiwi.new.2254/python-kiwi.changes 2022-05-24 20:31:24.366921505 +0200 @@ -1,0 +2,33 @@ +Thu May 19 15:21:54 CEST 2022 - Marcus Sch??fer <marcus.schae...@gmail.com> + +- Bump version: 9.24.35 ??? 9.24.36 + +------------------------------------------------------------------- +Tue May 17 08:54:46 CEST 2022 - Robert Schweikert <rjsch...@suse.com> + +- Subformats should also not be compressed when encryption is enabled (#2138) + + Subformats should also not be compressed when encryption is enabled + This is a follow on change to bdba953. When the filesystem is encrypted the + resulting image should not be compressed. Also explain why we ignore the + compression seeting in the user configuration for encrypted images. + +------------------------------------------------------------------- +Mon May 16 10:09:01 CEST 2022 - Marcus Sch??fer <marcus.schae...@gmail.com> + +- Add support for prebuilt bootstrap package for apt + + When using the apt packagemanager kiwi required the use of + debootstrap to create the initial rootfs. This works as long + as there is always a main distribution repository available + which follows the structure of the official debian mirrors. + However if such a main distribution is not present or an + alternative layout like e.g OBS repos is used, debootstrap + will refuse to work. To allow for an alternative and without + the dependency to debootstrap kiwi supports using a prebuilt + bootstrap package providing the mini rootfs to serve as + the bootstrap result. As all other package managers properly + supports installation into an empty new root, this feature + was only added when using the apt packagemanager + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kiwi.spec ++++++ --- /var/tmp/diff_new_pack.2C0sPX/_old 2022-05-24 20:31:25.258922301 +0200 +++ /var/tmp/diff_new_pack.2C0sPX/_new 2022-05-24 20:31:25.266922308 +0200 @@ -43,7 +43,7 @@ %endif Name: python-kiwi -Version: 9.24.35 +Version: 9.24.36 Provides: kiwi-schema = 7.5 Release: 0 Url: https://github.com/OSInside/kiwi ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.2C0sPX/_old 2022-05-24 20:31:25.310922348 +0200 +++ /var/tmp/diff_new_pack.2C0sPX/_new 2022-05-24 20:31:25.314922351 +0200 @@ -3,7 +3,7 @@ pkgname=('python-kiwi' 'kiwi-man-pages' 'dracut-kiwi-lib' 'dracut-kiwi-oem-repart' 'dracut-kiwi-oem-dump' 'dracut-kiwi-live' 'dracut-kiwi-overlay') arch=(x86_64) -pkgver=9.24.35 +pkgver=9.24.36 pkgrel=0 pkgdesc="KIWI - Appliance Builder Next Generation" url="https://github.com/SUSE/kiwi/tarball/master" @@ -12,7 +12,7 @@ provides=(kiwi-ng kiwi) source=("${pkgname}.tar.gz") changelog="${pkgname}.changes" -md5sums=('75d8288fb9691bfd609b2de3661b848a') +md5sums=('7eefd0af367564845b071d5664003f83') build() { ++++++ python-kiwi.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/.bumpversion.cfg new/kiwi-9.24.36/.bumpversion.cfg --- old/kiwi-9.24.35/.bumpversion.cfg 2022-05-08 20:51:36.000000000 +0200 +++ new/kiwi-9.24.36/.bumpversion.cfg 2022-05-19 15:21:54.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 9.24.35 +current_version = 9.24.36 commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/PKG-INFO new/kiwi-9.24.36/PKG-INFO --- old/kiwi-9.24.35/PKG-INFO 2022-05-08 20:53:43.000000000 +0200 +++ new/kiwi-9.24.36/PKG-INFO 2022-05-19 15:25:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: kiwi -Version: 9.24.35 +Version: 9.24.36 Summary: KIWI - Appliance Builder (next generation) Home-page: https://osinside.github.io/kiwi Author: Marcus Schaefer Binary files old/kiwi-9.24.35/doc/build/latex/kiwi.pdf and new/kiwi-9.24.36/doc/build/latex/kiwi.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi.8 new/kiwi-9.24.36/doc/build/man/kiwi.8 --- old/kiwi-9.24.35/doc/build/man/kiwi.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi \- Creating Operating System Images .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::image::info.8 new/kiwi-9.24.36/doc/build/man/kiwi::image::info.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::image::info.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::image::info.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::IMAGE::INFO" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::IMAGE::INFO" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::image::info \- Provide detailed information about an image description .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::image::resize.8 new/kiwi-9.24.36/doc/build/man/kiwi::image::resize.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::image::resize.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::image::resize.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::IMAGE::RESIZE" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::IMAGE::RESIZE" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::image::resize \- Resize disk images to new geometry .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::result::bundle.8 new/kiwi-9.24.36/doc/build/man/kiwi::result::bundle.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::result::bundle.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::result::bundle.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::RESULT::BUNDLE" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::RESULT::BUNDLE" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::result::bundle \- Bundle build results .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::result::list.8 new/kiwi-9.24.36/doc/build/man/kiwi::result::list.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::result::list.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::result::list.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::RESULT::LIST" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::RESULT::LIST" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::result::list \- List build results .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::system::build.8 new/kiwi-9.24.36/doc/build/man/kiwi::system::build.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::system::build.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::system::build.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::SYSTEM::BUILD" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::SYSTEM::BUILD" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::system::build \- Build image in combined prepare and create step .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::system::create.8 new/kiwi-9.24.36/doc/build/man/kiwi::system::create.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::system::create.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::system::create.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::SYSTEM::CREATE" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::SYSTEM::CREATE" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::system::create \- Create image from prepared root system .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::system::prepare.8 new/kiwi-9.24.36/doc/build/man/kiwi::system::prepare.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::system::prepare.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::system::prepare.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::SYSTEM::PREPARE" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::SYSTEM::PREPARE" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::system::prepare \- Prepare image root system .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/build/man/kiwi::system::update.8 new/kiwi-9.24.36/doc/build/man/kiwi::system::update.8 --- old/kiwi-9.24.35/doc/build/man/kiwi::system::update.8 2022-05-08 20:53:42.000000000 +0200 +++ new/kiwi-9.24.36/doc/build/man/kiwi::system::update.8 2022-05-19 15:25:16.000000000 +0200 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI::SYSTEM::UPDATE" "8" "May 08, 2022" "9.24.35" "KIWI NG" +.TH "KIWI::SYSTEM::UPDATE" "8" "May 19, 2022" "9.24.36" "KIWI NG" .SH NAME kiwi::system::update \- Update/Upgrade image root system .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/source/conf.py new/kiwi-9.24.36/doc/source/conf.py --- old/kiwi-9.24.35/doc/source/conf.py 2022-05-08 20:51:36.000000000 +0200 +++ new/kiwi-9.24.36/doc/source/conf.py 2022-05-19 15:21:54.000000000 +0200 @@ -139,7 +139,7 @@ # built documents. # # The short X.Y version. -version = '9.24.35' +version = '9.24.36' # The full version, including alpha/beta/rc tags. release = version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/source/image_description/elements.rst new/kiwi-9.24.36/doc/source/image_description/elements.rst --- old/kiwi-9.24.35/doc/source/image_description/elements.rst 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/doc/source/image_description/elements.rst 2022-05-19 15:21:13.000000000 +0200 @@ -420,6 +420,15 @@ effective if `btrfs_root_is_snapshot` is also set to true. By default the root filesystem snapshot is writable. +bootstrap_package="package_name": + For use with the `apt` packagemanager only. Specifies the name + of a bootstrap package which provides a bootstrap tarball + in :file:`/var/lib/bootstrap/PACKAGE_NAME.ARCH.tar.xz`. + The tarball will be unpacked and used as the bootstrap + rootfs to begin with. This allows for an alternative bootstrap + method preventing the use of `debootstrap`. For further details + see :ref:`debootstrap_alternative`. + compressed="true|false": Specifies whether the image output file should be compressed or not. This option is only used for filesystem only images or diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/source/working_with_images/build_without_debootstrap.rst new/kiwi-9.24.36/doc/source/working_with_images/build_without_debootstrap.rst --- old/kiwi-9.24.35/doc/source/working_with_images/build_without_debootstrap.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi-9.24.36/doc/source/working_with_images/build_without_debootstrap.rst 2022-05-19 15:21:13.000000000 +0200 @@ -0,0 +1,113 @@ +.. _debootstrap_alternative: + +Circumvent debootstrap +====================== + +.. sidebar:: Abstract + + This page provides information how to build Debian based + images with `apt` but without using `debootstrap` to bootstrap + the image root tree + +When building Debian based images {kiwi} uses two tools to +create the image root tree. First it calls `debootstrap` to +initialize a minimal root tree and next it chroot's into that +tree to complete the installation via `apt`. The reason why it +is done that way is because `apt` does not(yet) support to +install packages into an empty root directory like it is done +with all other packagemanager interfaces implemented in {kiwi}. + +The use of `debootstrap` comes along with some prerequisites +and limitations: + +* It can only use one repository to bootstrap from +* It can only use an official archive repo +* It has its own dependency resolver different from apt + +If one ore more of this properties turns into an issue, {kiwi} +allows for an alternative process which is based on a prebuilt +bootstrap-root archive provided as a package. + +To make use of a `bootstrap_package`, the name of that package +needs to be referenced in the {kiwi} description as follows: + +.. code:: xml + + <packages type="bootstrap" bootstrap_package="bootstrap-root"> + <package name="a"/> + <package name="b"/> + </packages> + +The boostrap process now changes in a way that the provided +bootstrap_package `bootstrap-root` will be installed on the build +host machine. Next {kiwi} searches for a tar archive file +:file:`/var/lib/bootstrap/bootstrap-root.ARCH.tar.xz`, +where `ARCH` is the name of the host architecture e.g `x86_64`. +If found the archive gets unpacked and serves as the bootstrap +root tree to begin with. The optionally provided additional +bootstrap packages, `a` and `b` in this example will be installed +like system packages via `chroot` and `apt`. Usually no additional +bootstrap packages are needed as they could all be handled as +system packages. + +How to Create a bootstrap_package +--------------------------------- + +Changing the setup in {kiwi} to use a `bootstrap_package` rather +then letting `debootstrap` do the job comes with the task to create +that package providing the bootstrap root tree. There are more than +one way to do this. The following procedure is just one example and +requires some background knowledge about the Open Build Service +`OBS <https://build.opensuse.org>`__ and its {kiwi} integration. + +1. Create an OBS project and repository setup that matches your image target +2. Create an image build package + + .. code:: bash + + osc mkpac bootstrap-root + +3. Create the following :file:`appliance.kiwi` file + + .. code:: xml + + <image schemaversion="7.4" name="bootstrap-root"> + <description type="system"> + <author>The Author</author> + <contact>aut...@example.com</contact> + <specification>prebuilt bootstrap rootfs for ...</specification> + </description> + + <preferences> + <version>1.0.1</version> + <packagemanager>apt</packagemanager> + <type image="tbz"/> + </preferences> + + <repository type="rpm-md"> + <source path="obsrepositories:/"/> + </repository> + + <packages type="image"> + <!-- packages included so OBS adds it as a build dependency, however this is installed by debootstrap --> + <package name="mawk"/> + </packages> + + <packages type="bootstrap"> + <!-- bootstrap done via debootstrap --> + </packages> + </image> + + .. code:: bash + + osc add appliance.kiwi + osc ci + +4. Package the image build results into a debian package + + In step 3. the bootstrap root tarball was created but not yet + packaged. A debian package is needed such that it can be + referenced with the `bootstrap_package` attribute and the repository + providing it. The simplest way to package the `bootstrap-root` tarball + is to create another package in OBS and use the tarball file as + its source. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/doc/source/working_with_images.rst new/kiwi-9.24.36/doc/source/working_with_images.rst --- old/kiwi-9.24.35/doc/source/working_with_images.rst 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/doc/source/working_with_images.rst 2022-05-19 15:21:13.000000000 +0200 @@ -35,3 +35,4 @@ working_with_images/build_with_profiles working_with_images/build_in_buildservice working_with_images/use_suse_media + working_with_images/build_without_debootstrap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/builder/filesystem.py new/kiwi-9.24.36/kiwi/builder/filesystem.py --- old/kiwi-9.24.35/kiwi/builder/filesystem.py 2021-10-24 21:11:03.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/builder/filesystem.py 2022-05-17 10:50:14.000000000 +0200 @@ -91,6 +91,7 @@ self.filesystems_no_device_node = [ 'squashfs' ] + self.luks = xml_state.get_luks_credentials() self.result = Result(xml_state) self.runtime_config = RuntimeConfig() @@ -128,13 +129,14 @@ ) if self.bundle_format: self.result.add_bundle_format(self.bundle_format) + compression = self.runtime_config.get_bundle_compression(default=True) + if self.luks is not None: + compression = False self.result.add( key='filesystem_image', filename=self.filename, use_for_bundle=True, - compress=self.runtime_config.get_bundle_compression( - default=True - ), + compress=compression, shasum=True ) self.result.add( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/apt.py new/kiwi-9.24.36/kiwi/package_manager/apt.py --- old/kiwi-9.24.35/kiwi/package_manager/apt.py 2022-03-08 20:23:49.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/apt.py 2022-05-19 15:21:13.000000000 +0200 @@ -31,9 +31,12 @@ from kiwi.system.root_bind import RootBind from kiwi.repository.apt import RepositoryApt +import kiwi.defaults as defaults + from kiwi.exceptions import ( KiwiDebootstrapError, - KiwiRequestError + KiwiRequestError, + KiwiFileNotFound ) log = logging.getLogger('kiwi') @@ -124,13 +127,90 @@ pass def process_install_requests_bootstrap( + self, root_bind: RootBind = None, bootstrap_package: str = None + ) -> command_call_type: + """ + Process package install requests for bootstrap phase (no chroot) + Either debootstrap or a prebuilt bootstrap package can be used + to bootstrap a new system. + + :param object root_bind: + instance of RootBind to manage kernel file systems before + debootstrap call + :param str bootstrap_package: + package name of a bootstrap package + + :return: process results as command instance + + :rtype: command_call_type + """ + if bootstrap_package: + return self._process_install_requests_bootstrap_prebuild_root( + bootstrap_package + ) + else: + return self._process_install_requests_bootstrap_debootstrap( + root_bind + ) + + def _process_install_requests_bootstrap_prebuild_root( + self, bootstrap_package: str + ) -> command_call_type: + """ + Process bootstrap phase (no chroot) using a prebuilt bootstrap + package. The package has to provide a tarball below the + directory /var/cache/kiwi/bootstrap/PACKAGE_NAME.ARCH.tar.xz + and will be unpacked to serve as the bootstrap root. + + The optionally listed packages in the kiwi bootstrap section + will be installed as part of a chroot install and returned + as command instance + + :param str bootstrap_package: + package name of the bootstrap package containing the + bootstrap root as a tarball + + :return: process results as command instance + + :rtype: command_call_type + """ + # Install prebuilt bootstrap package on build host + update_command = [ + 'apt-get' + ] + self.apt_get_args + self.custom_args + [ + 'update' + ] + install_command = [ + 'apt-get' + ] + self.apt_get_args + self.custom_args + [ + 'install', bootstrap_package + ] + Command.run( + update_command, self.command_env + ) + Command.run( + install_command, self.command_env + ) + # Unpack prebuilt bootstrap root tarball as new root + bootstrap_root_tarball = '/var/lib/bootstrap/{0}.{1}.tar.xz'.format( + bootstrap_package, defaults.PLATFORM_MACHINE + ) + if not os.path.isfile(bootstrap_root_tarball): + raise KiwiFileNotFound( + f'bootstrap tarball: {bootstrap_root_tarball!r} not found' + ) + Command.run( + ['tar', '-C', self.root_dir, '-xf', bootstrap_root_tarball] + ) + # Install eventual bootstrap packages as standard system install + return self.process_install_requests() + + def _process_install_requests_bootstrap_debootstrap( self, root_bind: RootBind = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) - The debootstrap program is used to bootstrap a new system with - a collection of predefined packages. The kiwi bootstrap section - information is not used in this case + The debootstrap program is used to bootstrap a new system :param object root_bind: instance of RootBind to manage kernel file systems before debootstrap call @@ -138,7 +218,9 @@ :raises KiwiDebootstrapError: if no main distribution repository is configured, if the debootstrap script is not found or if the debootstrap script execution fails + :return: process results in command type + :rtype: namedtuple """ if not self.distribution: @@ -193,9 +275,9 @@ ) ) self.cleanup_requests() - cmd.extend([ - self.distribution, self.root_dir, self.distribution_path - ]) + cmd.extend( + [self.distribution, self.root_dir, self.distribution_path] + ) return Command.call(cmd, self.command_env) except Exception as e: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/base.py new/kiwi-9.24.36/kiwi/package_manager/base.py --- old/kiwi-9.24.35/kiwi/package_manager/base.py 2022-03-08 20:23:49.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/base.py 2022-05-19 15:21:13.000000000 +0200 @@ -116,7 +116,7 @@ raise NotImplementedError def process_install_requests_bootstrap( - self, root_bind: RootBind = None + self, root_bind: RootBind = None, bootstrap_package: str = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/dnf.py new/kiwi-9.24.36/kiwi/package_manager/dnf.py --- old/kiwi-9.24.35/kiwi/package_manager/dnf.py 2021-12-21 21:23:52.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/dnf.py 2022-05-19 15:21:13.000000000 +0200 @@ -135,12 +135,13 @@ ) def process_install_requests_bootstrap( - self, root_bind: RootBind = None + self, root_bind: RootBind = None, bootstrap_package: str = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) :param object root_bind: unused + :param str bootstrap_package: unused :return: process results in command type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/microdnf.py new/kiwi-9.24.36/kiwi/package_manager/microdnf.py --- old/kiwi-9.24.35/kiwi/package_manager/microdnf.py 2021-12-21 21:23:52.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/microdnf.py 2022-05-19 15:21:13.000000000 +0200 @@ -154,12 +154,13 @@ ) def process_install_requests_bootstrap( - self, root_bind: RootBind = None + self, root_bind: RootBind = None, bootstrap_package: str = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) :param object root_bind: unused + :param str bootstrap_package: unused :return: process results in command type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/pacman.py new/kiwi-9.24.36/kiwi/package_manager/pacman.py --- old/kiwi-9.24.35/kiwi/package_manager/pacman.py 2021-12-21 21:23:52.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/pacman.py 2022-05-19 15:21:13.000000000 +0200 @@ -111,12 +111,13 @@ pass def process_install_requests_bootstrap( - self, root_bind: RootBind = None + self, root_bind: RootBind = None, bootstrap_package: str = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) :param object root_bind: unused + :param str bootstrap_package: unused :return: process results in command type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/package_manager/zypper.py new/kiwi-9.24.36/kiwi/package_manager/zypper.py --- old/kiwi-9.24.35/kiwi/package_manager/zypper.py 2021-12-21 21:23:52.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/package_manager/zypper.py 2022-05-19 15:21:13.000000000 +0200 @@ -113,12 +113,13 @@ pass def process_install_requests_bootstrap( - self, root_bind: RootBind = None + self, root_bind: RootBind = None, bootstrap_package: str = None ) -> command_call_type: """ Process package install requests for bootstrap phase (no chroot) :param object root_bind: unused + :param str bootstrap_package: unused :return: process results in command type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/schema/kiwi.rnc new/kiwi-9.24.36/kiwi/schema/kiwi.rnc --- old/kiwi-9.24.35/kiwi/schema/kiwi.rnc 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/schema/kiwi.rnc 2022-05-19 15:21:13.000000000 +0200 @@ -3271,6 +3271,18 @@ # main block: <packages> # div { + sch:pattern [ + abstract = "true" + id = "packages_type" + sch:rule [ + context = "packages[@$attr]" + sch:assert [ + test = "contains('$types', @type)" + "$attr attribute is only available for the following " + "packages type(s): $types" + ] + ] + ] k.packages.type.attribute = ## Specifies package collection type. `bootstrap` packages ## gets installed in the very first phase of an image build @@ -3291,10 +3303,34 @@ attribute patternType { "onlyRequired" | "plusRecommended" } + k.packages.bootstrap_package.attribute = + ## Specify bootstrap package providing a bootstrap tarball + ## in /var/cache/kiwi/bootstrap/PACKAGE_NAME.ARCH.tar.xz + ## The tarball will be unpacked and used as the bootstrap + ## rootfs to begin with. The feature is currently only + ## available with the apt package manager to allow an + ## alternative bootstrap method for debootstrap + attribute bootstrap_package { text } + >> sch:pattern [ id = "bootstrap_package" is-a = "packages_type" + sch:param [ name = "attr" value = "bootstrap_package" ] + sch:param [ name = "types" value = "bootstrap" ] + ] + sch:pattern [ + id = "bootstrap_package_validation" + sch:rule [ + context = "packages" + sch:assert [ + test = "../preferences/packagemanager[text()='apt'] or not(@bootstrap_package)" + "bootstrap_package attribute only available for " + "the apt packagemanager" + ] + ] + ] k.packages.attlist = k.packages.type.attribute & k.packages.profiles.attribute? & - k.packages.patternType.attribute? + k.packages.patternType.attribute? & + k.packages.bootstrap_package.attribute? k.packages = ## Specifies Packages/Patterns Used in Different Stages element packages { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/schema/kiwi.rng new/kiwi-9.24.36/kiwi/schema/kiwi.rng --- old/kiwi-9.24.35/kiwi/schema/kiwi.rng 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/schema/kiwi.rng 2022-05-19 15:21:13.000000000 +0200 @@ -4929,6 +4929,11 @@ --> <div> + <sch:pattern abstract="true" id="packages_type"> + <sch:rule context="packages[@$attr]"> + <sch:assert test="contains('$types', @type)">$attr attribute is only available for the following packages type(s): $types</sch:assert> + </sch:rule> + </sch:pattern> <define name="k.packages.type.attribute"> <attribute name="type"> <a:documentation>Specifies package collection type. `bootstrap` packages @@ -4965,6 +4970,25 @@ </choice> </attribute> </define> + <define name="k.packages.bootstrap_package.attribute"> + <attribute name="bootstrap_package"> + <a:documentation>Specify bootstrap package providing a bootstrap tarball +in /var/cache/kiwi/bootstrap/PACKAGE_NAME.ARCH.tar.xz +The tarball will be unpacked and used as the bootstrap +rootfs to begin with. The feature is currently only +available with the apt package manager to allow an +alternative bootstrap method for debootstrap</a:documentation> + </attribute> + <sch:pattern id="bootstrap_package" is-a="packages_type"> + <sch:param name="attr" value="bootstrap_package"/> + <sch:param name="types" value="bootstrap"/> + </sch:pattern> + </define> + <sch:pattern id="bootstrap_package_validation"> + <sch:rule context="packages"> + <sch:assert test="../preferences/packagemanager[text()='apt'] or not(@bootstrap_package)">bootstrap_package attribute only available for the apt packagemanager</sch:assert> + </sch:rule> + </sch:pattern> <define name="k.packages.attlist"> <interleave> <ref name="k.packages.type.attribute"/> @@ -4974,6 +4998,9 @@ <optional> <ref name="k.packages.patternType.attribute"/> </optional> + <optional> + <ref name="k.packages.bootstrap_package.attribute"/> + </optional> </interleave> </define> <define name="k.packages"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/storage/subformat/base.py new/kiwi-9.24.36/kiwi/storage/subformat/base.py --- old/kiwi-9.24.35/kiwi/storage/subformat/base.py 2021-09-07 18:02:16.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/storage/subformat/base.py 2022-05-17 10:50:14.000000000 +0200 @@ -185,15 +185,16 @@ :param object result: Instance of Result """ + compression = self.runtime_config.get_bundle_compression(default=True) + if self.xml_state.get_luks_credentials() is not None: + compression = False result.add( key='disk_format_image', filename=self.get_target_file_path_for_format( self.image_format ), use_for_bundle=True, - compress=self.runtime_config.get_bundle_compression( - default=True - ), + compress=compression, shasum=True ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/storage/subformat/vhdfixed.py new/kiwi-9.24.36/kiwi/storage/subformat/vhdfixed.py --- old/kiwi-9.24.35/kiwi/storage/subformat/vhdfixed.py 2021-07-14 18:09:36.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/storage/subformat/vhdfixed.py 2022-05-17 10:50:14.000000000 +0200 @@ -79,15 +79,16 @@ :param object result: Instance of Result """ + compression = self.runtime_config.get_bundle_compression(default=True) + if self.xml_state.get_luks_credentials() is not None: + compression = False result.add( key='disk_format_image', filename=self.get_target_file_path_for_format( self.image_format ), use_for_bundle=True, - compress=self.runtime_config.get_bundle_compression( - default=True - ), + compress=compression, shasum=True ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/storage/subformat/vmdk.py new/kiwi-9.24.36/kiwi/storage/subformat/vmdk.py --- old/kiwi-9.24.35/kiwi/storage/subformat/vmdk.py 2021-09-07 18:02:16.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/storage/subformat/vmdk.py 2022-05-17 10:50:14.000000000 +0200 @@ -68,13 +68,14 @@ :param object result: Instance of Result """ + compression = self.runtime_config.get_bundle_compression(default=True) + if self.xml_state.get_luks_credentials() is not None: + compression = False result.add( key='disk_format_image', filename=self.get_target_file_path_for_format('vmdk'), use_for_bundle=True, - compress=self.runtime_config.get_bundle_compression( - default=True - ), + compress=compression, shasum=True ) result.add( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/system/prepare.py new/kiwi-9.24.36/kiwi/system/prepare.py --- old/kiwi-9.24.35/kiwi/system/prepare.py 2022-03-08 20:23:49.000000000 +0100 +++ new/kiwi-9.24.36/kiwi/system/prepare.py 2022-05-19 15:21:13.000000000 +0200 @@ -250,8 +250,9 @@ self.xml_state.get_collection_modules() ) process = CommandProcess( - command=manager.process_install_requests_bootstrap(self.root_bind), - log_topic='bootstrap' + command=manager.process_install_requests_bootstrap( + self.root_bind, self.xml_state.get_bootstrap_package_name() + ), log_topic='bootstrap' ) try: process.poll_show_progress( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/version.py new/kiwi-9.24.36/kiwi/version.py --- old/kiwi-9.24.35/kiwi/version.py 2022-05-08 20:51:36.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/version.py 2022-05-19 15:21:54.000000000 +0200 @@ -18,5 +18,5 @@ """ Global version information used in kiwi and the package """ -__version__ = '9.24.35' -__githash__ = '68ffba1444de600257464af806ffd810d935b6a0' +__version__ = '9.24.36' +__githash__ = 'b43fa3fd28041fa03a03f944b5ffdcdb28d901cc' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/xml_parse.py new/kiwi-9.24.36/kiwi/xml_parse.py --- old/kiwi-9.24.35/kiwi/xml_parse.py 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/xml_parse.py 2022-05-19 15:21:13.000000000 +0200 @@ -8049,11 +8049,12 @@ """Specifies Packages/Patterns Used in Different Stages""" subclass = None superclass = None - def __init__(self, type_=None, profiles=None, patternType=None, archive=None, ignore=None, namedCollection=None, collectionModule=None, product=None, package=None): + def __init__(self, type_=None, profiles=None, patternType=None, bootstrap_package=None, archive=None, ignore=None, namedCollection=None, collectionModule=None, product=None, package=None): self.original_tagname_ = None self.type_ = _cast(None, type_) self.profiles = _cast(None, profiles) self.patternType = _cast(None, patternType) + self.bootstrap_package = _cast(None, bootstrap_package) if archive is None: self.archive = [] else: @@ -8125,6 +8126,8 @@ def set_profiles(self, profiles): self.profiles = profiles def get_patternType(self): return self.patternType def set_patternType(self, patternType): self.patternType = patternType + def get_bootstrap_package(self): return self.bootstrap_package + def set_bootstrap_package(self, bootstrap_package): self.bootstrap_package = bootstrap_package def hasContent_(self): if ( self.archive or @@ -8168,6 +8171,9 @@ if self.patternType is not None and 'patternType' not in already_processed: already_processed.add('patternType') outfile.write(' patternType=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.patternType), input_name='patternType')), )) + if self.bootstrap_package is not None and 'bootstrap_package' not in already_processed: + already_processed.add('bootstrap_package') + outfile.write(' bootstrap_package=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootstrap_package), input_name='bootstrap_package')), )) def exportChildren(self, outfile, level, namespaceprefix_='', name_='packages', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' @@ -8207,6 +8213,10 @@ already_processed.add('patternType') self.patternType = value self.patternType = ' '.join(self.patternType.split()) + value = find_attr_value_('bootstrap_package', node) + if value is not None and 'bootstrap_package' not in already_processed: + already_processed.add('bootstrap_package') + self.bootstrap_package = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'archive': obj_ = archive.factory() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi/xml_state.py new/kiwi-9.24.36/kiwi/xml_state.py --- old/kiwi-9.24.35/kiwi/xml_state.py 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/kiwi/xml_state.py 2022-05-19 15:21:13.000000000 +0200 @@ -579,6 +579,24 @@ result.append(package.get_name().strip()) return sorted(result) + def get_bootstrap_package_name(self) -> str: + """ + bootstrap_package name from type="bootstrap" packages section + + :return: bootstrap_package name + + :rtype: str + """ + typed_packages_sections = self.get_packages_sections( + ['bootstrap', self.get_build_type_name()] + ) + bootstrap_package = '' + for packages in typed_packages_sections: + bootstrap_package = packages.get_bootstrap_package() + if bootstrap_package: + break + return bootstrap_package + def get_collection_type(self, section_type: str = 'image') -> str: """ Collection type from packages sections matching given section diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi.egg-info/PKG-INFO new/kiwi-9.24.36/kiwi.egg-info/PKG-INFO --- old/kiwi-9.24.35/kiwi.egg-info/PKG-INFO 2022-05-08 20:53:43.000000000 +0200 +++ new/kiwi-9.24.36/kiwi.egg-info/PKG-INFO 2022-05-19 15:25:17.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: kiwi -Version: 9.24.35 +Version: 9.24.36 Summary: KIWI - Appliance Builder (next generation) Home-page: https://osinside.github.io/kiwi Author: Marcus Schaefer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi.egg-info/SOURCES.txt new/kiwi-9.24.36/kiwi.egg-info/SOURCES.txt --- old/kiwi-9.24.35/kiwi.egg-info/SOURCES.txt 2022-05-08 20:53:43.000000000 +0200 +++ new/kiwi-9.24.36/kiwi.egg-info/SOURCES.txt 2022-05-19 15:25:17.000000000 +0200 @@ -100,6 +100,7 @@ doc/source/troubleshooting/security.rst doc/source/working_with_images/build_in_buildservice.rst doc/source/working_with_images/build_with_profiles.rst +doc/source/working_with_images/build_without_debootstrap.rst doc/source/working_with_images/clone_partitions.rst doc/source/working_with_images/custom_fstab_extension.rst doc/source/working_with_images/custom_partitions.rst @@ -407,6 +408,7 @@ package/python-kiwi-spec-template package/python-kiwi.changes test/data/__init__.py +test/data/example_apt_config.xml test/data/example_arm_disk_size_config.xml test/data/example_btrfs_config.xml test/data/example_config.xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/kiwi.yml new/kiwi-9.24.36/kiwi.yml --- old/kiwi-9.24.35/kiwi.yml 2022-03-30 21:18:02.000000000 +0200 +++ new/kiwi-9.24.36/kiwi.yml 2022-05-17 10:50:14.000000000 +0200 @@ -28,7 +28,13 @@ # Setup behaviour of the kiwi result bundle command #bundle: # # Specify if the bundle tarball should contain compressed results. -# # Note: already compressed result information will not be touched +# # Note: Already compressed result information will not be touched. +# # Build results that generate an encrypted filesystem, i.e. +# # luks setup, will not be compressed. The intention for result compression +# # is to produce a smaller representation of the original. Encrypted data +# # generally grows when an attempt is made to compress the data. This is +# # due to the nature of compression algorithms. Therefore this setting is +# # ignored when encryption is enabled. # - compress: false # # Specify if the image build result and bundle should contain # # a .changes file. The .changes file contains the package changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/data/example_apt_config.xml new/kiwi-9.24.36/test/data/example_apt_config.xml --- old/kiwi-9.24.35/test/data/example_apt_config.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/kiwi-9.24.36/test/data/example_apt_config.xml 2022-05-19 15:21:13.000000000 +0200 @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> + +<image schemaversion="7.5" name="apt-testing"> + <description type="system"> + <author>Bob</author> + <contact>u...@example.com</contact> + <specification> + Testing various configuration for apt packagemanager + </specification> + </description> + <preferences> + <version>1.13.2</version> + <packagemanager>apt</packagemanager> + <locale>en_US</locale> + <keytable>us.map.gz</keytable> + <timezone>Europe/Berlin</timezone> + <type image="tbz"/> + </preferences> + <repository priority="42" sourcetype="baseurl"> + <source path="iso:///image/CDs/dvd.iso"> + <signing key="file:key_a"/> + </source> + </repository> + <packages type="image"> + <package name="foo"/> + </packages> + <packages type="bootstrap" bootstrap_package="bootstrap-me"> + <package name="filesystem"/> + </packages> +</image> Binary files old/kiwi-9.24.35/test/unit/.coverage and new/kiwi-9.24.36/test/unit/.coverage differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/package_manager/apt_test.py new/kiwi-9.24.36/test/unit/package_manager/apt_test.py --- old/kiwi-9.24.35/test/unit/package_manager/apt_test.py 2022-03-08 20:23:49.000000000 +0100 +++ new/kiwi-9.24.36/test/unit/package_manager/apt_test.py 2022-05-19 15:21:13.000000000 +0200 @@ -8,9 +8,12 @@ from kiwi.package_manager.apt import PackageManagerApt +import kiwi.defaults as defaults + from kiwi.exceptions import ( KiwiDebootstrapError, - KiwiRequestError + KiwiRequestError, + KiwiFileNotFound ) @@ -62,13 +65,48 @@ def test_setup_repository_modules(self): self.manager.setup_repository_modules({}) - def test_process_install_requests_bootstrap_no_dist(self): + @patch('kiwi.command.Command.run') + @patch.object(PackageManagerApt, 'process_install_requests') + @patch('os.path.isfile') + def test_process_install_requests_bootstrap_prebuild_root( + self, mock_os_path_isfile, mock_process_install_requests, + mock_Command_run + ): + mock_os_path_isfile.return_value = True + self.manager.process_install_requests_bootstrap( + bootstrap_package='bootstrap-package' + ) + assert mock_Command_run.call_args_list == [ + call(['apt-get', '-c', 'apt.conf', '-y', 'update'], ['env']), + call( + [ + 'apt-get', '-c', 'apt.conf', '-y', + 'install', 'bootstrap-package' + ], ['env'] + ), + call( + [ + 'tar', '-C', 'root-dir', '-xf', + '/var/lib/bootstrap/bootstrap-package.{0}.tar.xz'.format( + defaults.PLATFORM_MACHINE + ) + ] + ) + ] + mock_process_install_requests.assert_called_once_with() + mock_os_path_isfile.return_value = False + with raises(KiwiFileNotFound): + self.manager.process_install_requests_bootstrap( + bootstrap_package='bootstrap-package' + ) + + def test_process_install_requests_bootstrap_debootstrap_no_dist(self): self.manager.distribution = None with raises(KiwiDebootstrapError): self.manager.process_install_requests_bootstrap() @patch('os.path.exists') - def test_process_install_requests_bootstrap_no_debootstrap_script( + def test_process_install_requests_bootstrap_debootstrap_no_script( self, mock_exists ): mock_exists.return_value = False @@ -78,7 +116,7 @@ @patch('kiwi.command.Command.call') @patch('kiwi.package_manager.apt.os.path.exists') @patch('kiwi.package_manager.apt.Path.wipe') - def test_process_install_requests_bootstrap_failed_debootstrap( + def test_process_install_requests_bootstrap_debootstrap_failed( self, mock_wipe, mock_exists, mock_call ): self.manager.request_package('apt') @@ -118,7 +156,7 @@ @patch('kiwi.command.Command.call') @patch('kiwi.package_manager.apt.Path.wipe') @patch('kiwi.package_manager.apt.os.path.exists') - def test_process_install_requests_bootstrap( + def test_process_install_requests_bootstrap_debootstrap( self, mock_exists, mock_wipe, mock_call ): self.manager.request_package('apt') @@ -151,7 +189,7 @@ @patch('kiwi.command.Command.call') @patch('kiwi.package_manager.apt.Path.wipe') @patch('kiwi.package_manager.apt.os.path.exists') - def test_process_install_requests_bootstrap_no_gpg_check( + def test_process_install_requests_bootstrap_debootstrap_no_gpg_check( self, mock_exists, mock_wipe, mock_call ): self.manager.request_package('apt') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/storage/subformat/base_test.py new/kiwi-9.24.36/test/unit/storage/subformat/base_test.py --- old/kiwi-9.24.35/test/unit/storage/subformat/base_test.py 2022-03-08 20:23:49.000000000 +0100 +++ new/kiwi-9.24.36/test/unit/storage/subformat/base_test.py 2022-05-17 10:50:14.000000000 +0200 @@ -27,6 +27,9 @@ self.xml_state.get_image_version = Mock( return_value='1.2.3' ) + self.xml_state.get_luks_credentials = Mock( + return_value=None + ) self.runtime_config = Mock() self.runtime_config.get_bundle_compression.return_value = True kiwi.storage.subformat.base.RuntimeConfig = Mock( @@ -71,7 +74,7 @@ assert self.disk_format.get_target_file_path_for_format('vhd') == \ 'target_dir/some-disk-image.x86_64-1.2.3.vhd' - def test_store_to_result(self): + def test_store_to_result_default(self): result = Mock() self.disk_format.image_format = 'qcow2' self.disk_format.store_to_result(result) @@ -83,6 +86,20 @@ use_for_bundle=True ) + def test_store_to_result_with_luks(self): + result = Mock() + self.xml_state.get_luks_credentials = Mock(return_value='foo') + self.disk_format.image_format = 'qcow2' + self.disk_format.store_to_result(result) + result.add.assert_called_once_with( + compress=False, + filename='target_dir/some-disk-image.x86_64-1.2.3.qcow2', + key='disk_format_image', + shasum=True, + use_for_bundle=True + ) + self.xml_state.get_luks_credentials = Mock(return_value=None) + @patch('os.path.getsize') def test_resize_raw_disk_raises_on_shrink_disk(self, mock_getsize): mock_getsize.return_value = 42 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/storage/subformat/vhdfixed_test.py new/kiwi-9.24.36/test/unit/storage/subformat/vhdfixed_test.py --- old/kiwi-9.24.35/test/unit/storage/subformat/vhdfixed_test.py 2022-03-08 20:23:50.000000000 +0100 +++ new/kiwi-9.24.36/test/unit/storage/subformat/vhdfixed_test.py 2022-05-17 10:50:14.000000000 +0200 @@ -25,6 +25,9 @@ self.xml_state.get_image_version = Mock( return_value='1.2.3' ) + self.xml_state.get_luks_credentials = Mock( + return_value=None + ) self.runtime_config = Mock() self.runtime_config.get_bundle_compression.return_value = True kiwi.storage.subformat.base.RuntimeConfig = Mock( @@ -89,7 +92,7 @@ call(65536, 0), call(0, 2) ] - def test_store_to_result(self): + def test_store_to_result_default(self): result = Mock() self.disk_format.store_to_result(result) result.add.assert_called_once_with( @@ -99,3 +102,16 @@ shasum=True, use_for_bundle=True ) + + def test_store_to_result_with_luks(self): + result = Mock() + self.xml_state.get_luks_credentials = Mock(return_value='foo') + self.disk_format.store_to_result(result) + result.add.assert_called_once_with( + compress=False, + filename='target_dir/some-disk-image.x86_64-1.2.3.vhdfixed', + key='disk_format_image', + shasum=True, + use_for_bundle=True + ) + self.xml_state.get_luks_credentials = Mock(return_value=None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/storage/subformat/vmdk_test.py new/kiwi-9.24.36/test/unit/storage/subformat/vmdk_test.py --- old/kiwi-9.24.35/test/unit/storage/subformat/vmdk_test.py 2022-03-08 20:23:50.000000000 +0100 +++ new/kiwi-9.24.36/test/unit/storage/subformat/vmdk_test.py 2022-05-17 10:50:14.000000000 +0200 @@ -60,6 +60,9 @@ self.xml_state.get_build_type_vmdvd_section = Mock( return_value=self.iso_setup ) + self.xml_state.get_luks_credentials = Mock( + return_value=None + ) self.iso_setup.get_controller = Mock( return_value='ide' ) @@ -114,7 +117,7 @@ '-o', 'adapter_type=lsilogic', '-o', 'option=value' ] - def test_store_to_result(self): + def test_store_to_result_default(self): result = Mock() self.disk_format.store_to_result(result) assert result.add.call_args_list == [ @@ -134,6 +137,32 @@ ) ] + def test_store_to_result_with_luks(self): + result = Mock() + self.xml_state.get_luks_credentials = Mock( + return_value='foo' + ) + 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.vmdk', + key='disk_format_image', + shasum=True, + use_for_bundle=True + ), + call( + compress=False, + filename='target_dir/some-disk-image.x86_64-1.2.3.vmx', + key='disk_format_machine_settings', + shasum=False, + use_for_bundle=True + ) + ] + self.xml_state.get_luks_credentials = Mock( + return_value=None + ) + @patch('kiwi.storage.subformat.vmdk.VmwareSettingsTemplate.get_template') @patch('kiwi.storage.subformat.vmdk.Command.run') @patch('os.path.exists') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/system/prepare_test.py new/kiwi-9.24.36/test/unit/system/prepare_test.py --- old/kiwi-9.24.35/test/unit/system/prepare_test.py 2022-03-08 20:23:50.000000000 +0100 +++ new/kiwi-9.24.36/test/unit/system/prepare_test.py 2022-05-19 15:21:13.000000000 +0200 @@ -304,7 +304,7 @@ {'disable': ['mod_c'], 'enable': ['mod_a:stream', 'mod_b']} ) self.manager.process_install_requests_bootstrap.assert_called_once_with( - self.system.root_bind + self.system.root_bind, None ) mock_tar.assert_called_once_with( '{0}/bootstrap.tgz'.format(self.description_dir) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.24.35/test/unit/xml_state_test.py new/kiwi-9.24.36/test/unit/xml_state_test.py --- old/kiwi-9.24.35/test/unit/xml_state_test.py 2022-05-08 20:51:30.000000000 +0200 +++ new/kiwi-9.24.36/test/unit/xml_state_test.py 2022-05-19 15:21:13.000000000 +0200 @@ -35,6 +35,12 @@ self.state = XMLState( self.description.load() ) + apt_description = XMLDescription( + '../data/example_apt_config.xml' + ) + self.apt_state = XMLState( + apt_description.load() + ) boot_description = XMLDescription( '../data/isoboot/example-distribution/config.xml' ) @@ -1090,3 +1096,6 @@ '--cipher', 'aes-gcm-random', '--integrity', 'aead' ] + + def test_get_bootstrap_package_name(self): + assert self.apt_state.get_bootstrap_package_name() == 'bootstrap-me'