guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/09: gnu: Add blktrace.


From: guix-commits
Subject: 05/09: gnu: Add blktrace.
Date: Fri, 20 Mar 2020 14:18:17 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit 12eb7bb8af3272bb1f16a9b73a3232e1294bd56f
Author: Vincent Legoll <address@hidden>
AuthorDate: Sun Mar 15 21:25:54 2020 +0100

    gnu: Add blktrace.
    
    * gnu/packages/linux.scm (blktrace): New variable.
    * gnu/packages/patches/blktrace-use-rmtree.patch: Add file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    
    Signed-off-by: Marius Bakke <address@hidden>
---
 gnu/local.mk                                   |  2 ++
 gnu/packages/linux.scm                         | 43 ++++++++++++++++++++++++++
 gnu/packages/patches/blktrace-use-rmtree.patch | 32 +++++++++++++++++++
 3 files changed, 77 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 4fc1818..0207c75 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -27,6 +27,7 @@
 # Copyright © 2019 Brett Gilio <address@hidden>
 # Copyright © 2019 Amin Bandali <address@hidden>
 # Copyright © 2020 Brendan Tildesley <address@hidden>
+# Copyright © 2020 Vincent Legoll <address@hidden>
 #
 # This file is part of GNU Guix.
 #
@@ -766,6 +767,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/binutils-loongson-workaround.patch      \
   %D%/packages/patches/blender-2.79-newer-ffmpeg.patch         \
   %D%/packages/patches/blender-2.79-python-3.7-fix.patch       \
+  %D%/packages/patches/blktrace-use-rmtree.patch               \
   %D%/packages/patches/bluez-CVE-2020-0556.patch               \
   %D%/packages/patches/byobu-writable-status.patch             \
   %D%/packages/patches/calibre-no-updates-dialog.patch         \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0e649d0..12da3c8 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4012,6 +4012,49 @@ system calls, important for the performance of databases 
and other advanced
 applications.")
     (license license:lgpl2.1+)))
 
+(define-public blktrace
+  ;; Take a newer commit to get the fix for CVE-2018-10689.
+  (let ((commit "f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc")
+        (revision "0"))
+    (package
+      (name "blktrace")
+      (version (git-version "1.2.0" revision commit))
+      (home-page
+        "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git";)
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url home-page)
+                      (commit commit)))
+                (sha256
+                 (base32 
"1ihdfimg7mfcgdm6l09xfqx5kdyv42x743dxp3z3w65q5vd7xy89"))
+                (file-name (git-file-name name version))
+                (patches (search-patches "blktrace-use-rmtree.patch"))))
+      (build-system gnu-build-system)
+      (arguments
+       '(#:make-flags
+         (list "CC=gcc" (string-append "prefix=" %output))
+         #:tests? #f ; no tests
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure) ; no configure script
+           (add-after 'unpack 'fix-gnuplot-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((gnuplot (assoc-ref inputs "gnuplot")))
+                 (substitute* "btt/bno_plot.py"
+                   (("gnuplot %s")
+                    (string-append gnuplot "/bin/gnuplot %s")))
+                 #t))))))
+      (inputs
+       `(("libaio" ,libaio)
+         ("gnuplot" ,gnuplot)
+         ("python" ,python-wrapper)))             ;for 'bno_plot.py'
+      (synopsis "Block layer IO tracing mechanism")
+      (description "Blktrace is a block layer IO tracing mechanism which 
provides
+detailed information about request queue operations to user space.  It extracts
+event traces from the kernel (via the relaying through the debug file 
system).")
+      (license license:gpl2))))
+
 (define-public sbc
   (package
     (name "sbc")
diff --git a/gnu/packages/patches/blktrace-use-rmtree.patch 
b/gnu/packages/patches/blktrace-use-rmtree.patch
new file mode 100644
index 0000000..bb0a10d
--- /dev/null
+++ b/gnu/packages/patches/blktrace-use-rmtree.patch
@@ -0,0 +1,32 @@
+From 6d1ce4a3a1a561644695a50c00cbd28494728061 Mon Sep 17 00:00:00 2001
+From: Vincent Legoll <address@hidden>
+Date: Mon, 16 Mar 2020 11:43:19 +0100
+Subject: [PATCH 02/10] bno_plot.py: Use shutil.rmtree() instead of
+ os.system('/bin/rm')
+
+---
+ btt/bno_plot.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/btt/bno_plot.py b/btt/bno_plot.py
+index f05cfdc..36fc524 100644
+--- a/btt/bno_plot.py
++++ b/btt/bno_plot.py
+@@ -40,7 +40,7 @@ To exit the plotter, enter 'quit' or ^D at the 'gnuplot> ' 
prompt.
+ 
+ from __future__ import absolute_import
+ from __future__ import print_function
+-import getopt, glob, os, sys, tempfile
++import getopt, glob, os, sys, tempfile, shutil
+ 
+ verbose       = 0
+ cmds  = """
+@@ -125,4 +125,4 @@ if __name__ == '__main__':
+               sys.exit(1)
+ 
+       os.waitpid(pid, 0)
+-      os.system('/bin/rm -rf ' + tmpdir)
++      shutil.rmtree(tmpdir)
+-- 
+2.20.1
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]