diff --git a/0002-Fix-build-with-nftables-installed-in-different-direc.patch b/0002-Fix-build-with-nftables-installed-in-different-direc.patch index aa633e6..aba904a 100644 --- a/0002-Fix-build-with-nftables-installed-in-different-direc.patch +++ b/0002-Fix-build-with-nftables-installed-in-different-direc.patch @@ -39,4 +39,4 @@ Signed-off-by: Takashi Iwai +export CFLAGS += $(FEATURE_DEFINES) $(FEATURE_CFLAGS) FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \ - SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW MEMFD_CREATE \ + SETPROCTITLE_INIT TCP_REPAIR_WINDOW MEMFD_CREATE \ diff --git a/crit.py b/crit.py new file mode 100644 index 0000000..91574c3 --- /dev/null +++ b/crit.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +import re +import sys +from crit.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/criu-3.18.tar.gz b/criu-3.18.tar.gz deleted file mode 100644 index 6ca645f..0000000 --- a/criu-3.18.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a9997981c9fe4730c848ce59346b3a22fad69b803607cb67a3f6ec0557fa474 -size 1354367 diff --git a/criu-3.19.tar.gz b/criu-3.19.tar.gz new file mode 100644 index 0000000..377a3f6 --- /dev/null +++ b/criu-3.19.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:990cdd147cb670a5d5d14216c2b5c2fc2b9a53ef19396569a6413807ba2a6aa2 +size 1379938 diff --git a/criu-amdgpu-plugin-fix.patch b/criu-amdgpu-plugin-fix.patch deleted file mode 100644 index f497752..0000000 --- a/criu-amdgpu-plugin-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- - plugins/amdgpu/Makefile | 3 ++- - plugins/amdgpu/kfd_ioctl.h | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) - ---- a/plugins/amdgpu/Makefile -+++ b/plugins/amdgpu/Makefile -@@ -5,7 +5,8 @@ PLUGIN_SOBJ := amdgpu_plugin.so - PLUGIN_INCLUDE := -iquote../../include - PLUGIN_INCLUDE += -iquote../../criu/include - PLUGIN_INCLUDE += -iquote../../criu/arch/$(ARCH)/include/ --PLUGIN_INCLUDE += -iquote../../ -+PLUGIN_INCLUDE += -iquote../../include -+PLUGIN_INCLUDE += -iquote../.. - - COMPEL := ../../compel/compel-host - LIBDRM_INC := -I/usr/include/libdrm ---- a/plugins/amdgpu/kfd_ioctl.h -+++ b/plugins/amdgpu/kfd_ioctl.h -@@ -23,7 +23,7 @@ - #ifndef KFD_IOCTL_H_INCLUDED - #define KFD_IOCTL_H_INCLUDED - --#include -+#include - #include - - /* diff --git a/criu-py-install-fix.diff b/criu-py-install-fix.diff index a46dcb1..e141aa4 100644 --- a/criu-py-install-fix.diff +++ b/criu-py-install-fix.diff @@ -1,56 +1,113 @@ --- - lib/Makefile | 7 ++++++- - scripts/crit-setup.py | 25 +++++++++++++++++++++++++ - 2 files changed, 31 insertions(+), 1 deletion(-) + crit/Makefile | 12 +----------- + lib/Makefile | 12 +----------- + scripts/crit-setup.py | 28 ++++++++++++++++++++++++++++ + scripts/pycriu-setup.py | 28 ++++++++++++++++++++++++++++ + 4 files changed, 58 insertions(+), 22 deletions(-) ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -2,6 +2,10 @@ CRIU_SO := libcriu.so - CRIU_A := libcriu.a - UAPI_HEADERS := lib/c/criu.h images/rpc.proto images/rpc.pb-c.h criu/include/version.h +--- a/crit/Makefile ++++ b/crit/Makefile +@@ -10,18 +10,8 @@ ${VERSION_FILE}: + $(Q) echo "__version__ = '${CRIU_VERSION}'" > $@ -+# -+# File to keep track of files installed by setup.py -+CRIT_SETUP_FILES := lib/.crit-setup.files -+ - all-y += lib-c lib-a lib-py - - # -@@ -56,7 +60,8 @@ install: lib-c lib-a lib-py crit/crit li - $(Q) install -m 644 lib/c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig - ifeq ($(PYTHON),python3) + install: ${VERSION_FILE} +-ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) +-ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) +- $(E) " SKIP INSTALL crit: Externally managed python environment (See PEP 668 for more information)" +- $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" +-else $(E) " INSTALL " crit -- $(Q) $(PYTHON) -m pip install --upgrade --force-reinstall --prefix=$(DESTDIR)$(PREFIX) ./crit -+ # $(Q) $(PYTHON) -m pip install --upgrade --force-reinstall --prefix=$(DESTDIR)$(PREFIX) ./crit -+ $(Q) $(PYTHON) scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) --record $(CRIT_SETUP_FILES) - endif +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit +-endif +-else +- $(E) " INSTALL " crit +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./crit +-endif ++ $(Q) $(PYTHON) scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) .PHONY: install + uninstall: +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -57,18 +57,8 @@ install: lib-c lib-a lib-py lib/c/criu.p + $(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig + $(Q) sed -e 's,@version@,$(CRIU_VERSION),' -e 's,@libdir@,$(LIBDIR),' -e 's,@includedir@,$(dir $(INCLUDEDIR)/criu/),' lib/c/criu.pc.in > lib/c/criu.pc + $(Q) install -m 644 lib/c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig +-ifeq ($(PYTHON_EXTERNALLY_MANAGED),1) +-ifeq ($(PIP_BREAK_SYSTEM_PACKAGES),0) +- $(E) " SKIP INSTALL pycriu: Externally managed python environment (See PEP 668 for more information)" +- $(E) " Consider using PIP_BREAK_SYSTEM_PACKAGES=1 make install" +-else + $(E) " INSTALL " pycriu +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib +-endif +-else +- $(E) " INSTALL " pycriu +- $(Q) $(PYTHON) -m pip install --upgrade --ignore-installed --prefix=$(DESTDIR)$(PREFIX) ./lib +-endif ++ $(Q) $(PYTHON) scripts/pycriu-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX) + .PHONY: install + + uninstall: --- /dev/null +++ b/scripts/crit-setup.py -@@ -0,0 +1,25 @@ +@@ -0,0 +1,28 @@ +import os +from distutils.core import setup + -+criu_version = "0.0.1" -+env = os.environ ++def get_version(): ++ version = '0.0.1' ++ env = os.environ ++ if 'CRIU_VERSION_MAJOR' in env and 'CRIU_VERSION_MINOR' in env: ++ version = '{}.{}'.format( ++ env['CRIU_VERSION_MAJOR'], ++ env['CRIU_VERSION_MINOR'] ++ ) ++ if 'CRIU_VERSION_SUBLEVEL' in env and env['CRIU_VERSION_SUBLEVEL']: ++ version += '.' + env['CRIU_VERSION_SUBLEVEL'] ++ return version + -+if 'CRIU_VERSION_MAJOR' in env and 'CRIU_VERSION_MINOR' in env: -+ criu_version = '{}.{}'.format( -+ env['CRIU_VERSION_MAJOR'], -+ env['CRIU_VERSION_MINOR'] -+ ) + -+ if 'CRIU_VERSION_SUBLEVEL' in env and env['CRIU_VERSION_SUBLEVEL']: -+ criu_version += '.' + env['CRIU_VERSION_SUBLEVEL'] ++setup( ++ name='crit', ++ version=get_version(), ++ description='CRiu Image Tool', ++ author='CRIU team', ++ author_email='criu@openvz.org', ++ license='GPLv2', ++ url='https://github.com/checkpoint-restore/criu', ++ package_dir={'crit': 'crit/crit'}, ++ packages=["crit"], ++ install_requires=[], ++) +--- /dev/null ++++ b/scripts/pycriu-setup.py +@@ -0,0 +1,28 @@ ++import os ++from distutils.core import setup + -+setup(name="crit", -+ version=criu_version, -+ description="CRiu Image Tool", -+ author="CRIU team", -+ author_email="criu@openvz.org", -+ license="GPLv2", -+ url="https://github.com/checkpoint-restore/criu", -+ package_dir={'pycriu': 'lib/py'}, -+ packages=["pycriu", "pycriu.images"], -+ scripts=["crit/crit"]) ++def get_version(): ++ version = '0.0.1' ++ env = os.environ ++ if 'CRIU_VERSION_MAJOR' in env and 'CRIU_VERSION_MINOR' in env: ++ version = '{}.{}'.format( ++ env['CRIU_VERSION_MAJOR'], ++ env['CRIU_VERSION_MINOR'] ++ ) ++ if 'CRIU_VERSION_SUBLEVEL' in env and env['CRIU_VERSION_SUBLEVEL']: ++ version += '.' + env['CRIU_VERSION_SUBLEVEL'] ++ return version ++ ++ ++setup( ++ name='pycriu', ++ version=get_version(), ++ description='CRiu Image Tool', ++ author='CRIU team', ++ author_email='criu@openvz.org', ++ license='GPLv2', ++ url='https://github.com/checkpoint-restore/criu', ++ package_dir={'pycriu': 'lib/pycriu'}, ++ packages=["pycriu", "pycriu.images"], ++ install_requires=[], ++) diff --git a/criu.changes b/criu.changes index 262513b..8fb47f6 100644 --- a/criu.changes +++ b/criu.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Tue Nov 28 15:04:29 UTC 2023 - Takashi Iwai + +- Update to criu 3.19: + New features: + * LoongArch64 support + * C/R membarrier() registrations + * Restore THP_DISABLE prctl + * prctl: Migrate prctl(NO_NEW_PRIVS) setting + Bugfixes: + * Many fixes and improvements from the Google team + * Fix dumping hugetlb-based memfd on kernels < 4.16 + * Fixes here and there + Improvements: + * drop python 2 support + * support XSAVE on newer Intel CPUs +- Refreshed criu-py-install-fix.diff; + workarounds appled to both crit and lib/pycriu +- Drop obsoleted patch criu-amdgpu-plugin-fix.patch + ------------------------------------------------------------------- Tue Jun 6 15:31:57 UTC 2023 - Takashi Iwai diff --git a/criu.spec b/criu.spec index d39f703..00a1a3a 100644 --- a/criu.spec +++ b/criu.spec @@ -33,16 +33,17 @@ %define proto_c_ver %(protoc-c --version | head -1 | awk '{print $2}') Name: criu -Version: 3.18 +Version: 3.19 Release: 0 Summary: Checkpoint/Restore In Userspace Tools License: GPL-2.0-only Group: System/Console URL: https://criu.org/ Source0: http://github.com/checkpoint-restore/criu/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +# To be generated; we keep a static one for building without pip +Source1: crit.py Patch1: criu-py-install-fix.diff Patch2: 0002-Fix-build-with-nftables-installed-in-different-direc.patch -Patch3: criu-amdgpu-plugin-fix.patch Patch4: plugin-dir-path.patch Patch5: criu-ns-python3-shebang.patch BuildRequires: libcap-devel @@ -120,12 +121,7 @@ This package contains all necessary include files and libraries needed to develop applications with CRIU library. %prep -%setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 +%autosetup -p1 # default off echo "BINFMT_MISC_VIRTUALIZED" > .config @@ -145,6 +141,8 @@ make V=1 %{?_smp_mflags} %{?make_options} WERROR=0 \ PREFIX=%{_prefix} \ LIBDIR=%{_libdir} \ LIBEXECDIR=%{_libexecdir} +install -c -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/crit + # remove static libs rm -f %{buildroot}%{_libdir}/lib*.a \ %{buildroot}%{_libexecdir}/compel/*.a @@ -156,7 +154,7 @@ ln -s criu %{buildroot}%{_sbindir}/crtools ln -s criu.8 %{buildroot}%{_mandir}/man8/crtools.8 %if ! %{with_amdgpu_plugin} -rm -f %{buildroot}%{_mandir}/man1/amdgpu_plugin.1 +rm -f %{buildroot}%{_mandir}/man1/criu-amdgpu-plugin.1 %endif %post -n libcriu2 -p /sbin/ldconfig @@ -179,13 +177,14 @@ rm -f %{buildroot}%{_mandir}/man1/amdgpu_plugin.1 %{_mandir}/man8/crtools.8%{?ext_man} %{_libexecdir}/criu %{_libexecdir}/compel -%{python3_sitelib}/crit-*.egg-info +%{python3_sitelib}/*.egg-info +%{python3_sitelib}/crit %{python3_sitelib}/pycriu %if %{with_amdgpu_plugin} %files plugin-amdgpu %doc plugins/amdgpu/README.md -%{_mandir}/man1/amdgpu_plugin.1%{?ext_man} +%{_mandir}/man1/criu-amdgpu-plugin.1%{?ext_man} %dir %{_libdir}/criu %{_libdir}/criu/amdgpu_plugin.so %endif