PeterHuewe / tpm-emulator

The famous tpm-emulator by Mario Strasser, previously hosted on BerliOs. It supports TPM1.2 only!
GNU General Public License v2.0
177 stars 75 forks source link

tpm-emulator make on ubuntu14.04 #23

Closed kettyjun closed 5 years ago

kettyjun commented 7 years ago

Hello,everyone! When I make tpm emulator on Ubuntu 14.04, it return with some errors:

`[ 98%] Generating linux/tpmd_dev.ko
/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c: In function ‘tpmd_handle_command’:
/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c:111:6: error: ‘struct msghdr’ has no member named ‘msg_iov’
   msg.msg_iov = &iov;
      ^
/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c:112:6: error: ‘struct msghdr’ has no member named ‘msg_iovlen’
   msg.msg_iovlen = 1;
      ^
/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c:125:6: error: ‘struct msghdr’ has no member named ‘msg_iov’
   msg.msg_iov = &iov;
      ^
/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.c:126:6: error: ‘struct msghdr’ has no member named ‘msg_iovlen’
   msg.msg_iovlen = 1;
      ^
make[5]: *** [/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux/tpmd_dev.o] Error 1
make[4]: *** [_module_/home/ketty/TPM/tpm-emulator/build/tpmd_dev/linux] Error 2
make[3]: *** [all] Error 2
make[2]: *** [tpmd_dev/linux/tpmd_dev.ko] Error 2
make[1]: *** [tpmd_dev/CMakeFiles/tpmd_dev.dir/all] Error 2
make: *** [all] Error 2
`

I had follow https://github.com/PeterHuewe/tpm-emulator/issues/7#issuecomment-227621114, insert

`#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`

But when I make it again, what I had inserted was missing, all back to the original.

[PeterHuewe: edited your post to have proper formatting]

PeterHuewe commented 7 years ago

@kettyjun can you simply tryout the patch from https://github.com/PeterHuewe/tpm-emulator/pull/21 ?

Or rather use latest master please.

Peter

PeterHuewe commented 5 years ago

This should be fixed with latest master. Closing it. If the Problem still persists please comment and I will reopen it.