[packages/tpm_emulator] - fix building with linux 3.19 - rel 13

baggins baggins at pld-linux.org
Mon Mar 30 21:21:02 CEST 2015


commit 8fe378a1a0419d4703ffe093042d78f4b115f1bb
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Mar 30 21:20:43 2015 +0200

    - fix building with linux 3.19
    - rel 13

 linux-3.19.patch  | 37 +++++++++++++++++++++++++++++++++++++
 tpm_emulator.spec |  4 +++-
 2 files changed, 40 insertions(+), 1 deletion(-)
---
diff --git a/tpm_emulator.spec b/tpm_emulator.spec
index 0f5d53e..5ffb160 100644
--- a/tpm_emulator.spec
+++ b/tpm_emulator.spec
@@ -21,7 +21,7 @@ exit 1
 %define		_duplicate_files_terminate_build	0
 
 %define	pname	tpm_emulator
-%define	rel	12
+%define	rel	13
 Summary:	Software-based TPM and MTM Emulator
 Summary(pl.UTF-8):	Programowy emulator TPM i MTM
 Name:		%{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
@@ -32,6 +32,7 @@ Group:		Applications/System
 Source0:	http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz
 # Source0-md5:	e26becb8a6a2b6695f6b3e8097593db8
 Patch0:		%{pname}-libdir.patch
+Patch1:		linux-3.19.patch
 URL:		http://tpm-emulator.berlios.de/
 BuildRequires:	cmake >= 2.4
 BuildRequires:	gmp-devel
@@ -122,6 +123,7 @@ przekazujący odebrane polecenia do tpmd.\
 %prep
 %setup -q -n %{pname}-%{version}
 %patch0 -p1
+%patch1 -p1
 
 # separate kernel module from userspace build
 echo > tpmd_dev/CMakeLists.txt
diff --git a/linux-3.19.patch b/linux-3.19.patch
new file mode 100644
index 0000000..f92ce8e
--- /dev/null
+++ b/linux-3.19.patch
@@ -0,0 +1,37 @@
+--- tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c~	2011-12-20 19:30:06.000000000 +0100
++++ tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c	2015-03-30 21:19:18.288861679 +0200
+@@ -25,6 +25,8 @@
+ #include <linux/net.h>
+ #include <linux/un.h>
+ 
++#include <linux/version.h>
++
+ #include "config.h"
+ 
+ #define TPM_DEVICE_MINOR  224
+@@ -108,8 +108,12 @@
+   memset(&msg, 0, sizeof(msg));
+   iov.iov_base = (void*)in;
+   iov.iov_len = in_size;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+   msg.msg_iov = &iov;
+   msg.msg_iovlen = 1;
++#else
++  iov_iter_init(&msg.msg_iter, WRITE, &iov, 1, 1);
++#endif
+   res = sock_sendmsg(tpmd_sock, &msg, in_size);
+   if (res < 0) {
+     error("sock_sendmsg() failed: %d\n", res);
+@@ -122,8 +126,12 @@
+   memset(&msg, 0, sizeof(msg));
+   iov.iov_base = (void*)tpm_response.data;
+   iov.iov_len = tpm_response.size;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+   msg.msg_iov = &iov;
+   msg.msg_iovlen = 1;
++#else
++  iov_iter_init(&msg.msg_iter, READ, &iov, 1, 1);
++#endif
+   oldmm = get_fs();
+   set_fs(KERNEL_DS);
+   res = sock_recvmsg(tpmd_sock, &msg, tpm_response.size, 0);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tpm_emulator.git/commitdiff/8fe378a1a0419d4703ffe093042d78f4b115f1bb



More information about the pld-cvs-commit mailing list