From 3f90f83576453238cda99e92a0999413ad6c55d4 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 Oct 2021 14:35:37 +0200 Subject: gnu: criu: Build from Git sources. This in preparation for 3.16.1 which lacks a stable tarball. * gnu/packages/virtualization.scm (criu)[source]: Use GIT-FETCH and GIT-FILE-NAME. --- gnu/packages/virtualization.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 41b405a7f0..4fe1663cd9 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1545,13 +1545,15 @@ domains, their live performance and resource utilization statistics.") (package (name "criu") (version "3.16") - (source (origin - (method url-fetch) - (uri (string-append "https://download.openvz.org/criu/criu-" - version ".tar.bz2")) - (sha256 - (base32 - "13x4s7nms3ckb016d03icdsrw4k6f7i33qz9n84fzhmibm0grj70")))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/checkpoint-restore/criu") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1ddgmsry4k1ialbj0rwfcdrcsazdn72py7a084wjwb4g0al1jg9l")))) (build-system gnu-build-system) (arguments `(#:test-target "test" -- cgit v1.2.3 From c07266dee5a08160d98ec725052db35a8cc33686 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 Oct 2021 14:44:01 +0200 Subject: gnu: criu: Delete custom 'configure phase. * gnu/packages/virtualization.scm (criu)[arguments]: Delete 'configure phase. --- gnu/packages/virtualization.scm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 4fe1663cd9..e9217dc0ec 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1568,14 +1568,8 @@ domains, their live performance and resource utilization statistics.") "/bin/xmlto")) #:phases (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key inputs #:allow-other-keys) - ;; The includes for libnl are located in a sub-directory. - (setenv "C_INCLUDE_PATH" - (string-append (assoc-ref inputs "libnl") - "/include/libnl3:" - (or (getenv "C_INCLUDE_PATH") ""))))) - (add-after 'configure 'fix-documentation + (delete 'configure) ; no configure script + (add-after 'unpack 'fix-documentation (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "Documentation/Makefile" (("-m custom.xsl") -- cgit v1.2.3 From b16b9f85bef0c2966837912c59f81670cf8e26ef Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 Oct 2021 14:37:08 +0200 Subject: gnu: criu: Update to 3.16.1. * gnu/packages/virtualization.scm (criu): Update to 3.16.1. --- gnu/packages/virtualization.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index e9217dc0ec..3ed25ccc85 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1544,7 +1544,7 @@ domains, their live performance and resource utilization statistics.") (define-public criu (package (name "criu") - (version "3.16") + (version "3.16.1") (source (origin (method git-fetch) @@ -1553,7 +1553,7 @@ domains, their live performance and resource utilization statistics.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1ddgmsry4k1ialbj0rwfcdrcsazdn72py7a084wjwb4g0al1jg9l")))) + (base32 "1riw15197fnrs254jl7wks9x8bdml76kf1vnqkkgyypr13dnq55g")))) (build-system gnu-build-system) (arguments `(#:test-target "test" -- cgit v1.2.3 From 04542d5a6fffbff80fa429c6186098537751b33e Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 21 Oct 2021 15:38:46 +0200 Subject: gnu: criu: Fix PYTHONPATH & switch to Python 3 to build criu-ns. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/virtualization.scm (criu)[arguments]: Set PYTHON in #:make-flags instead of ‘hard-coding’ it later. Replace the forever-broken 'wrap phase with one that doesn't attempt to support ‘--with-input’ for now. [inputs]: Substitute python and python-protobuf for python-2 and python2-protobuf, respectively, and remove python2-ipaddr. --- gnu/packages/virtualization.scm | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 3ed25ccc85..fb6e8ebfa3 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -1564,6 +1564,7 @@ domains, their live performance and resource utilization statistics.") "/lib") (string-append "ASCIIDOC=" (assoc-ref %build-inputs "asciidoc") "/bin/asciidoc") + (string-append "PYTHON=python3") (string-append "XMLTO=" (assoc-ref %build-inputs "xmlto") "/bin/xmlto")) #:phases @@ -1583,14 +1584,7 @@ domains, their live performance and resource utilization statistics.") (lambda* (#:key inputs #:allow-other-keys) ;; Hardcode arm version detection (substitute* "Makefile" - (("ARMV.*:=.*") "ARMV := 7\n")) - ;; We are currently using python-2 - (substitute* "crit/Makefile" - (("\\$\\(PYTHON\\)") "python2")) - (substitute* "lib/Makefile" - (("\\$\\(PYTHON\\)") - (string-append (assoc-ref inputs "python") - "/bin/python"))))) + (("ARMV.*:=.*") "ARMV := 7\n")))) (add-before 'build 'fix-symlink (lambda* (#:key inputs #:allow-other-keys) ;; The file 'images/google/protobuf/descriptor.proto' points to @@ -1604,15 +1598,14 @@ domains, their live performance and resource utilization statistics.") (add-after 'install 'wrap (lambda* (#:key inputs outputs #:allow-other-keys) ;; Make sure 'crit' runs with the correct PYTHONPATH. - (let* ((out (assoc-ref outputs "out")) - (path (string-append out - "/lib/python" - (string-take (string-take-right - (assoc-ref inputs "python") 5) 3) - "/site-packages:" - (getenv "PYTHONPATH")))) + (let* ((out (assoc-ref outputs "out")) + (site (string-append out "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages")) + (path (getenv "PYTHONPATH"))) (wrap-program (string-append out "/bin/crit") - `("PYTHONPATH" ":" prefix (,path)))))) + `("PYTHONPATH" ":" prefix (,site ,path)))))) (add-after 'install 'delete-static-libraries ;; Not building/installing these at all doesn't seem to be supported. (lambda* (#:key outputs #:allow-other-keys) @@ -1620,9 +1613,8 @@ domains, their live performance and resource utilization statistics.") (for-each delete-file (find-files out "\\.a$")))))))) (inputs `(("protobuf" ,protobuf) - ("python" ,python-2) - ("python2-protobuf" ,python2-protobuf) - ("python2-ipaddr" ,python2-ipaddr) + ("python" ,python) + ("python-protobuf" ,python-protobuf) ("iproute" ,iproute) ("libaio" ,libaio) ("libcap" ,libcap) -- cgit v1.2.3 From fa6b5f5043c098f8ce0c7b73c9b7e4688cc33034 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 23 Oct 2021 14:01:27 +0200 Subject: gnu: xen: Fetch Git sources over HTTPS. * gnu/packages/virtualization.scm (xen)[source, native-inputs]: Clone the xen and mini-os repositories over HTTPS. --- gnu/packages/virtualization.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index fb6e8ebfa3..ecde4aec9e 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -2012,7 +2012,7 @@ DOS or Microsoft Windows.") (source (origin (method git-fetch) (uri (git-reference - (url "git://xenbits.xenproject.org/xen.git") + (url "https://xenbits.xen.org/git-http/xen.git") (commit (string-append "RELEASE-" version)))) (file-name (git-file-name name version)) (sha256 @@ -2184,7 +2184,7 @@ override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc")) ,(origin (method git-fetch) (uri (git-reference - (url "http://xenbits.xen.org/git-http/mini-os.git") + (url "https://xenbits.xen.org/git-http/mini-os.git") (commit (string-append "xen-RELEASE-" version)))) (sha256 (base32 -- cgit v1.2.3 From 7635279100147fc7cec97e0c0046f5871c26f380 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sat, 23 Oct 2021 14:03:10 +0200 Subject: gnu: xen: Fix upstream hash mismatch. * gnu/packages/virtualization.scm (xen)[native-inputs]: Fetch mini-os by Git its commit rather than an unstable tag. --- gnu/packages/virtualization.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index ecde4aec9e..15040d65a8 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -2008,7 +2008,7 @@ DOS or Microsoft Windows.") (define-public xen (package (name "xen") - (version "4.14.1") + (version "4.14.1") ; please update the mini-os input as well (source (origin (method git-fetch) (uri (git-reference @@ -2185,10 +2185,12 @@ override CC = " (assoc-ref inputs "cross-gcc") "/bin/i686-linux-gnu-gcc")) (method git-fetch) (uri (git-reference (url "https://xenbits.xen.org/git-http/mini-os.git") - (commit (string-append "xen-RELEASE-" version)))) + ;; This corresponds to (string-append "xen-RELEASE-" version)) + ;; at time of packaging, but upstream has unfortunately modified + ;; existing tags in the past. + (commit "0b4b7897e08b967a09bed2028a79fabff82342dd"))) (sha256 - (base32 - "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f")) + (base32 "1i8pcl19n60i2m9vlg79q3nknpj209c9ic5x10wxaicx45kc107f")) (file-name "mini-os-git-checkout"))) ("perl" ,perl) ; TODO: markdown -- cgit v1.2.3 From 142344b6efa42e1a4d57a4bdf14dfb3ca1cba25a Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 23 Oct 2021 12:03:18 +0200 Subject: gnu: qemu: Add Guix support to QEMU guest agent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QEMU guest agent hardcodes paths to /sbin/hwclock and /sbin/shutdown. Patch the source to try binaries under /run/current-system/profile/sbin first. * gnu/packages/patches/qemu-fix-agent-paths.patch: New file. * gnu/local.mk (dist_patch_DATA): Register the patch. * gnu/packages/virtualization.scm (qemu)[origin]: Apply it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/patches/qemu-fix-agent-paths.patch | 66 +++++++++++++++++++++++++ gnu/packages/virtualization.scm | 3 +- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/qemu-fix-agent-paths.patch (limited to 'gnu/packages/virtualization.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 3a849ed2b0..baba6be058 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1707,6 +1707,7 @@ dist_patch_DATA = \ %D%/packages/patches/qemu-CVE-2021-20203.patch \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qemu-glibc-2.30.patch \ + %D%/packages/patches/qemu-fix-agent-paths.patch \ %D%/packages/patches/qpdfview-qt515-compat.patch \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ diff --git a/gnu/packages/patches/qemu-fix-agent-paths.patch b/gnu/packages/patches/qemu-fix-agent-paths.patch new file mode 100644 index 0000000000..bae62fadbf --- /dev/null +++ b/gnu/packages/patches/qemu-fix-agent-paths.patch @@ -0,0 +1,66 @@ +Allow a QEMU host to set the time and shutdown Guix guests. Styled +after the patch from the Nix package: + +https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/virtualization/qemu/fix-qemu-ga.patch + +diff --git a/qga/commands-posix.c b/qga/commands-posix.c +index 75dbaab..b416b03 100644 +--- a/qga/commands-posix.c ++++ b/qga/commands-posix.c +@@ -84,6 +84,7 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp) + void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + { + const char *shutdown_flag; ++ const char *command; + Error *local_err = NULL; + pid_t pid; + int status; +@@ -91,10 +92,13 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + slog("guest-shutdown called, mode: %s", mode); + if (!has_mode || strcmp(mode, "powerdown") == 0) { + shutdown_flag = "-P"; ++ command = "shutdown"; + } else if (strcmp(mode, "halt") == 0) { + shutdown_flag = "-H"; ++ command = "halt"; + } else if (strcmp(mode, "reboot") == 0) { + shutdown_flag = "-r"; ++ command = "reboot"; + } else { + error_setg(errp, + "mode is invalid (valid values are: halt|powerdown|reboot"); +@@ -109,6 +113,11 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp) + reopen_fd_to_null(1); + reopen_fd_to_null(2); + ++ /* try Guix’s shutdown/halt/reboot first */ ++ char *path = g_strdup_printf("/run/current-system/profile/sbin/%s", command); ++ execle(path, command, (char *)NULL, environ); ++ g_free(path); ++ + execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", + "hypervisor initiated shutdown", (char *)NULL, environ); + _exit(EXIT_FAILURE); +@@ -158,10 +167,12 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp) + Error *local_err = NULL; + struct timeval tv; + static const char hwclock_path[] = "/sbin/hwclock"; ++ static const char hwclock_path_guix[] = "/run/current-system/profile/sbin/hwclock"; + static int hwclock_available = -1; + + if (hwclock_available < 0) { +- hwclock_available = (access(hwclock_path, X_OK) == 0); ++ hwclock_available = (access(hwclock_path_guix, X_OK) == 0) || ++ (access(hwclock_path, X_OK) == 0); + } + + if (!hwclock_available) { +@@ -207,6 +218,8 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns, Error **errp) + + /* Use '/sbin/hwclock -w' to set RTC from the system time, + * or '/sbin/hwclock -s' to set the system time from RTC. */ ++ execle(hwclock_path_guix, "hwclock", has_time ? "-w" : "-s", ++ NULL, environ); + execle(hwclock_path, "hwclock", has_time ? "-w" : "-s", + NULL, environ); + _exit(EXIT_FAILURE); diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index 15040d65a8..7da6345c63 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -159,7 +159,8 @@ (base32 "15iw7982g6vc4jy1l9kk1z9sl5bm1bdbwr74y7nvwjs1nffhig7f")) (patches (search-patches "qemu-CVE-2021-20203.patch" - "qemu-build-info-manual.patch")) + "qemu-build-info-manual.patch" + "qemu-fix-agent-paths.patch")) (modules '((guix build utils))) (snippet '(begin -- cgit v1.2.3