From 4dea7f83a1e24843458749f1bd7e2a48932ba993d330b604a91f72857932f1eb Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 17 Sep 2024 18:51:41 +0000 Subject: [PATCH] - Workaround python packaging deficiency OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtme?expand=0&rev=48 --- .gitattributes | 23 ++ .gitignore | 1 + ...ix-virtiofsd-search-path-on-openSUSE.patch | 29 ++ _service | 18 ++ virtme-ng-1.25.tar.xz | 3 + virtme-ng-1.27.tar.xz | 3 + virtme-ng-1.28.tar.xz | 3 + virtme-ng.obsinfo | 4 + virtme.changes | 289 ++++++++++++++++++ virtme.spec | 85 ++++++ 10 files changed, 458 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch create mode 100644 _service create mode 100644 virtme-ng-1.25.tar.xz create mode 100644 virtme-ng-1.27.tar.xz create mode 100644 virtme-ng-1.28.tar.xz create mode 100644 virtme-ng.obsinfo create mode 100644 virtme.changes create mode 100644 virtme.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch b/0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch new file mode 100644 index 0000000..95158cb --- /dev/null +++ b/0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch @@ -0,0 +1,29 @@ +From af92241a00f4bf7f4a47649d7488902e936af321 Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Mon, 10 Jun 2024 11:53:04 +0200 +Subject: [PATCH] virtme-ng: fix virtiofsd search path on openSUSE + +On openSUSE based systems, virtiofsd is in /usr/lib/virtiofsd/virtiofsd. + +Fix the search path for it. + +Signed-off-by: Johannes Thumshirn +--- + virtme/commands/run.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/virtme/commands/run.py b/virtme/commands/run.py +index 95f7684b4821..a3a2f0b5ab1e 100644 +--- a/virtme/commands/run.py ++++ b/virtme/commands/run.py +@@ -582,6 +582,7 @@ class VirtioFS: + f"{self.guest_tools_path}/bin/virtiofsd", + which("virtiofsd"), + "/usr/libexec/virtiofsd", ++ "/usr/lib/virtiofsd/virtiofsd", + "/usr/lib/virtiofsd", + "/usr/lib/qemu/virtiofsd", + ) +-- +2.43.0 + diff --git a/_service b/_service new file mode 100644 index 0000000..e96f34a --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + https://github.com/arighi/virtme-ng.git + git + enable + v1.28 + @PARENT_TAG@ + v(.*) + \1 + + + + *.tar + xz + + + + diff --git a/virtme-ng-1.25.tar.xz b/virtme-ng-1.25.tar.xz new file mode 100644 index 0000000..fa25fbd --- /dev/null +++ b/virtme-ng-1.25.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9167264e48eb1dfd5e76de23bf69ff4b40eeb2b9309b8a886bef8713fcc72a5a +size 67724 diff --git a/virtme-ng-1.27.tar.xz b/virtme-ng-1.27.tar.xz new file mode 100644 index 0000000..c1938b2 --- /dev/null +++ b/virtme-ng-1.27.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26e92366f29cc874fd75f33e1a8cc976ec8aebd1b0fe4f159ea5b9d917a1e847 +size 69944 diff --git a/virtme-ng-1.28.tar.xz b/virtme-ng-1.28.tar.xz new file mode 100644 index 0000000..99c6420 --- /dev/null +++ b/virtme-ng-1.28.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:153fb567abf6d712d69506977c1e65f3fe9aa3d42405c55efe9abbf67d578c8d +size 70208 diff --git a/virtme-ng.obsinfo b/virtme-ng.obsinfo new file mode 100644 index 0000000..38c0d8a --- /dev/null +++ b/virtme-ng.obsinfo @@ -0,0 +1,4 @@ +name: virtme-ng +version: 1.22 +mtime: 1708765232 +commit: ba33d946255e671efd6bdad0520d1fcbc115412b diff --git a/virtme.changes b/virtme.changes new file mode 100644 index 0000000..87356f5 --- /dev/null +++ b/virtme.changes @@ -0,0 +1,289 @@ +------------------------------------------------------------------- +Tue Sep 17 15:14:48 UTC 2024 - Michal Suchanek + +- Workaround python packaging deficiency + +------------------------------------------------------------------- +Fri Sep 6 06:06:23 UTC 2024 - Michael Vetter + +- Update to 1.28: + * setup.py: include dependencies parsing requirements.txt + * virtme-ng: fix typo in command help + * virtme-configkernel: disable nvram support + * configkernel: config comment cosmetics + * configkernel: act more like kernel's make O=outdir + * vng-run: get kdir from O=outdir + * vng: propagate --verbose to configkernel + * vng: alias --custom to --config + * run.py: add a --qemu-opts='...' option bundling hint to help + * init: Always create /run/tmp folder + * Don't require ".git" to be a directory + * Specify "refs/heads/__virtme__" in git push +- Add BuildRequires for python-argparse-manpage and install man + page if we are on TW. Older versions don't have the dep yet + +------------------------------------------------------------------- +Wed Jul 31 06:37:11 UTC 2024 - Michael Vetter + +- Update to 1.27: + * Introduce VNG_PACKAGE to force a proper packaging version + virtme-ng v1.27 + +------------------------------------------------------------------- +Tue Jul 30 03:59:00 UTC 2024 - Michael Vetter + +- Update to 1.26: + * Proper integration with Arch + * Inclusion of a vng manpage + * The host's /tmp is now also visible from the guest + * A new --configitem option that allows to quickly change specific + kernel config options (with --build) + * Bug fixes +- Remove 0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch + +------------------------------------------------------------------- +Mon Jun 10 10:00:40 UTC 2024 - Johannes Thumshirn + +- Fix virtiofsd search path + + 0001-virtme-ng-fix-virtiofsd-search-path-on-openSUSE.patch + +------------------------------------------------------------------- +Wed May 22 06:19:47 UTC 2024 - Michael Vetter + +- Update to 1.25: + * significantly improve boot time with the microvm architecture + (simply by enabling the RTC and avoiding unnecessary boot time + that most kernels spend probing for a non-existent RTC) + * virtme: make sure RTC is enabled with microvm + * virtme-ng: silent lint errors + * github: new test with KVM support + +------------------------------------------------------------------- +Fri May 3 20:55:04 UTC 2024 - Michael Vetter + +- Update to 1.24: + * The most noticeable changes include the support for the loop + network type and the possibility to specify the --network + command multipe times, both useful for kernel selftests testing + * Moreover, there is a boot-time improvement in environments where + the kvm acceleration is not available, such as container, cloud + environments, etc. (using the q35 arch in qemu). + * Notably, this new version is expected to enhance the performance + of GitHub workflows that use virtme-ng. + +------------------------------------------------------------------- +Fri Mar 29 14:17:01 UTC 2024 - Michael Vetter + +- Update to 1.23: + * Fix breakage with QEMU 8.2.2 + * Change behaviour of --kconfig, that will always override + the .config if present (since there is not reason to use + --kconfig and not update the .config). + * It is now possible to force the legacy cgroup v1 using the + option -a "SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1": the vng + init script will mimic systemd behavior and mount cgroup v1, + instead of v2. +- Drop qemu-remove-unnecessary-serial-none-arg.patch + +------------------------------------------------------------------- +Thu Mar 28 08:05:50 UTC 2024 - Michal Suchanek + +- qemu 8.2.2 compatibility + * qemu-remove-unnecessary-serial-none-arg.patch + +------------------------------------------------------------------- +Mon Mar 4 12:25:43 UTC 2024 - Michael Vetter + +- Update to 1.22: + * Fix potential sudo errors (in openSUSE, Fedora, CachyOS) + * Propagate /proc/sys/fs/nr_open from host to guest + * More robust parsing of upstream kernel versions + * Small command help improvements +- Update to 1.21: + * When running in script mode do not hang in case of kernel panic, + but return the special error code 255 (this allows to automate + catching kernel panics) + * Redirect kernel log to stderr on the host when running in interactive + mode: this allows to easily save the kernel log to a file (or pipe + it to another tool), simply by runing a vng -vr 2>/tmp/kernel.log + * vng --dump can now generate a memory dump compatible with drgn + * It is now possible to use virtiofsd with a btrfs root filesystem + on the host (e.g., default openSUSE setup) + * It is not possible to to use the microvm architecture with kernels + that don't have built-in virtio-pci / virtio-mmio (e.g., stock + openSUSE Tumbleweed kernel) +- Update to 1.20: + * The return code of a command executed in the vng guest is now + transparently channeled to the host: this, together with + stdin/stdout/stderr redirection, gives the complete illusion to + run the command in the guest as if it was executed on the host + and it can help to easily integrate vng with other CI tools/scripts + * NUMA support: it is now possible to create multiple NUMA nodes, + and assign CPUs to them, inside a vng guest, + using the --numa option. + * new --quiet option to override --verbose + * new --disable-kvm option to explicitly disable hardware + virtualization (KVM) + * lockdep is now disabled by default during the kernel build +- Update to 1.19: + * The most noticeable change is definitely the support for running + virtme-ng inside Docker containers. This opens the possibility for + many other projects to use virtme-ng to potentially pick any + arbitrary kernel to run their tests inside their Docker instances. + * The other interesting change (this one only for Ubuntu users) is + the --root-release argument (used together with --root) that allows + bootstrapping a rootfs from scratch, selecting a specific Ubuntu + release. The rootfs will be created from the latest Ubuntu cloud + image of the target release. +- Add dependency on `requests` +- Add _service file: + They use git submodule to get virtme_ng_init. + +------------------------------------------------------------------- +Fri Feb 23 13:04:18 UTC 2024 - Marcos de Souza + +- Fix python version checking + +------------------------------------------------------------------- +Thu Feb 22 13:23:47 UTC 2024 - Marcos de Souza + +- Requires setuptools and argcomplete, instead of just require it for building + +------------------------------------------------------------------- +Wed Dec 13 09:36:30 UTC 2023 - Robert Frohl + +- Require qemu-tools instead virtiofsd for older SLE/Leap versions + +------------------------------------------------------------------- +Thu Nov 30 11:22:25 UTC 2023 - Michal Suchanek + +- Update to version 1.18 + * restore old --run behavior + * fix --user behavior + +------------------------------------------------------------------- +Thu Nov 16 10:56:32 UTC 2023 - Takashi Iwai + +- virtme-ng version: 1.17 + * Fixes Leap build + +------------------------------------------------------------------- +Fri Apr 21 10:21:46 UTC 2023 - Michal Suchanek + +- Update project URL: https://github.com/arighi/virtme +- Update to version 0.1.2 + - Remove upstreamed patches + - 0001-Add-save-initramfs-to-save-the-actual-generated-init.patch + - 0002-Make-save-initramfs-show-command-output-more-useful.patch + - 0003-Fix-the-error-message-for-mods-misuse.patch + - 0004-Fix-the-mods-error-even-better.patch + - 0005-mkinitramfs.py-Search-for-busybox-.-static-first.patch + - 0006-mkinitramfs-Improve-the-find_busybox-algorithm.patch + - 0007-Add-util.find_binary-to-find-binaries.patch + - 0008-modfinder-Use-find_binary_or_raise-to-find-modprobe.patch + - 0009-Enable-the-Xen-console-when-using-xen.patch + - 0001-configkernel-Add-CONFIG_INOTIFY_USER-y.patch + - 0002-Use-fsdev-multidevs-remap-on-QEMU-4.2.patch + - 0003-Add-more-typing-annotations.patch + - 0004-run.py-Extract-path-file-sanitizing-into-a-new-funct.patch + - 0005-run.py-Introduce-blk-disk-argument.patch + - 0006-Minor-sanitize_disk_args-cleanup.patch + - aarch64-Fix-aarch64-support.patch + +------------------------------------------------------------------- +Tue Dec 14 14:14:14 UTC 2021 - ohering@suse.de + +- Add python-rpm-macros (bsc#1180125) + +------------------------------------------------------------------- +Thu Nov 12 08:24:10 UTC 2020 - Matthias Brugger + +- Update patch for aarch64 support. Does not break full emulation case. + +------------------------------------------------------------------- +Fri Oct 30 11:09:02 UTC 2020 - Matthias Brugger + +- Add patch to fix aarch64 native support. + * aarch64-Fix-aarch64-support.patch + +------------------------------------------------------------------- +Wed Jul 22 01:14:28 UTC 2020 - Marcos de Souza + +- Add patches to include some fixes and the new --blk-disk feature + * 0001-Add-save-initramfs-to-save-the-actual-generated-init.patch + * 0002-Make-save-initramfs-show-command-output-more-useful.patch + * 0003-Fix-the-error-message-for-mods-misuse.patch + * 0004-Fix-the-mods-error-even-better.patch + * 0005-mkinitramfs.py-Search-for-busybox-.-static-first.patch + * 0006-mkinitramfs-Improve-the-find_busybox-algorithm.patch + * 0007-Add-util.find_binary-to-find-binaries.patch + * 0008-modfinder-Use-find_binary_or_raise-to-find-modprobe.patch + * 0009-Enable-the-Xen-console-when-using-xen.patch + * 0001-configkernel-Add-CONFIG_INOTIFY_USER-y.patch + * 0002-Use-fsdev-multidevs-remap-on-QEMU-4.2.patch + * 0003-Add-more-typing-annotations.patch + * 0004-run.py-Extract-path-file-sanitizing-into-a-new-funct.patch + * 0005-run.py-Introduce-blk-disk-argument.patch + * 0006-Minor-sanitize_disk_args-cleanup.patch +- Drop outdated patch: + * 0001-mkinitramfs.py-Search-for-busybox-.-static-first.patch + +------------------------------------------------------------------- +Thu Oct 17 02:06:33 UTC 2019 - Marcos de Souza + +- Current Tumbleweed's busybox does not work with virtme. For now require + busybox-static since it works; + * 0001-mkinitramfs.py-Search-for-busybox-.-static-first.patch: Check for + busybox-static over dynamically linked busybox +- Change the dependency to busybox-static instead of the dynamically linked on. + +------------------------------------------------------------------- +Wed Oct 16 17:51:50 UTC 2019 - Jan Engelhardt + +- Trim bias, conjecture and vision from descriptions. +- Use noun phrase in summary. + +------------------------------------------------------------------- +Tue Oct 15 15:53:23 UTC 2019 - Marcos de Souza + +- Remove the python3- prefix from the final package +- Added full source URL + +------------------------------------------------------------------- +Tue Oct 15 01:38:51 UTC 2019 - Marcos de Souza + +- Remove _service and add the virtme source code into the project. + +------------------------------------------------------------------- +Sat Oct 12 01:09:46 UTC 2019 - Marcos de Souza + +- Add busybox and qemu as dependencies of virtme. Now 'virtme-run + --installed-kernel' works out-of-the-box. + +------------------------------------------------------------------- +Thu Oct 10 19:41:06 UTC 2019 - Marcos de Souza + +- Newly released version 0.1.1 +- Use an OBS service to download the tarball +- Removed all patches, since they are all included in the new version + +------------------------------------------------------------------- +Mon Sep 30 03:27:06 UTC 2019 - Marcos de Souza + +- Add a new patch to support --mods auto in openSUSE. + +------------------------------------------------------------------- +Mon Sep 30 03:00:03 UTC 2019 - Marcos de Souza + +- Update virtme version with previous patches already included in the upstream + project + +------------------------------------------------------------------- +Mon Aug 26 02:13:38 UTC 2019 - Marcos de Souza + +- Add patches to enable experimental --kdir with modules enabled + +------------------------------------------------------------------- +Thu Aug 22 02:09:04 UTC 2019 - Marcos de Souza + +- First version of the package diff --git a/virtme.spec b/virtme.spec new file mode 100644 index 0000000..0c481f8 --- /dev/null +++ b/virtme.spec @@ -0,0 +1,85 @@ +# +# spec file for package virtme +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if 0%{?suse_version} >= 1600 +%global pythons python3 +%else +%global pythons python311 +%endif +Name: virtme +Version: 1.28 +Release: 0 +Summary: Tools for virtualize the running distro or a rootfs +License: GPL-2.0-only +Group: Development/Tools/Other +URL: https://github.com/arighi/virtme-ng +Source0: %{name}-ng-%{version}.tar.xz +BuildRequires: %{pythons}-argcomplete +%if 0%{?suse_version} > 1600 +BuildRequires: %{pythons}-argparse-manpage +%endif +BuildRequires: %{pythons}-requests +BuildRequires: %{pythons}-setuptools +BuildRequires: python-rpm-macros +Requires: %{pythons}-argcomplete +Requires: %{pythons}-requests +Requires: %{pythons}-setuptools +Requires: busybox-static +Requires: qemu +%if 0%{?suse_version} == 1500 && 0%{?sle_version} <= 150500 +Requires: qemu-tools +%else +Requires: virtiofsd +%endif +BuildArch: noarch + +%description +Virtme is a set of tools to run a virtualized Linux kernel that +uses the host Linux distribution or a rootfs instead of a whole +disk image. + +%prep +%autosetup -n %{name}-ng-%{version} -p1 + +%build +%python_build +# remove pycache directories +find . -name __pycache__ -type d -exec rm -fr {} + + +%install +export PYTHONDONTWRITEBYTECODE=1 %python_install +# This is a buildtime requirement, not runtime requirement +sed -i -e /argparse-manpage/d $(find %{buildroot} -name requires.txt) + +%files +%{_bindir}/virtme-configkernel +%{_bindir}/virtme-ng +%{_bindir}/virtme-mkinitramfs +%{_bindir}/virtme-prep-kdir-mods +%{_bindir}/virtme-run +%{_bindir}/vng +%if 0%{?suse_version} > 1600 +%{_mandir}/man1/vng.1%{?ext_man} +%endif +%{python_sitelib}/%{name} +%{python_sitelib}/%{name}_ng +%{python_sitelib}/%{name}_ng-%{version}-py*.egg-info +%{_datadir}/bash-completion +%config(noreplace) %{_sysconfdir}/%{name}-ng.conf + +%changelog