From 1f0f01d564405542aee442fd562d1011e065c7373bd52e28ad5c800565f30fb5 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 17 Nov 2023 20:29:31 +0000 Subject: [PATCH 1/2] Accepting request 1125848 from home:flonnegren:branches:openSUSE:Factory Update changelog to include versions 15.1, 16, 17, 17.1 Remove python_subpackages to fix Provides. OBS-URL: https://build.opensuse.org/request/show/1125848 OBS-URL: https://build.opensuse.org/package/show/Virtualization/mkosi?expand=0&rev=16 --- mkosi-14.tar.gz | 3 - mkosi-18.tar.gz | 3 + mkosi.changes | 225 ++++++++++++++++++++++++++++++++++++++++++++++++ mkosi.spec | 38 +++++--- 4 files changed, 252 insertions(+), 17 deletions(-) delete mode 100644 mkosi-14.tar.gz create mode 100644 mkosi-18.tar.gz diff --git a/mkosi-14.tar.gz b/mkosi-14.tar.gz deleted file mode 100644 index 5d43ff4..0000000 --- a/mkosi-14.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:42f3447206e68a3ec07542fa4a71d2d67a4e498c3301c6cf804a42b209d6e1ae -size 176006 diff --git a/mkosi-18.tar.gz b/mkosi-18.tar.gz new file mode 100644 index 0000000..73547e5 --- /dev/null +++ b/mkosi-18.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d66c9d28f42612b728ccafb459e261a4dec408f2346edfa4795bcd1916d4c345 +size 147420 diff --git a/mkosi.changes b/mkosi.changes index 32144fd..f2a5034 100644 --- a/mkosi.changes +++ b/mkosi.changes @@ -1,3 +1,228 @@ +------------------------------------------------------------------- +Mon Nov 14 08:20:28 UTC 2023 - Fredrik Lönnegren +- update to v18: + * $SCRIPT was renamed to $CHROOT_SCRIPT. $SCRIPT can still be used + but is considered deprecated. + * Added RuntimeTrees= setting to mount directories when booting images + via mkosi boot, mkosi shell or mkosi qemu. The directories are + mounted with a uid map that maps the user invoking mkosi to the root + user so that all files in the directory appear as if owned by the root + user in the container or virtual machine and any new files created in + the directories are owned by the user invoking mkosi. To make this + work in VMs, we use VirtioFS via virtiofsd. Note that this + requires systemd v254 or newer to be installed in the image. + * Added support for booting directory images with mkosi qemu via + VirtioFS. When CONFIG_VIRTIOFS and CONFIG_VIRTIO_PCI are builtin + modules, no initramfs is required to make this work. + * Added Include= or --include to include extra configuration files + or directories. + * Added support for specifiers to access the current value of certain + settings during configuration file parsing. + * mkosi will now exit with an error when no configuration was + provided. + * Multiple scripts of the same type are now supported. + * Custom distributions are now supported via the new custom + distribution. When using custom as the distribution, the rootfs must + be provided via base trees, skeleton trees or prepare scripts. + * We now use local GPG keys for rpm based distributions if the + distribution-gpg-keys package is installed on the host. + * Added RuntimeSize= to grow the image to a specific size before + booting it when using mkosi boot or mkosi qemu. + * We now set MKOSI_UID and MKOSI_GID when running scripts which are + set to the uid and gid of the user invoking mkosi respectively. These + can be used to run commands as the user that invoked mkosi. + * Added an Architecture= match + * Initrds specified with Initrds= are now used for grub menuentries as + well. + * ImageId= and ImageVersion= are now written to os-release as + IMAGE_ID and IMAGE_VERSION if provided. + * We pass command line arguments passed to the build verb to the build + script again. + * We added support for the "RHEL Universal Base Image" distribution. + +- update to v17.1: + * Fixed bug where --autologin was broken when used in combination with + a tools tree when using a packaged version of mkosi. + +- update to v17: + * Added ToolsTreePackages= to add extra packages to the default tools + tree. + * Added SystemdVersion= match to match on the host's systemd version + * Added Format= match to match on the configured output format + * Presets= can now be configured in global configuration files to select + which presets to build + * UKIs can now be booted using direct linux boot. + * We don't try to make images UEFI bootable anymore on architectures + that do not support UEFI + * Fixed --help to show all options again + * We now warn when settings are configured in the wrong section + +- update to v16: + * mkosi.version is now picked up from preset and dropin directories as + well following the usual config precedence logic + * Removed the "first assignment wins" logic from configuration parsing. + Settings parsed later will now override earlier values + * Removed the ! operator for lists. Instead, assign the empty string + to the list to remove all previous values. + * Added support for configuring custom default values for settings by + prefixing their name in the configuration file with @. + * Added QemuCdrom= to attach the image to the virtual machine as a + CD-ROM instead of a block device. + * Added SectorSize= to set the sector size of the disk images built by + systemd-repart. + * Added back grub support (BIOS/UEFI). Note that we don't install grub + on UEFI yet but we do add the necessary configuration and partitions. + * Added Bootloader= option to configure which EFI bootloader to + install. Added uki option to install just the UKI without + systemd-boot and grub to generate grub configuration to chainload + into the built UKIs. + * Added BiosBootloader= to configure whether grub for BIOS gets + installed or not. + * Added QemuFirmware= to select which qemu firmware to use (OVMF, + Seabios or direct kernel boot). + * Added QemuKernel= to specify the kernel that should be used with + direct kernel boot. + * /var/lib/dbus/machine-id is now removed if it was added by a package + manager postinstall script. + * The manifest is not generated by default anymore. Use + ManifestFormat=json to make sure the manifest is generated. + * Added SourceDateEpoch= to enable more reproducible image builds. + * Added Seed= to set the seed passed to systemd-repart. + * Updated the default Fedora release to Fedora 39. + * If ToolsTree= is set to default, mkosi will now build a default + tools tree containing all the necessary tools to build images. The + distribution and release to use can be configured with + ToolsTreeDistribution= and ToolsTreeRelease= or are determined + automatically based on the image being built. + * Added uki output format. This is similar to cpio, except the cpio + is packaged up as a UKI with a kernel image and stub picked up from + the rootfs. + +- update to v15.1: + * Migrated to systemd-repart. Many options are dropped in favor of specifying them directly + in repart partition definition files: + - Format=gpt_xxx options are replaced with a single "disk" options. Filesystem to use can now be specified with repart's Format= option + - Format=plain_squashfs (Can be reproduced by a single repart squashfs + root partition combined with SplitArtifacts=yes) + - Verity= (Replaced by repart's Verity= options) + - Encrypt= (Replaced by repart's Encrypt= option) + - RootSize=, HomeSize=, VarSize=, TmpSize=, ESPSize=, SwapSize=, SrvSize= + (Replaced by repart's size options) + - UsrOnly= (replaced with CopyFiles=/:/usr in a usr partition definition) + - OutputSplitRoot=, OutputSplitVerity=, (Replaced by repart's SplitName= option) + - OutputSplitKernel= (UKI is now always written to its own output file) + - GPTFirstLBA (Removed, no equivalent in repart) + - ReadOnly= (Replaced by repart's ReadOnly= option per partition) + - Minimize= (Replaced by repart's Minimize= option per partition) + - CompressFs= (No equivalent in repart, can be replicated by replacing mkfs. + in $PATH with a script that adds the necessary command line option) + - MkSquashfs= (Can be replaced with a script in $PATH that invokes + the correct binary) + * We also remove the WithoutUnifiedKernelImages= switch as building unified + kernel images is trivial and fast these days. + * Support for --qemu-boot was dropped + * Support for --use-host-repositories was dropped, use --repository-directory instead + * RepositoryDirectory was removed, use PackageManagerTrees= or SkeletonTrees= instead. + * --repositories is now only usable on Debian/RPM based distros and can only be used to enable additional + repositories. Specifically, it cannot be used on Arch Linux anymore to add new repositories. + * The _epel distributions were removed. Use --repositories=epel instead to enable + the EPEL repository. + * Removed -stream from CentOS release specifiers. Instead of specifying 8-stream, + you know just specify 8. + * Removed default kernel command line arguments rhgb, selinux=0 and audit=0. + * Dropped --all and --all-directory as this functionality is better implemented by + using a build system. + * mkosi now builds images without needing root privileges. + * Removed --no-chown, --idmap and --nspawn-keep-unit options as they were made obsolete by moving to + rootless builds. + * Removed --source-file-transfer, --source-file-transfer-final, --source-resolve-symlinks and + --source-resolve-symlinks-final in favor of always mounting the source directory into the build image. + --source-file-transfer-final might be reimplemented in the future using virtiofsd. + * Dropped --include-dir option. Usage can be replaced by using --incremental and reading includes from + the cached build image tree. + * Removed --machine-id in favor of shipping images without a machine ID at all. + * Removed --skip-final-phase as we only have a single phase now. + * The post install script is only called for the final image now and not for the build image anymore. Use the + prepare script instead. + * --ssh-key, --ssh-agent, --ssh-port and --ssh-timeout options were dropped as the SSH support was + reimplemented using VSock. mkosi ssh can only be used with images booted with mkosi qemu. Use + machinectl to access images booted with mkosi boot. Use --extra-tree or --credential with the + .ssh.authorized_keys.root credentials as alternatives for provisioning the public key inside the image. + * Only configuration files matching *.conf are parsed in dropin directories now. + * Removed --qemu-headless, we now start qemu in the terminal by default and configure the serial console at + runtime. Use the new --qemu-gui option to start qemu in its graphical interface. + * Removed --netdev. Can be replaced by manually installing systemd-networkd, putting a network file in the + image and enabling systemd-networkd. + * If mkosi.extra/ or mkosi.skeleton/ exist, they are now always used instead of only when no explicit + extra/skeleton trees are defined. + * mkosi doesn't install any default packages anymore aside from packages required by the distro or the base + filesystem layout package if there are no required packages. In practice, this means systemd and other + basic tools have to be installed explicitly from now on. + * Removed --base-packages as it's not needed anymore since we don't install any packages by default anymore + aside from the base filesystem layout package. + * Removed --qcow2 option in favor of supporting only raw disk images as the disk image output format. + * Removed --bmap option as it can be trivially added manually by utilizing a finalize script. + * The never value for --with-network was spun of into its own custom option --cache-only. + * --bootable now defaults to auto. When set to auto, mkosi will generate a bootable image only if all + the necessary packages are installed. Documentation was added in docs/bootable.md on how a bootable image + can be generated on mainstream distros. + * The RPM db is no longer rebuilt in bdb format on CentOS Stream 8. To be able to install packages on a + CentOS Stream 8 image with a RPM db in sqlite format, rewrite the db in bdb format using + rpm --rebuilddb --define _db_backend bdb. + * Repositories are now only written to /etc/apt/sources.list if apt is installed in the image. + * Removed the dependency on debootstrap to build Ubuntu or Debian images. + * Apt now uses the keyring from the host instead of the keyring from the image. This means + debian-archive-keyring or ubuntu-archive-keyring are now required to be installed to build Debian or + Ubuntu images respectively. + * --base-image is split into --base-tree and --overlay. + * Removed --cache-initrd, instead, use a prebuilt initrd with Initrds= to avoid rebuilding the initrd all + the time. + * Disk images are now resized to 8G when booted to give some disk space to play around with in the booted + image. + * Removed --install-directory= option. This was originally added for caching the installation results, but + this doesn't work properly as it might result in leftover files in the install directory from a previous + installation, so we have to empty the directory before reusing it, invalidating the caching, so the option + was removed. + * Build scripts are now executed on the host. See the SCRIPTS section + in the manual for more information. Existing build scripts will need + to be updated to make sure they keep working. Specifically, most paths + in scripts will need to be prefixed with $BUILDROOT to have them + operate on the image instead of on the host system. To ensure the host + system cannot be modified when running a script, most host directories + are mounted read-only when running a script to ensure a script cannot + modify the host in any way. Alternatively to making the script run on + the host, the script can also still be executed in the image itself by + putting the following snippet at the top of the script: + + if [ "$container" != "mkosi" ]; then + exec mkosi-chroot "$SCRIPT" "$@" + fi + * Removed --tar-strip-selinux-context= option. We now label all files + properly if selinux is enabled and if users don't want the labels, + they can simply exclude them when extracting the archive. + * Gentoo is now marked as experimental and unsupported and there's no + guarantee at all that it will work. Issues related to gentoo will + generally not receive attention from core maintainers. All gentoo + specific hacks outside of the gentoo implementation module have been + removed. + * A verb documentation has been added. Calling mkosi with this verb will show + the documentation. This is useful when running mkosi during development to + always have the documentation in the correct version available. By default it + will try several ways to output the documentation, but a specific option can + be chosen with the --doc-format option. Distro packagers are encouraged to + add a file mkosi.1 into the mkosi/resources directory of the Python + package, if it is missing, as well es install it in the appropriate search + path for man pages. The man page can be generated from the markdown file + mkosi/resources/mkosi.md e.g via pandoc -t man -s -o mkosi.1 mkosi.md. + * The man page can be generated from the markdown file via + tools/make-man-page.sh. + * Fixed issue where not all packages and data files where included in + the generated python package. + * mkosi doesn't try to unshare the network namespace anymore when it + doesn't have CAP_NET_ADMIN. + * Fixed issue when the workspace was located in /tmp. + * Don't try to run timedatectl or ssh-add when they're not installed. + ------------------------------------------------------------------- Sat Dec 3 22:08:17 UTC 2022 - Dirk Müller diff --git a/mkosi.spec b/mkosi.spec index 45647f0..3669a3c 100644 --- a/mkosi.spec +++ b/mkosi.spec @@ -1,7 +1,7 @@ # # spec file for package mkosi # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,18 +16,24 @@ # +%define pythons python311 + Name: mkosi -Version: 14 +Version: 18 Release: 0 Summary: Build Legacy-Free OS Images License: LGPL-2.1-or-later Group: System/Management URL: https://github.com/systemd/mkosi Source: https://github.com/systemd/mkosi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -BuildRequires: pkgconfig -BuildRequires: python3-setuptools -BuildRequires: pkgconfig(python3) >= 3.7 -Requires: python3 >= 3.7 +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module wheel} +BuildRequires: %{pythons} +BuildRequires: fdupes +BuildRequires: pandoc +BuildRequires: python-rpm-macros +Requires: python3 >= 3.9 Requires: squashfs Requires: tar Requires: xz @@ -56,23 +62,27 @@ supported (not plain MBR/BIOS). %prep %setup -q -sed -i '1s/^#!\/usr\/bin\/env /#!\/usr\/bin\//' bin/mkosi %build -%py3_build +tools/make-man-page.sh +%pyproject_wheel %install -%py3_install +%pyproject_install +%python_expand %fdupes %{buildroot}/%{$python_sitelib}/mkosi + +mkdir -p %{buildroot}%{_mandir}/man1 +cp %{buildroot}%{python3_sitelib}/mkosi/resources/mkosi.1* %{buildroot}%{_mandir}/man1/ %check -%{buildroot}%{_bindir}/mkosi -h >/dev/null +%pytest %files %doc mkosi.md README.md %license LICENSE -%{_bindir}/%{name} -%{_mandir}/man1/mkosi.1%{?ext_man} -%{python3_sitelib}/mkosi/ -%{python3_sitelib}/mkosi-%{version}-py*.egg-info/ +%{_bindir}/mkosi +%{_mandir}/man1/mkosi.1* +%{python3_sitelib}/mkosi +%{python3_sitelib}/mkosi-%{version}.dist-info %changelog From 7f95769ee97181f92583be834f4773360164ab0027b172ba02331bd3d5cf648d Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Sat, 18 Nov 2023 13:17:59 +0000 Subject: [PATCH 2/2] - set singlepython version to python3 instead of python311 to allow build on Leap and not require changes on every Python change in Tumbleweed OBS-URL: https://build.opensuse.org/package/show/Virtualization/mkosi?expand=0&rev=17 --- mkosi.changes | 5 +++++ mkosi.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mkosi.changes b/mkosi.changes index f2a5034..f3bf10c 100644 --- a/mkosi.changes +++ b/mkosi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Nov 18 13:17:19 UTC 2023 - Sebastian Wagner + +- set singlepython version to python3 instead of python311 to allow build on Leap and not require changes on every Python change in Tumbleweed + ------------------------------------------------------------------- Mon Nov 14 08:20:28 UTC 2023 - Fredrik Lönnegren - update to v18: diff --git a/mkosi.spec b/mkosi.spec index 3669a3c..1afe23f 100644 --- a/mkosi.spec +++ b/mkosi.spec @@ -16,7 +16,7 @@ # -%define pythons python311 +%define pythons python3 Name: mkosi Version: 18