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 2023-12-09 22:49:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kiwi (Old) and /work/SRC/openSUSE:Factory/.python-kiwi.new.25432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kiwi" Sat Dec 9 22:49:09 2023 rev:108 rq:1132074 version:9.25.19 Changes: -------- --- /work/SRC/openSUSE:Factory/python-kiwi/python-kiwi.changes 2023-10-17 20:22:43.354501962 +0200 +++ /work/SRC/openSUSE:Factory/.python-kiwi.new.25432/python-kiwi.changes 2023-12-09 22:49:17.422929369 +0100 @@ -1,0 +2,163 @@ +Fri Dec 08 09:25:22 CET 2023 - Marcus Schäfer <[email protected]> + +- Update test-image-MicroOS + + Incorporate latest changes from upstream MicroOS and + also add an encrypted profile build for testing + +------------------------------------------------------------------- +Tue Nov 28 08:54:36 CET 2023 - Marcus Schäfer <[email protected]> + +- Bump version: 9.25.18 â 9.25.19 + +------------------------------------------------------------------- +Thu Nov 23 18:43:49 CET 2023 - Alexandre Esse <[email protected]> + +- Fix typo in workflow overview doc section + +------------------------------------------------------------------- +Wed Nov 22 15:54:19 CET 2023 - Marcus Schäfer <[email protected]> + +- Add missing documentation for oem-unattended-id + +------------------------------------------------------------------- +Wed Nov 22 15:38:13 CET 2023 - Marcus Schäfer <[email protected]> + +- Allow install disk overwrite from cmdline + + Add rd.kiwi.oem.installdevice=DEVICE. Configures the disk device + that should be used in an OEM installation. This overwrites any + other oem device setting, e.g device filter or maxdisk and just + continues the installation on the given device. However, the + device must exist and must be a block special. + This Fixes jira#PED-7180 + +------------------------------------------------------------------- +Tue Nov 21 20:46:03 CET 2023 - Marcus Schäfer <[email protected]> + +- Update mailmap + +------------------------------------------------------------------- +Fri Nov 10 13:08:26 CET 2023 - Kali <[email protected]> + +- Replace the regex-based loader entry fix with string parsing (#2388) + + A user building RHEL images ran into issues with the initrd. + It turns out that RHEL uses some patches that mean the + initrd/linux files in RHEL are not installed to /boot, which trips + up the original regex. The new fix doesn't rely on matching the + path in boot, instead just finding the initrd/linux files and rewriting + them in place. + + This change also adds the pre-and-post fix loader entries to the debug logs. + + Reference: https://bugzilla.suse.com/1208701 + + Fixes suse bsc#1208701 + +------------------------------------------------------------------- +Fri Nov 10 13:05:48 CET 2023 - Marcus Schäfer <[email protected]> + +- Fix mbrid setup for read-only systems + + On filesystems without a UUID (e.g squashfs) the fallback boot id + setup should apply if neither UUID nor MBR ID is present. This + is a followup fix for Issue #2391 + +------------------------------------------------------------------- +Thu Nov 09 09:18:12 CET 2023 - Marcus Schäfer <[email protected]> + +- Fixed test-image-disk-legacy test description + + The configured embedded ESP image size is too big, max 30MB + are possible as El Torito boot load size + +------------------------------------------------------------------- +Thu Nov 09 09:04:44 CET 2023 - Marcus Schäfer <[email protected]> + +- Don't make toml a requirement + +------------------------------------------------------------------- +Wed Nov 08 15:25:29 CET 2023 - Marcus Schäfer <[email protected]> + +- Fixed grub mbrid file search + + To identify the root device for ISO images (live and install media) + that boots via grub2, kiwi uses a grub2 --file search. The searched + file was named /boot/mbrid, however this is not a unique name and + could be found on other devices of the system as well. To connect + the search to the correct media this commit changes the search to + an ID based method which is unique to the image build process. + This Fixes #2389 + +------------------------------------------------------------------- +Wed Nov 08 12:47:32 CET 2023 - Marcus Schäfer <[email protected]> + +- Don't use kernel-install + + kernel-install does a lot more then making the kernel available + to the ESP. It calls dracut, it creates loader entries and all + that is unexpected and also breaks the boot because the way + dracut is called in the image build case where host != target + leads to broken results. This commit refactors the systemd-boot + support in kiwi to prevent the use of kernel-install + +------------------------------------------------------------------- +Wed Nov 08 09:22:16 CET 2023 - Marcus Schäfer <[email protected]> + +- Add check_efi_fat_image_has_correct_size + + Add runtime check for to check that the efifatimagesize + does not exceed the max El Torito load size + +------------------------------------------------------------------- +Tue Nov 07 08:55:57 CET 2023 - Marcus Schäfer <[email protected]> + +- Add support for ISO boot via systemd-boot + + Create proper EFI FAT image via bootctl to be used as + alt loader in xorriso. This allows to boot the ISO + via EFI e.g kvm -bios /usr/share/qemu/ovmf-x86_64.bin -cdrom file.iso + Please note, hybrid boot is done via grub's hybrid MBR and + as systemd-boot does not provide one, hybrid boot is out + of scope yet. This Fixes #2281 + +------------------------------------------------------------------- +Sun Nov 05 10:04:33 CET 2023 - Marcus Schäfer <[email protected]> + +- Bump version: 9.25.17 â 9.25.18 + +------------------------------------------------------------------- +Wed Nov 01 18:09:13 CET 2023 - Marcus Schäfer <[email protected]> + +- Add partx to module-setup of kiwi-lib too + +------------------------------------------------------------------- +Fri Oct 27 09:21:59 CEST 2023 - Marcus Schäfer <[email protected]> + +- Change partprobe fallback to partx + + Informing the kernel about a new partition geometry can be done in a + busy state and is also effective for new devices and new mounts based + on the new geometry. busy state mounts of course will not see it until + swap of the busy state but a complete refuse of operation like it + happens with blockdev is imho not required. Just as partprobe, partx + is less restrictive on the busy state. That's why this commit changes + the partprobe fallback to use partx instead of blockdev + +------------------------------------------------------------------- +Thu Oct 26 12:51:32 CEST 2023 - Marcus Schäfer <[email protected]> + +- Create live persistent storage without busy state + + With the former logic the live ISO was already mounted when an + eventual persistent storage partition was created. This leads + to an issue on re-reading the partition table, not for all but + several tools. This commit changes the order of tasks such that + the setup of the persistent write storage is performed prior + mounting the live ISO. In addition to this change an alternative + method using blockdev to re-read the partition was added in case + partprobe is not present. This also allows to get rid of the + parted dependency which provides partprobe + +------------------------------------------------------------------- @@ -69,0 +233,8 @@ + +------------------------------------------------------------------- +Wed Sep 13 11:57:42 CEST 2023 - Marcus Schäfer <[email protected]> + +- Support TOML markup + + Allow to use TOML markup for the kiwi image description + This Fixes #2372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kiwi.spec ++++++ --- /var/tmp/diff_new_pack.Z7vTRs/_old 2023-12-09 22:49:18.046951897 +0100 +++ /var/tmp/diff_new_pack.Z7vTRs/_new 2023-12-09 22:49:18.046951897 +0100 @@ -43,7 +43,7 @@ %endif Name: python-kiwi -Version: 9.25.17 +Version: 9.25.19 Provides: kiwi-schema = 7.5 Release: 0 Url: https://github.com/OSInside/kiwi ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.Z7vTRs/_old 2023-12-09 22:49:18.090953486 +0100 +++ /var/tmp/diff_new_pack.Z7vTRs/_new 2023-12-09 22:49:18.094953630 +0100 @@ -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.25.17 +pkgver=9.25.19 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=('89281997b74f517c6f39040fb421fab2') +md5sums=('2c2579761c6953e6955eb37873fe9cda') build() { ++++++ python-kiwi.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/.bumpversion.cfg new/kiwi-9.25.19/.bumpversion.cfg --- old/kiwi-9.25.17/.bumpversion.cfg 2023-10-17 09:30:49.000000000 +0200 +++ new/kiwi-9.25.19/.bumpversion.cfg 2023-11-28 08:54:36.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 9.25.17 +current_version = 9.25.19 commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/.virtualenv.requirements.txt new/kiwi-9.25.19/.virtualenv.requirements.txt --- old/kiwi-9.25.17/.virtualenv.requirements.txt 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/.virtualenv.requirements.txt 2023-11-08 16:19:12.000000000 +0100 @@ -11,6 +11,9 @@ # YAML file parsing PyYAML +# TOML file parsing +toml + # Python wrapper for extended filesystem attributes xattr==0.9.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/PKG-INFO new/kiwi-9.25.19/PKG-INFO --- old/kiwi-9.25.17/PKG-INFO 2023-10-17 09:35:17.000000000 +0200 +++ new/kiwi-9.25.19/PKG-INFO 2023-12-08 11:57:53.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: kiwi -Version: 9.25.17 +Version: 9.25.19 Summary: KIWI - Appliance Builder (next generation) Home-page: https://osinside.github.io/kiwi Author: Marcus Schaefer Binary files old/kiwi-9.25.17/doc/build/latex/kiwi.pdf and new/kiwi-9.25.19/doc/build/latex/kiwi.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/doc/build/man/kiwi.8 new/kiwi-9.25.19/doc/build/man/kiwi.8 --- old/kiwi-9.25.17/doc/build/man/kiwi.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi.8 2023-12-08 11:57:51.000000000 +0100 @@ -27,7 +27,7 @@ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "KIWI" "8" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI" "8" "Dec 08, 2023" "9.25.19" "KIWI NG" .SH NAME kiwi \- Creating Operating System Images .SH SYNOPSIS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/doc/build/man/kiwi::image::info.8 new/kiwi-9.25.19/doc/build/man/kiwi::image::info.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::image::info.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::image::info.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::IMAGE::INFO" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::image::resize.8 new/kiwi-9.25.19/doc/build/man/kiwi::image::resize.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::image::resize.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::image::resize.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::IMAGE::RESIZE" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::result::bundle.8 new/kiwi-9.25.19/doc/build/man/kiwi::result::bundle.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::result::bundle.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::result::bundle.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::RESULT::BUNDLE" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::result::list.8 new/kiwi-9.25.19/doc/build/man/kiwi::result::list.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::result::list.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::result::list.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::RESULT::LIST" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::system::build.8 new/kiwi-9.25.19/doc/build/man/kiwi::system::build.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::system::build.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::system::build.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::SYSTEM::BUILD" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::system::create.8 new/kiwi-9.25.19/doc/build/man/kiwi::system::create.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::system::create.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::system::create.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::SYSTEM::CREATE" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::system::prepare.8 new/kiwi-9.25.19/doc/build/man/kiwi::system::prepare.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::system::prepare.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::system::prepare.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::SYSTEM::PREPARE" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/build/man/kiwi::system::update.8 new/kiwi-9.25.19/doc/build/man/kiwi::system::update.8 --- old/kiwi-9.25.17/doc/build/man/kiwi::system::update.8 2023-10-17 09:35:13.000000000 +0200 +++ new/kiwi-9.25.19/doc/build/man/kiwi::system::update.8 2023-12-08 11:57:51.000000000 +0100 @@ -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" "Oct 17, 2023" "9.25.17" "KIWI NG" +.TH "KIWI::SYSTEM::UPDATE" "8" "Dec 08, 2023" "9.25.19" "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.25.17/doc/source/building_images/build_expandable_disk.rst new/kiwi-9.25.19/doc/source/building_images/build_expandable_disk.rst --- old/kiwi-9.25.17/doc/source/building_images/build_expandable_disk.rst 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/doc/source/building_images/build_expandable_disk.rst 2023-11-28 08:50:30.000000000 +0100 @@ -393,6 +393,15 @@ possible target devices are discovered the image is deployed to the first device. ``kiwi_oemunattended`` in the initrd +oemconfig.oem-unattended-id Element + The target disk device for the installation is selected according + to the specified device ID. The device ID corresponds to the name of + the device as it exists for the configured `devicepersistency`. By + default this is the `by-uuid` device name. If no such representation + exist e.g for ramdisk devices, the unix device node can be used + to select. The given name must be present in the device list detected + by kiwi. + oemconfig.oem-skip-verify Element Do not perform the checksum verification process after install of the image to the target disk. The verification process computes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/doc/source/concept_and_workflow/customize_the_boot_process.rst new/kiwi-9.25.19/doc/source/concept_and_workflow/customize_the_boot_process.rst --- old/kiwi-9.25.17/doc/source/concept_and_workflow/customize_the_boot_process.rst 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/doc/source/concept_and_workflow/customize_the_boot_process.rst 2023-11-28 08:50:30.000000000 +0100 @@ -210,6 +210,19 @@ OS deployment is `/dev/sdj`. With `rd.kiwi.oem.maxdisk=500G` the deployment will land on that RAID disk. +``rd.kiwi.oem.installdevice`` + Configures the disk device that should be used in an OEM + installation. This overwrites/resets any other oem device specific + settings, e.g oem-device-filter, oem-unattended-id or rd.kiwi.oem.maxdisk + from the cmdline and just continues the installation on the given + device. However, the device must exist and must be a block special. + +.. note:: Non interactive mode activated by rd.kiwi.oem.installdevice + + When setting rd.kiwi.oem.installdevice explicitly on the + kernel commandline, {kiwi} will not ask for confirmation + of the device and just use it ! + ``rd.live.overlay.size`` Tells a live ISO image the size for the `tmpfs` filesystem that is used for the `overlayfs` mount process. If the write area of the overlayfs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/doc/source/conf.py new/kiwi-9.25.19/doc/source/conf.py --- old/kiwi-9.25.17/doc/source/conf.py 2023-10-17 09:30:49.000000000 +0200 +++ new/kiwi-9.25.19/doc/source/conf.py 2023-11-28 08:54:36.000000000 +0100 @@ -139,7 +139,7 @@ # built documents. # # The short X.Y version. -version = '9.25.17' +version = '9.25.19' # The full version, including alpha/beta/rc tags. release = version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/doc/source/overview/workflow.rst new/kiwi-9.25.19/doc/source/overview/workflow.rst --- old/kiwi-9.25.17/doc/source/overview/workflow.rst 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/doc/source/overview/workflow.rst 2023-11-28 08:50:30.000000000 +0100 @@ -63,7 +63,7 @@ #. ``config.sh`` shell script - Is the configuration shell script that runs and the end of the + Is the configuration shell script that runs at the end of the :ref:`prepare step <prepare-step>` if present. It can be used to fine tune the unpacked image. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh new/kiwi-9.25.19/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh --- old/kiwi-9.25.17/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/dracut/modules.d/90kiwi-dump/kiwi-dump-image.sh 2023-11-28 08:50:30.000000000 +0100 @@ -20,6 +20,8 @@ declare kiwi_oemmultipath_scan=${kiwi_oemmultipath_scan} declare kiwi_devicepersistency=${kiwi_devicepersistency} declare kiwi_install_volid=${kiwi_install_volid} + declare kiwi_oemunattended=${kiwi_oemunattended} + declare kiwi_oemunattended_id=${kiwi_oemunattended_id} local disk_id="by-id" local disk_size local disk_device @@ -38,6 +40,7 @@ max_disk=0 kiwi_oemmultipath_scan=$(bool "${kiwi_oemmultipath_scan}") kiwi_oem_maxdisk=$(getarg rd.kiwi.oem.maxdisk=) + kiwi_oem_installdevice=$(getarg rd.kiwi.oem.installdevice=) if [ -n "${kiwi_oem_maxdisk}" ]; then max_disk=$(binsize_to_bytesize "${kiwi_oem_maxdisk}") || max_disk=0 fi @@ -107,6 +110,39 @@ fi list_items="${list_items} ${disk_device} ${disk_size}" done + if [ -n "${kiwi_oem_installdevice}" ];then + # install device overwritten by cmdline. + local device=${kiwi_oem_installdevice} + local device_meta + local device_size + if [ ! -e "${device}" ];then + local no_dev="Given device ${device} does not exist" + report_and_quit "${no_dev}" + fi + if [ ! -b "${device}" ];then + local no_block_dev="Given device ${device} is not a block special" + report_and_quit "${no_block_dev}" + fi + device_meta=$( + eval lsblk "${blk_opts}" "${device}" |\ + grep -E "disk|raid" | tr ' ' ":" + ) + device_size=$(echo "${device_meta}" | cut -f2 -d:) + list_items="${device} ${device_size}" + # activate unattended mode. In case a user explicitly + # provides the device name to deploy the image to via + # the kernel commandline, no further questions if this + # is wanted should appear + message="rd.kiwi.oem.installdevice set via cmdline to: ${device}" + message="${message} The following OEM device settings will be ignored:" + message="${message} oem-unattended," + message="${message} oem-unattended-id," + message="${message} oem-device-filter" + export kiwi_oemunattended="true" + export kiwi_oemunattended_id="" + export kiwi_oemdevicefilter="" + info "${message}" >&2 + fi if [ -z "${list_items}" ];then local no_device_text="No device(s) for installation found" report_and_quit "${no_device_text}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/kiwi-live-lib.sh new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/kiwi-live-lib.sh --- old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/kiwi-live-lib.sh 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/kiwi-live-lib.sh 2023-11-08 16:20:56.000000000 +0100 @@ -116,6 +116,7 @@ function mountCompressedContainerFromIso { local iso_mount_point=$1 local overlay_base + local squashfs_container overlay_base=$(getOverlayBaseDirectory) local container_mount_point="${overlay_base}/squashfs_container" squashfs_container="${iso_mount_point}/${live_dir}/${squash_image}" @@ -205,8 +206,14 @@ if ! mount -L cow "${overlay_mount_point}"; then partitions_before_cow_part=$(_partition_count) echo -e "n\np\n\n\n\nw\nq" | fdisk "${isodiskdev}" - if ! partprobe "${isodiskdev}"; then - return 1 + if type partprobe &> /dev/null;then + if ! partprobe "${isodiskdev}"; then + return 1 + fi + else + if ! partx -u "${isodiskdev}"; then + return 1 + fi fi if [ "$(_partition_count)" -le "${partitions_before_cow_part}" ];then return 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/kiwi-live-root.sh new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/kiwi-live-root.sh --- old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/kiwi-live-root.sh 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/kiwi-live-root.sh 2023-11-08 16:20:56.000000000 +0100 @@ -20,17 +20,6 @@ # live options and their default values initGlobalOptions -# mount ISO device -iso_mount_point=$(mountIso) - -# mount squashfs compressed container -container_mount_point=$( - mountCompressedContainerFromIso "${iso_mount_point}" -) - -# mount readonly root filesystem from container -mountReadOnlyRootImageFromContainer "${container_mount_point}" - # prepare overlay for generated systemd LiveOS_rootfs service declare isodiskdev=${isodiskdev} if getargbool 0 rd.live.overlay.persistent && [ -n "${isodiskdev}" ]; then @@ -43,6 +32,17 @@ prepareTemporaryOverlay fi +# mount ISO device +iso_mount_point=$(mountIso) + +# mount squashfs compressed container +container_mount_point=$( + mountCompressedContainerFromIso "${iso_mount_point}" +) + +# mount readonly root filesystem from container +mountReadOnlyRootImageFromContainer "${container_mount_point}" + need_shutdown exit 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/module-setup.sh new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/module-setup.sh --- old/kiwi-9.25.17/dracut/modules.d/90kiwi-live/module-setup.sh 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/dracut/modules.d/90kiwi-live/module-setup.sh 2023-11-08 16:20:56.000000000 +0100 @@ -27,7 +27,7 @@ local dmsquashdir= inst_multiple -o checkmedia inst_multiple \ - umount dmsetup blockdev blkid lsblk dd losetup \ + umount dmsetup partx blkid lsblk dd losetup \ grep cut partprobe find wc fdisk tail mkfs.ext4 mkfs.xfs \ dialog cat mountpoint diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/99kiwi-lib/kiwi-partitions-lib.sh new/kiwi-9.25.19/dracut/modules.d/99kiwi-lib/kiwi-partitions-lib.sh --- old/kiwi-9.25.17/dracut/modules.d/99kiwi-lib/kiwi-partitions-lib.sh 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/dracut/modules.d/99kiwi-lib/kiwi-partitions-lib.sh 2023-11-08 16:20:56.000000000 +0100 @@ -25,7 +25,7 @@ if type partprobe &> /dev/null;then partprobe "${disk_device}" else - blockdev --rereadpt "${disk_device}" + partx -u "${disk_device}" fi } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/dracut/modules.d/99kiwi-lib/module-setup.sh new/kiwi-9.25.19/dracut/modules.d/99kiwi-lib/module-setup.sh --- old/kiwi-9.25.17/dracut/modules.d/99kiwi-lib/module-setup.sh 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/dracut/modules.d/99kiwi-lib/module-setup.sh 2023-11-08 16:20:56.000000000 +0100 @@ -15,7 +15,7 @@ install() { declare moddir=${moddir} inst_multiple \ - blkid blockdev dd mkdir rmdir \ + blkid partx blockdev dd mkdir rmdir \ grep cut tail head tr bc true false mountpoint \ basename partprobe sfdisk sgdisk mkswap readlink lsblk \ btrfs xfs_growfs resize2fs \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/bootloader/config/bootloader_spec_base.py new/kiwi-9.25.19/kiwi/bootloader/config/bootloader_spec_base.py --- old/kiwi-9.25.17/kiwi/bootloader/config/bootloader_spec_base.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/bootloader/config/bootloader_spec_base.py 2023-11-08 16:29:38.000000000 +0100 @@ -108,7 +108,6 @@ ] ) self.setup_loader(self.target.disk) - self.set_loader_entry(self.target.disk) def setup_install_image_config( self, mbrid: str, hypervisor: str = '', @@ -124,12 +123,12 @@ Targeted to bootloader spec interface """ - self._setup_iso_image_config(mbrid, 'install(iso)', kernel, initrd) + pass def setup_live_image_config( self, mbrid: str, hypervisor: str = '', kernel: str = '', initrd: str = '' - ): + ) -> None: """ Create boot config file to boot live ISO image @@ -140,9 +139,11 @@ Targeted to bootloader spec interface """ - self._setup_iso_image_config(mbrid, 'live(iso)', kernel, initrd) + pass - def setup_disk_boot_images(self, boot_uuid: str, lookup_path: str = ''): + def setup_disk_boot_images( + self, boot_uuid: str, lookup_path: str = '' + ) -> None: """ Create bootloader image(s) for disk boot @@ -153,7 +154,9 @@ """ self.create_loader_image(self.target.disk) - def setup_install_boot_images(self, mbrid: str, lookup_path: str = ''): + def setup_install_boot_images( + self, mbrid: str, lookup_path: str = '' + ) -> None: """ Create bootloader image(s) for install ISO boot @@ -164,7 +167,9 @@ """ self.create_loader_image(self.target.install) - def setup_live_boot_images(self, mbrid: str, lookup_path: str = ''): + def setup_live_boot_images( + self, mbrid: str, lookup_path: str = '' + ) -> None: """ Create bootloader image(s) for live ISO boot @@ -201,23 +206,15 @@ """ raise NotImplementedError - def set_loader_entry(self, target: str) -> None: + def set_loader_entry(self, root_dir: str, target: str) -> None: """ Setup bootloader menu entry boot/loader/entries/X.conf + :param str root_dir: + path to root directory tree :param str target: target identifier, one of disk, live(iso) or install(iso) Implementation in specialized loader class """ raise NotImplementedError - - def _setup_iso_image_config( - self, mbrid: str, target: str, kernel: str = '', initrd: str = '' - ): - self.custom_args['mbrid'] = mbrid - self.custom_args['kernel'] = kernel - self.custom_args['initrd'] = initrd - - self.setup_loader(target) - self.set_loader_entry(target) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/bootloader/config/grub2.py new/kiwi-9.25.19/kiwi/bootloader/config/grub2.py --- old/kiwi-9.25.17/kiwi/bootloader/config/grub2.py 2023-09-22 16:02:01.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/bootloader/config/grub2.py 2023-11-11 13:04:41.000000000 +0100 @@ -43,6 +43,8 @@ KiwiDiskGeometryError ) +import kiwi.defaults as defaults + log = logging.getLogger('kiwi') @@ -891,7 +893,7 @@ uuid, mbrid, lookup_path ) - def _setup_bios_image(self, mbrid=None, lookup_path=None): + def _setup_bios_image(self, mbrid, lookup_path=None): """ Provide bios grub image """ @@ -929,7 +931,8 @@ Must be called after setup_install_boot_images and write. """ fat_image_mbsize = int( - self.xml_state.build_type.get_efifatimagesize() or 20 + self.xml_state.build_type + .get_efifatimagesize() or defaults.EFI_FAT_IMAGE_SIZE ) Command.run( ['qemu-img', 'create', path, f'{fat_image_mbsize}M'] @@ -1017,7 +1020,7 @@ efi_boot_config, mbrid ) - def _create_bios_image(self, mbrid=None, lookup_path=None): + def _create_bios_image(self, mbrid, lookup_path=None): early_boot_script = os.path.normpath( os.sep.join([self._get_grub2_boot_path(), 'earlyboot.cfg']) ) @@ -1113,11 +1116,15 @@ early_boot.write( 'set btrfs_relative_path="yes"{0}'.format(os.linesep) ) - early_boot.write( - 'search --file --set=root /boot/mbrid{0}'.format( - os.linesep + if mbrid: + early_boot.write( + f'search --file --set=root /boot/{mbrid.get_id()}{os.linesep}' + ) + else: + # Fallback search for /boot/mbrid + early_boot.write( + f'search --file --set=root /boot/mbrid{os.linesep}' ) - ) early_boot.write( 'set prefix=($root)/boot/{0}{1}'.format( self.boot_directory_name, os.linesep @@ -1459,19 +1466,24 @@ ) for menu_entry_file in glob.iglob(loader_entries_pattern): with open(menu_entry_file) as grub_menu_entry_file: - menu_entry = grub_menu_entry_file.read() - if self.bootpartition: - menu_entry = re.sub( - r'(linux|initrd) .*/boot(.*)', - r'\1 \2', - menu_entry - ) - else: - menu_entry = re.sub( - r'(linux|initrd) .*(/boot.*)', - r'\1 \2', - menu_entry - ) + menu_entry = grub_menu_entry_file.read().split(os.linesep) + + for line_number, menu_entry_line in enumerate(menu_entry): + if bool(re.match(r'^(linux|initrd) .*', menu_entry_line)): + + log.debug(f'Existing loader entry: {menu_entry_line}') + config_path = menu_entry_line.split(' ', 1)[0] + + basename = os.path.basename(menu_entry_line) + if self.bootpartition: + config_path = (f'{config_path} /{basename}') + else: + config_path = (f'{config_path} /boot/{basename}') + + menu_entry[line_number] = config_path + log.debug(f'Updated loader entry: {config_path}') + + menu_entry = os.linesep.join(menu_entry) with open(menu_entry_file, 'w') as grub_menu_entry_file: grub_menu_entry_file.write(menu_entry) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/bootloader/config/systemd_boot.py new/kiwi-9.25.19/kiwi/bootloader/config/systemd_boot.py --- old/kiwi-9.25.17/kiwi/bootloader/config/systemd_boot.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/bootloader/config/systemd_boot.py 2023-11-08 16:29:38.000000000 +0100 @@ -24,6 +24,9 @@ from kiwi.bootloader.template.systemd_boot import BootLoaderTemplateSystemdBoot from kiwi.bootloader.config.bootloader_spec_base import BootLoaderSpecBase from kiwi.boot.image.base import BootImageBase +from kiwi.mount_manager import MountManager +from kiwi.storage.loop_device import LoopDevice +from kiwi.storage.disk import Disk from kiwi.command import Command from kiwi.exceptions import ( @@ -31,6 +34,8 @@ KiwiBootLoaderTargetError ) +import kiwi.defaults as defaults + class BootLoaderSystemdBoot(BootLoaderSpecBase): def create_loader_image(self, target: str) -> None: @@ -48,15 +53,10 @@ def setup_loader(self, target: str) -> None: """ - Setup ESP for systemd-boot using bootctl and kernel-install + Setup ESP for systemd-boot using bootctl For disk images only, setup the ESP layout for systemd boot - using bootctl. All data will be loaded from the ESP. The - kernel-install script provided with systemd is used to - manage kernel updates and the respective loader entries. - Distributions integrating well with systemd runs kernel-install - as part of their kernel packaging. In kiwi we use kernel-install - for the initial boot setup + using bootctl. All data will be loaded from the ESP. :param str target: target identifier, one of disk, live(iso) or install(iso) @@ -73,49 +73,125 @@ boot_options.get('efi_device'), boot_options.get('system_volumes') ) + self._run_bootctl(self.root_mount.mountpoint) + self.set_loader_entry(self.root_mount.mountpoint, self.target.disk) + + def set_loader_entry(self, root_dir: str, target: str) -> None: + """ + Setup/update loader entries + + :param str target: + target identifier, one of disk, live(iso) or install(iso) + """ + BootLoaderSystemdBoot._write_config_file( + BootLoaderTemplateSystemdBoot().get_entry_template(), + root_dir + '/boot/efi/loader/entries/main.conf', + self._get_template_parameters() + ) + + def _create_embedded_fat_efi_image(self, path: str): + """ + Creates a EFI system partition image at the given path. + Installs systemd-boot required EFI layout into the image + """ + fat_image_mbsize = int( + self.xml_state.build_type + .get_efifatimagesize() or defaults.EFI_FAT_IMAGE_SIZE + ) + Command.run( + ['qemu-img', 'create', path, f'{fat_image_mbsize}M'] + ) + Command.run( + ['sgdisk', '-n', ':1.0', '-t', '1:EF00', path] + ) + loop_provider = LoopDevice(path) + loop_provider.create(overwrite=False) + disk = Disk('gpt', loop_provider) + disk.map_partitions() + disk.partitioner.partition_id = 1 + disk._add_to_map('efi') + Command.run( + ['mkdosfs', '-n', 'BOOT', disk.partition_map['efi']] + ) + Path.create(f'{self.root_dir}/boot/efi') + efi_mount = MountManager( + device=disk.partition_map['efi'], + mountpoint=f'{self.root_dir}/boot/efi' + ) + device_mount = MountManager( + device='/dev', + mountpoint=f'{self.root_dir}/dev' + ) + proc_mount = MountManager( + device='/proc', + mountpoint=f'{self.root_dir}/proc' + ) + sys_mount = MountManager( + device='/sys', + mountpoint=f'{self.root_dir}/sys' + ) + efi_mount.mount() + device_mount.bind_mount() + proc_mount.bind_mount() + sys_mount.bind_mount() + try: + self._run_bootctl(self.root_dir) + self.set_loader_entry(self.root_dir, self.target.live) + finally: + efi_mount.umount() + device_mount.umount() + proc_mount.umount() + sys_mount.umount() + Command.run( + ['dd', f'if={disk.partition_map["efi"]}', f'of={path}.img'] + ) + del disk + del loop_provider + Command.run( + ['mv', f'{path}.img', path] + ) + + def _run_bootctl(self, root_dir: str) -> None: + """ + Setup ESP for systemd-boot using bootctl + """ kernel_info = BootImageBase( - self.xml_state, - self.root_mount.mountpoint, self.root_mount.mountpoint + self.xml_state, root_dir, root_dir ).get_boot_names() Command.run( [ - 'chroot', self.root_mount.mountpoint, 'bootctl', 'install', + 'chroot', root_dir, 'bootctl', 'install', '--esp-path=/boot/efi', '--no-variables', '--entry-token', 'os-id' ] ) - Path.wipe(f'{self.root_mount.mountpoint}/boot/loader') - self._write_kernel_cmdline_file() + Path.wipe(f'{root_dir}/boot/loader') + self._write_kernel_cmdline_file(root_dir) + + # copy kernel and initrd + entry_dir = f'{root_dir}/boot/efi/loader/entries' + os_dir = f'{root_dir}/boot/efi/os' + Path.create(entry_dir) + Path.create(os_dir) + self.custom_args['kernel'] = \ + f'os/{os.path.basename(kernel_info.kernel_filename)}' + self.custom_args['initrd'] = \ + f'os/{kernel_info.initrd_name}' Command.run( - [ - 'chroot', self.root_mount.mountpoint, - 'kernel-install', 'add', kernel_info.kernel_version, - kernel_info.kernel_filename.replace( - self.root_mount.mountpoint, '' - ), - f'/boot/{kernel_info.initrd_name}' - ] + ['cp', kernel_info.kernel_filename, os_dir] ) + Command.run( + ['cp', f'{root_dir}/boot/{kernel_info.initrd_name}', os_dir] + ) + + # create loader.conf BootLoaderSystemdBoot._write_config_file( BootLoaderTemplateSystemdBoot().get_loader_template(), - self.root_mount.mountpoint + '/boot/efi/loader/loader.conf', + root_dir + '/boot/efi/loader/loader.conf', self._get_template_parameters() ) - def set_loader_entry(self, target: str) -> None: - """ - Setup/update loader entries - - loader entries for systemd-boot are expected to be managed - through kernel-install. Thus no further action needs to be - taken by kiwi - - :param str target: - target identifier, one of disk, live(iso) or install(iso) - """ - pass - def _get_template_parameters(self) -> Dict[str, str]: return { 'kernel_file': self.custom_args['kernel'] or 'vmlinuz', @@ -140,8 +216,8 @@ '{0}: {1}'.format(type(issue).__name__, issue) ) - def _write_kernel_cmdline_file(self) -> None: - kernel_cmdline = f'{self.root_mount.mountpoint}/etc/kernel/cmdline' + def _write_kernel_cmdline_file(self, root_dir: str) -> None: + kernel_cmdline = f'{root_dir}/etc/kernel/cmdline' Path.create(os.path.dirname(kernel_cmdline)) with open(kernel_cmdline, 'w') as cmdline: cmdline.write(self.cmdline) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/bootloader/template/systemd_boot.py new/kiwi-9.25.19/kiwi/bootloader/template/systemd_boot.py --- old/kiwi-9.25.17/kiwi/bootloader/template/systemd_boot.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/bootloader/template/systemd_boot.py 2023-11-08 16:29:38.000000000 +0100 @@ -28,6 +28,7 @@ self.loader = dedent(''' # kiwi generated loader config file + default main.conf console-mode max editor no ''').strip() + self.cr @@ -36,6 +37,13 @@ timeout ${boot_timeout} ''').strip() + self.cr + self.entry = dedent(''' + title ${title} + options ${boot_options} + linux ${kernel_file} + initrd ${initrd_file} + ''').strip() + self.cr + def get_loader_template(self) -> Template: """ Bootloader main configuration template @@ -47,3 +55,14 @@ template_data = self.loader template_data += self.timeout return Template(template_data) + + def get_entry_template(self) -> Template: + """ + Bootloader entry configuration template + + :return: instance of :class:`Template` + + :rtype: Template + """ + template_data = self.entry + return Template(template_data) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/builder/install.py new/kiwi-9.25.19/kiwi/builder/install.py --- old/kiwi-9.25.17/kiwi/builder/install.py 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/builder/install.py 2023-11-08 16:29:38.000000000 +0100 @@ -69,6 +69,9 @@ custom_args: Dict = None ) -> None: self.arch = Defaults.get_platform_name() + self.bootloader = xml_state.get_build_type_bootloader_name() + if self.bootloader != 'systemd_boot': + self.bootloader = 'grub2' self.root_dir = root_dir self.target_dir = target_dir self.xml_state = xml_state @@ -210,7 +213,7 @@ # for compat boot. The complete bootloader setup will be # based on grub bootloader_config = BootLoaderConfig.new( - 'grub2', self.xml_state, root_dir=self.root_dir, + self.bootloader, self.xml_state, root_dir=self.root_dir, boot_dir=self.media_dir.name, custom_args={ 'grub_directory_name': Defaults.get_grub_boot_directory_name(self.root_dir), @@ -242,13 +245,6 @@ ) bootloader_config.write() - if self.firmware.efi_mode(): - efi_loader = Temporary( - prefix='efi-loader.', path=self.target_dir - ).new_file() - bootloader_config._create_embedded_fat_efi_image(efi_loader.name) - self.custom_iso_args['meta_data']['efi_loader'] = efi_loader.name - # create initrd for install image log.info('Creating install image boot image') self._create_iso_install_kernel_and_initrd() @@ -256,6 +252,13 @@ # the system image initrd is stored to allow kexec self._copy_system_image_initrd_to_iso_image() + if self.firmware.efi_mode(): + efi_loader = Temporary( + prefix='efi-loader.', path=self.target_dir + ).new_file() + bootloader_config._create_embedded_fat_efi_image(efi_loader.name) + self.custom_iso_args['meta_data']['efi_loader'] = efi_loader.name + # create iso filesystem from media_dir log.info('Creating ISO filesystem') iso_image = FileSystemIsoFs( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/builder/live.py new/kiwi-9.25.19/kiwi/builder/live.py --- old/kiwi-9.25.17/kiwi/builder/live.py 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/builder/live.py 2023-11-08 16:29:38.000000000 +0100 @@ -41,6 +41,7 @@ from kiwi.runtime_config import RuntimeConfig from kiwi.iso_tools.base import IsoToolsBase from kiwi.xml_state import XMLState +from kiwi.command import Command from kiwi.exceptions import KiwiLiveBootImageError @@ -60,6 +61,9 @@ self, xml_state: XMLState, target_dir: str, root_dir: str, custom_args: Dict = None ): + self.bootloader = xml_state.get_build_type_bootloader_name() + if self.bootloader != 'systemd_boot': + self.bootloader = 'grub2' self.arch = Defaults.get_platform_name() self.root_dir = root_dir self.target_dir = target_dir @@ -77,7 +81,9 @@ self.live_type = Defaults.get_default_live_iso_type() self.boot_image = BootImageDracut( - xml_state, target_dir, self.root_dir + xml_state, + f'{root_dir}/boot' if self.bootloader == 'systemd_boot' else target_dir, + self.root_dir ) self.firmware = FirmWare( xml_state @@ -146,7 +152,7 @@ # for compat boot. The complete bootloader setup will be # based on grub bootloader_config = BootLoaderConfig.new( - 'grub2', self.xml_state, root_dir=self.root_dir, + self.bootloader, self.xml_state, root_dir=self.root_dir, boot_dir=self.media_dir.name, custom_args={ 'grub_directory_name': Defaults.get_grub_boot_directory_name(self.root_dir), @@ -183,13 +189,6 @@ working_directory=self.root_dir ) - if self.firmware.efi_mode(): - efi_loader = Temporary( - prefix='efi-loader.', path=self.target_dir - ).new_file() - bootloader_config._create_embedded_fat_efi_image(efi_loader.name) - custom_iso_args['meta_data']['efi_loader'] = efi_loader.name - # prepare dracut initrd call self.boot_image.prepare() @@ -210,10 +209,31 @@ config_file=self.root_dir + '/etc/dracut.conf.d/02-livecd.conf' ) self.boot_image.create_initrd(self.mbrid) + if self.bootloader == 'systemd_boot': + # make sure the initrd name follows the dracut naming conventions + boot_names = self.boot_image.get_boot_names() + if self.boot_image.initrd_filename: + Command.run( + [ + 'mv', self.boot_image.initrd_filename, + self.root_dir + ''.join( + ['/boot/', boot_names.initrd_name] + ) + ] + ) + + # create EFI FAT image + if self.firmware.efi_mode(): + efi_loader = Temporary( + prefix='efi-loader.', path=self.target_dir + ).new_file() + bootloader_config._create_embedded_fat_efi_image(efi_loader.name) + custom_iso_args['meta_data']['efi_loader'] = efi_loader.name # setup kernel file(s) and initrd in ISO boot layout - log.info('Setting up kernel file(s) and boot image in ISO boot layout') - self._setup_live_iso_kernel_and_initrd() + if self.bootloader != 'systemd_boot': + log.info('Setting up kernel file(s) and boot image in ISO boot layout') + self._setup_live_iso_kernel_and_initrd() # calculate size and decide if we need UDF if rootsize.accumulate_mbyte_file_sizes() > 4096: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/defaults.py new/kiwi-9.25.19/kiwi/defaults.py --- old/kiwi-9.25.17/kiwi/defaults.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/defaults.py 2023-11-08 16:29:38.000000000 +0100 @@ -85,6 +85,7 @@ TEMP_DIR = '/var/tmp' CUSTOM_RUNTIME_CONFIG_FILE = None PLATFORM_MACHINE = platform.machine() +EFI_FAT_IMAGE_SIZE = 20 log = logging.getLogger('kiwi') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/iso_tools/xorriso.py new/kiwi-9.25.19/kiwi/iso_tools/xorriso.py --- old/kiwi-9.25.17/kiwi/iso_tools/xorriso.py 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/iso_tools/xorriso.py 2023-11-08 16:29:38.000000000 +0100 @@ -97,20 +97,21 @@ if Defaults.is_x86_arch(self.arch): if efi_mode: - loader_file = os.sep.join( - [ - self.boot_path, 'loader', - Defaults.get_isolinux_bios_grub_loader() - ] - ) mbr_file = os.sep.join( [self.source_dir, self.boot_path, '/loader/boot_hybrid.img'] ) - self.iso_loaders += [ - '-boot_image', 'grub', 'bin_path={0}'.format(loader_file), - '-boot_image', 'grub', 'grub2_mbr={0}'.format(mbr_file), - '-boot_image', 'grub', 'grub2_boot_info=on' - ] + if os.path.exists(mbr_file): + loader_file = os.sep.join( + [ + self.boot_path, 'loader', + Defaults.get_isolinux_bios_grub_loader() + ] + ) + self.iso_loaders += [ + '-boot_image', 'grub', 'bin_path={0}'.format(loader_file), + '-boot_image', 'grub', 'grub2_mbr={0}'.format(mbr_file), + '-boot_image', 'grub', 'grub2_boot_info=on' + ] else: loader_file = self.boot_path + '/loader/isolinux.bin' mbr_file_c = Path.which( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/markup/any.py new/kiwi-9.25.19/kiwi/markup/any.py --- old/kiwi-9.25.17/kiwi/markup/any.py 2023-09-13 12:16:26.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/markup/any.py 2023-11-08 16:19:12.000000000 +0100 @@ -70,6 +70,25 @@ self.description_markup_processed.name ) + def get_toml_description(self) -> str: + """ + Return TOML description file name + + :return: file path name + + :rtype: str + """ + xml_description_xslt_transformed = self.apply_xslt_stylesheets( + self.description_markup_processed.name + ) + markup = self.anymarkup.parse_file( + xml_description_xslt_transformed, force_types=None + ) + self.anymarkup.serialize_file( + markup, xml_description_xslt_transformed, format='toml' + ) + return xml_description_xslt_transformed + def get_yaml_description(self) -> str: """ Return YAML description file name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/runtime_checker.py new/kiwi-9.25.19/kiwi/runtime_checker.py --- old/kiwi-9.25.17/kiwi/runtime_checker.py 2023-07-17 11:46:19.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/runtime_checker.py 2023-11-08 16:29:38.000000000 +0100 @@ -40,6 +40,8 @@ KiwiRuntimeError ) +import kiwi.defaults as defaults + dracut_module_type = NamedTuple( 'dracut_module_type', [ ('package', str), @@ -1042,6 +1044,26 @@ ) ) + def check_efi_fat_image_has_correct_size(self) -> None: + """ + Verify that the efifatimagesize does not exceed the max + El Torito load size of 65535 * 512 bytes + """ + message = dedent('''\n + El Torito max load size exceeded + + The configured efifatimagesize of '{0}MB' exceeds + the El Torito max load size of 65535 * 512 bytes (~31MB). + ''') + fat_image_mbsize = int( + self.xml_state.build_type + .get_efifatimagesize() or defaults.EFI_FAT_IMAGE_SIZE + ) + if fat_image_mbsize > 31: + raise KiwiRuntimeError( + message.format(fat_image_mbsize) + ) + @staticmethod def _get_dracut_module_version_from_pdb( package_manager: str, package_name: str, root_dir: str diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/tasks/base.py new/kiwi-9.25.19/kiwi/tasks/base.py --- old/kiwi-9.25.17/kiwi/tasks/base.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/tasks/base.py 2023-11-08 16:29:38.000000000 +0100 @@ -93,7 +93,8 @@ 'check_image_type_unique': [], 'check_include_references_unresolvable': [], 'check_luksformat_options_valid': [], - 'check_partuuid_persistency_type_used_with_mbr': [] + 'check_partuuid_persistency_type_used_with_mbr': [], + 'check_efi_fat_image_has_correct_size': [] } self.checks_after_command_args: Dict[str, List[str]] = { 'check_repositories_configured': [], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/tasks/image_info.py new/kiwi-9.25.19/kiwi/tasks/image_info.py --- old/kiwi-9.25.17/kiwi/tasks/image_info.py 2023-09-13 12:16:26.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/tasks/image_info.py 2023-11-08 16:19:12.000000000 +0100 @@ -21,7 +21,7 @@ [--resolve-package-list] [--ignore-repos] [--add-repo=<source,type,alias,priority>...] - [--print-xml|--print-yaml] + [--print-xml|--print-yaml|--print-toml] kiwi-ng image info help commands: @@ -40,7 +40,7 @@ solve package dependencies and return a list of all packages including their attributes e.g size, shasum, etc... - --print-xml|--print-yaml + --print-xml|--print-yaml|--print-toml print image description in specified format """ import os @@ -141,6 +141,11 @@ self.description.markup.get_yaml_description(), 'Description(YAML):' ) + elif self.command_args['--print-toml']: + DataOutput.display_file( + self.description.markup.get_toml_description(), + 'Description(TOML):' + ) def _setup_solver(self): solver = Sat() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi/version.py new/kiwi-9.25.19/kiwi/version.py --- old/kiwi-9.25.17/kiwi/version.py 2023-10-17 09:30:49.000000000 +0200 +++ new/kiwi-9.25.19/kiwi/version.py 2023-12-08 09:25:22.000000000 +0100 @@ -18,5 +18,5 @@ """ Global version information used in kiwi and the package """ -__version__ = '9.25.17' -__githash__ = '232b691374d8e713012113bef37632f404e209ed' +__version__ = '9.25.19' +__githash__ = 'ef2720b8264206451b96ab64292daf4bbb8b6e3d' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/kiwi.egg-info/PKG-INFO new/kiwi-9.25.19/kiwi.egg-info/PKG-INFO --- old/kiwi-9.25.17/kiwi.egg-info/PKG-INFO 2023-10-17 09:35:16.000000000 +0200 +++ new/kiwi-9.25.19/kiwi.egg-info/PKG-INFO 2023-12-08 11:57:52.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: kiwi -Version: 9.25.17 +Version: 9.25.19 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.25.17/kiwi.yml new/kiwi-9.25.19/kiwi.yml --- old/kiwi-9.25.17/kiwi.yml 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/kiwi.yml 2023-11-08 16:29:38.000000000 +0100 @@ -157,3 +157,6 @@ # # check devicepersistency compatible with partition table type # - check_partuuid_persistency_type_used_with_mbr + +# # check efifatimagesize does not exceed the max El Torito load size +# - check_efi_fat_image_has_correct_size Binary files old/kiwi-9.25.17/test/unit/.coverage and new/kiwi-9.25.19/test/unit/.coverage differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/bootloader/config/bootloader_spec_base_test.py new/kiwi-9.25.19/test/unit/bootloader/config/bootloader_spec_base_test.py --- old/kiwi-9.25.17/test/unit/bootloader/config/bootloader_spec_base_test.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/bootloader/config/bootloader_spec_base_test.py 2023-11-08 16:29:38.000000000 +0100 @@ -32,10 +32,7 @@ self.setup() @patch.object(BootLoaderSpecBase, 'setup_loader') - @patch.object(BootLoaderSpecBase, 'set_loader_entry') - def test_setup_disk_image_config( - self, mock_setup_loader, mock_set_loader_entry - ): + def test_setup_disk_image_config(self, mock_setup_loader): self.bootloader.get_boot_cmdline = Mock(return_value='') self.bootloader.setup_disk_image_config( 'boot_uuid', 'root_uuid', 'hypervisor', @@ -44,29 +41,18 @@ } ) mock_setup_loader.assert_called_once_with('disk') - mock_set_loader_entry.assert_called_once_with('disk') - @patch.object(BootLoaderSpecBase, 'setup_loader') - @patch.object(BootLoaderSpecBase, 'set_loader_entry') - def test_setup_install_image_config( - self, mock_setup_loader, mock_set_loader_entry - ): + def test_setup_install_image_config(self): + # just pass self.bootloader.setup_install_image_config( 'mbrid', 'hypervisor', 'kernel', 'initrd' ) - mock_setup_loader.assert_called_once_with('install(iso)') - mock_set_loader_entry.assert_called_once_with('install(iso)') - @patch.object(BootLoaderSpecBase, 'setup_loader') - @patch.object(BootLoaderSpecBase, 'set_loader_entry') - def test_setup_live_image_config( - self, mock_setup_loader, mock_set_loader_entry - ): + def test_setup_live_image_config(self): + # just pass self.bootloader.setup_live_image_config( 'mbrid', 'hypervisor', 'kernel', 'initrd' ) - mock_setup_loader.assert_called_once_with('live(iso)') - mock_set_loader_entry.assert_called_once_with('live(iso)') @patch.object(BootLoaderSpecBase, 'create_loader_image') def test_setup_disk_boot_images(self, mock_create_loader_image): @@ -89,7 +75,7 @@ def test_set_loader_entry(self): with raises(NotImplementedError): - self.bootloader.set_loader_entry('target') + self.bootloader.set_loader_entry('root_dir', 'target') def test_create_loader_image(self): with raises(NotImplementedError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/bootloader/config/grub2_test.py new/kiwi-9.25.19/test/unit/bootloader/config/grub2_test.py --- old/kiwi-9.25.17/test/unit/bootloader/config/grub2_test.py 2023-09-22 16:02:01.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/bootloader/config/grub2_test.py 2023-11-11 13:04:41.000000000 +0100 @@ -1758,11 +1758,11 @@ ] assert file_handle.write.call_args_list == [ call('set btrfs_relative_path="yes"\n'), - call('search --file --set=root /boot/mbrid\n'), + call('search --file --set=root /boot/0xffffffff\n'), call('set prefix=($root)/boot/grub2\n'), call('source ($root)/boot/grub2/grub.cfg\n'), call('set btrfs_relative_path="yes"\n'), - call('search --file --set=root /boot/mbrid\n'), + call('search --file --set=root /boot/0xffffffff\n'), call('set prefix=($root)/boot/grub2\n'), call('source ($root)/boot/grub2/grub.cfg\n'), call('source /boot/grub2/grub.cfg\n') @@ -1871,7 +1871,7 @@ assert file_handle.write.call_args_list == [ call('set btrfs_relative_path="yes"\n'), - call('search --file --set=root /boot/mbrid\n'), + call('search --file --set=root /boot/0xffffffff\n'), call('set prefix=($root)/boot/grub2\n'), call('source ($root)/boot/grub2/grub.cfg\n'), call('source /boot/grub2/grub.cfg\n') @@ -1902,6 +1902,19 @@ ) ] + with patch('builtins.open', create=True) as mock_open: + # Test fallback search for earlyboot if UUID and MBR ID are missing + mock_open.return_value = MagicMock(spec=io.IOBase) + file_handle = mock_open.return_value.__enter__.return_value + self.bootloader._setup_efi_image(uuid=None, mbrid=None) + + assert file_handle.write.call_args_list == [ + call('set btrfs_relative_path="yes"\n'), + call('search --file --set=root /boot/mbrid\n'), + call('set prefix=($root)/boot/grub2\n'), + call('source ($root)/boot/grub2/grub.cfg\n'), + ] + @patch.object(BootLoaderConfigGrub2, '_supports_bios_modules') @patch('kiwi.bootloader.config.grub2.Command.run') @patch('os.path.exists') @@ -1941,7 +1954,7 @@ ) assert file_handle.write.call_args_list == [ call('set btrfs_relative_path="yes"\n'), - call('search --file --set=root /boot/mbrid\n'), + call('search --file --set=root /boot/0xffffffff\n'), call('set prefix=($root)/boot/grub2\n'), call('source ($root)/boot/grub2/grub.cfg\n'), call('source /boot/grub2/grub.cfg\n') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/bootloader/config/systemd_boot_test.py new/kiwi-9.25.19/test/unit/bootloader/config/systemd_boot_test.py --- old/kiwi-9.25.17/test/unit/bootloader/config/systemd_boot_test.py 2023-08-03 12:31:11.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/bootloader/config/systemd_boot_test.py 2023-11-08 16:29:38.000000000 +0100 @@ -16,6 +16,7 @@ self.state = Mock() self.state.xml_data.get_name.return_value = 'image-name' self.state.get_image_version.return_value = 'image-version' + self.state.build_type.get_efifatimagesize.return_value = None self.bootloader = BootLoaderSystemdBoot(self.state, 'root_dir') self.bootloader.custom_args['kernel'] = None self.bootloader.custom_args['initrd'] = None @@ -42,6 +43,7 @@ @patch('os.path.exists') @patch('kiwi.bootloader.config.systemd_boot.BootImageBase.get_boot_names') @patch('kiwi.bootloader.config.systemd_boot.Path.wipe') + @patch('kiwi.bootloader.config.systemd_boot.Path.create') @patch('kiwi.bootloader.config.systemd_boot.Command.run') @patch('kiwi.bootloader.config.systemd_boot.BootLoaderTemplateSystemdBoot') @patch.object(BootLoaderSystemdBoot, '_write_config_file') @@ -51,7 +53,7 @@ self, mock_write_kernel_cmdline_file, mock_get_template_parameters, mock_write_config_file, mock_BootLoaderTemplateSystemdBoot, mock_Command_run, - mock_Path_wipe, mock_BootImageBase_get_boot_names, + mock_Path_create, mock_Path_wipe, mock_BootImageBase_get_boot_names, mock_os_path_exists ): kernel_info = Mock() @@ -61,17 +63,28 @@ mock_os_path_exists.return_value = True mock_BootImageBase_get_boot_names.return_value = kernel_info self.bootloader.setup_loader('disk') - mock_write_config_file.assert_called_once_with( - mock_BootLoaderTemplateSystemdBoot.return_value.get_loader_template.return_value, - 'system_root_mount/boot/efi/loader/loader.conf', - mock_get_template_parameters.return_value - ) + assert mock_write_config_file.call_args_list == [ + call( + mock_BootLoaderTemplateSystemdBoot.return_value.get_loader_template.return_value, + 'system_root_mount/boot/efi/loader/loader.conf', + mock_get_template_parameters.return_value + ), + call( + mock_BootLoaderTemplateSystemdBoot.return_value.get_entry_template.return_value, + 'system_root_mount/boot/efi/loader/entries/main.conf', + mock_get_template_parameters.return_value + ) + ] + assert self.bootloader._mount_system.called - mock_write_kernel_cmdline_file.assert_called_once_with() + mock_write_kernel_cmdline_file.assert_called_once_with( + 'system_root_mount' + ) assert mock_Command_run.call_args_list == [ call( [ - 'chroot', 'system_root_mount', 'bootctl', 'install', + 'chroot', 'system_root_mount', + 'bootctl', 'install', '--esp-path=/boot/efi', '--no-variables', '--entry-token', 'os-id' @@ -79,16 +92,21 @@ ), call( [ - 'chroot', 'system_root_mount', 'kernel-install', 'add', - 'kernel-version', 'kernel-filename', - '/boot/initrd-name' + 'cp', 'kernel-filename', + 'system_root_mount/boot/efi/os' + ] + ), + call( + [ + 'cp', 'system_root_mount/boot/initrd-name', + 'system_root_mount/boot/efi/os' ] ) ] - def test_set_loader_entry(self): - # just pass - self.bootloader.set_loader_entry('disk') + @patch.object(BootLoaderSystemdBoot, '_write_config_file') + def test_set_loader_entry(self, mock_write_config_file): + self.bootloader.set_loader_entry('root_dir', 'disk') def test_create_loader_image(self): self.bootloader.create_loader_image('disk') @@ -127,8 +145,43 @@ with patch('builtins.open', create=True) as mock_open: mock_open.return_value = MagicMock(spec=io.IOBase) file_handle = mock_open.return_value.__enter__.return_value - self.bootloader._write_kernel_cmdline_file() + self.bootloader._write_kernel_cmdline_file('system_root_mount') mock_open.assert_called_once_with( 'system_root_mount/etc/kernel/cmdline', 'w' ) file_handle.write.assert_called_once_with(self.bootloader.cmdline) + + @patch('kiwi.bootloader.config.systemd_boot.Path.create') + @patch('kiwi.bootloader.config.systemd_boot.Command.run') + @patch('kiwi.bootloader.config.systemd_boot.LoopDevice') + @patch('kiwi.bootloader.config.systemd_boot.Disk') + @patch('kiwi.bootloader.config.systemd_boot.MountManager') + @patch.object(BootLoaderSystemdBoot, '_run_bootctl') + @patch.object(BootLoaderSystemdBoot, 'set_loader_entry') + def test_create_embedded_fat_efi_image( + self, mock_set_loader_entry, mock_run_bootctl, mock_MountManager, + mock_Disk, mock_LoopDevice, mock_Command_run, mock_Path_create + ): + target = Mock() + self.bootloader.target = target + mock_Disk.return_value.partition_map = { + 'efi': 'efi_device' + } + self.bootloader._create_embedded_fat_efi_image('ESP') + assert mock_MountManager.call_args_list == [ + call(device='efi_device', mountpoint='root_dir/boot/efi'), + call(device='/dev', mountpoint='root_dir/dev'), + call(device='/proc', mountpoint='root_dir/proc'), + call(device='/sys', mountpoint='root_dir/sys') + ] + assert mock_Command_run.call_args_list == [ + call(['qemu-img', 'create', 'ESP', '20M']), + call(['sgdisk', '-n', ':1.0', '-t', '1:EF00', 'ESP']), + call( + ['mkdosfs', '-n', 'BOOT', 'efi_device'] + ), + call(['dd', 'if=efi_device', 'of=ESP.img']), + call(['mv', 'ESP.img', 'ESP']) + ] + mock_run_bootctl.assert_called_once_with('root_dir') + mock_set_loader_entry.assert_called_once_with('root_dir', target.live) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/builder/live_test.py new/kiwi-9.25.19/test/unit/builder/live_test.py --- old/kiwi-9.25.17/test/unit/builder/live_test.py 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/builder/live_test.py 2023-11-08 16:29:38.000000000 +0100 @@ -133,6 +133,7 @@ ) assert live_image.arch == 'ix86' + @patch('kiwi.builder.live.Command.run') @patch('kiwi.builder.live.DeviceProvider') @patch('kiwi.builder.live.IsoToolsBase.setup_media_loader_directory') @patch('kiwi.builder.live.Temporary') @@ -145,7 +146,42 @@ @patch('kiwi.builder.live.Defaults.get_grub_boot_directory_name') @patch('os.path.exists') @patch('os.chmod') - def test_create_overlay_structure( + def test_create_overlay_structure_boot_on_systemd_boot( + self, mock_chmod, mock_exists, mock_grub_dir, mock_size, + mock_filesystem, mock_isofs, mock_Iso, mock_tag, mock_shutil, + mock_Temporary, mock_setup_media_loader_directory, mock_DeviceProvider, + mock_Command_run + ): + boot_names = Mock() + boot_names.initrd_name = 'dracut_initrd_name' + self.live_image.boot_image.get_boot_names.return_value = boot_names + self.live_image.boot_image.initrd_filename = 'kiwi_used_initrd_name' + self.live_image.bootloader = 'systemd_boot' + + rootsize = Mock() + rootsize.accumulate_mbyte_file_sizes = Mock( + return_value=8192 + ) + mock_size.return_value = rootsize + + self.live_image.create() + mock_Command_run.assert_called_once_with( + ['mv', 'kiwi_used_initrd_name', 'root_dir/boot/dracut_initrd_name'] + ) + + @patch('kiwi.builder.live.DeviceProvider') + @patch('kiwi.builder.live.IsoToolsBase.setup_media_loader_directory') + @patch('kiwi.builder.live.Temporary') + @patch('kiwi.builder.live.shutil') + @patch('kiwi.builder.live.Iso.set_media_tag') + @patch('kiwi.builder.live.Iso') + @patch('kiwi.builder.live.FileSystemIsoFs') + @patch('kiwi.builder.live.FileSystem.new') + @patch('kiwi.builder.live.SystemSize') + @patch('kiwi.builder.live.Defaults.get_grub_boot_directory_name') + @patch('os.path.exists') + @patch('os.chmod') + def test_create_overlay_structure_boot_on_grub( self, mock_chmod, mock_exists, mock_grub_dir, mock_size, mock_filesystem, mock_isofs, mock_Iso, mock_tag, mock_shutil, mock_Temporary, mock_setup_media_loader_directory, mock_DeviceProvider diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/iso_tools/xorriso_test.py new/kiwi-9.25.19/test/unit/iso_tools/xorriso_test.py --- old/kiwi-9.25.17/test/unit/iso_tools/xorriso_test.py 2023-09-13 12:16:33.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/iso_tools/xorriso_test.py 2023-11-08 16:29:38.000000000 +0100 @@ -81,7 +81,9 @@ '-boot_image', 'any', 'load_size=2048' ] - def test_init_iso_creation_parameters_efi(self): + @patch('os.path.exists') + def test_init_iso_creation_parameters_efi(self, mock_os_path_exists): + mock_os_path_exists.return_value = True self.iso_tool.init_iso_creation_parameters( { 'mbr_id': 'app_id', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/markup/any_test.py new/kiwi-9.25.19/test/unit/markup/any_test.py --- old/kiwi-9.25.17/test/unit/markup/any_test.py 2023-09-13 12:16:26.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/markup/any_test.py 2023-11-08 16:19:12.000000000 +0100 @@ -33,3 +33,6 @@ def test_get_yaml_description(self): assert 'xslt-' in self.markup.get_yaml_description() + + def test_get_toml_description(self): + assert 'xslt-' in self.markup.get_toml_description() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/runtime_checker_test.py new/kiwi-9.25.19/test/unit/runtime_checker_test.py --- old/kiwi-9.25.17/test/unit/runtime_checker_test.py 2022-12-20 15:07:52.000000000 +0100 +++ new/kiwi-9.25.19/test/unit/runtime_checker_test.py 2023-11-08 16:29:38.000000000 +0100 @@ -312,6 +312,13 @@ with raises(KiwiRuntimeError): self.runtime_checker.check_xen_uniquely_setup_as_server_or_guest() + def test_check_efi_fat_image_has_correct_size(self): + self.xml_state.build_type.get_efifatimagesize = Mock( + return_value='200' + ) + with raises(KiwiRuntimeError): + self.runtime_checker.check_efi_fat_image_has_correct_size() + def test_check_xen_uniquely_setup_as_server_or_guest_for_xen(self): self.xml_state.build_type.get_firmware = Mock( return_value=None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kiwi-9.25.17/test/unit/tasks/image_info_test.py new/kiwi-9.25.19/test/unit/tasks/image_info_test.py --- old/kiwi-9.25.17/test/unit/tasks/image_info_test.py 2023-09-13 12:16:26.000000000 +0200 +++ new/kiwi-9.25.19/test/unit/tasks/image_info_test.py 2023-11-08 16:19:12.000000000 +0100 @@ -94,6 +94,7 @@ self.task.command_args['--resolve-package-list'] = False self.task.command_args['--print-xml'] = False self.task.command_args['--print-yaml'] = False + self.task.command_args['--print-toml'] = False @patch('kiwi.tasks.image_info.DataOutput') def test_process_image_info(self, mock_out): @@ -203,3 +204,12 @@ tmpfile, message = mock_out.display_file.call_args.args assert tmpfile.startswith('/var/tmp/kiwi_xslt-') assert message == 'Description(YAML):' + + @patch('kiwi.tasks.image_info.DataOutput') + def test_process_image_info_print_toml(self, mock_out): + self._init_command_args() + self.task.command_args['--print-toml'] = True + self.task.process() + tmpfile, message = mock_out.display_file.call_args.args + assert tmpfile.startswith('/var/tmp/kiwi_xslt-') + assert message == 'Description(TOML):'
