Created attachment 560814 [details, diff] swtpm ebuild Hello, attached is swtpm-0.1.0_p20181212 as well as a live ebuild. swtpm requires libtpms. swtpm is a TPM emulator which is used by qemu to emulate a TPM inside a VM. swtpm also works on hosts a TPM emulator via sockets, and has an options FUSE/CUSE interface. This project hasn't made a stable release yet, however Fedora accepted a snapshot in their repository, so I used the same snapshot they did.
Hi, Can you please compare to what tpm2-software[1] project is using[2]? As far as I understand tpm2-software is a more or less authoritative effort of tpm2. I started to add their releases into the tree. Thanks! [1] https://github.com/tpm2-software [2] https://sourceforge.net/projects/ibmswtpm2/files/
The main difference is QEMU uses swtpm for TPM emulation. That's the purpose of this package, to use an emulated TPM in a QEMU guest.
ok, if it is just for qemu, maybe qemu maintainers can take care of it.
Created attachment 562362 [details, diff] swtpm ebuild and files
Created attachment 562364 [details, diff] swtpm ebuild and files I updated the ebuild so that the tests work
Created attachment 562504 [details, diff] swtpm ebuild and files I polished the ebuild so it'll work with libvirt and virt-manager. TPM 2 should work out of the box, but TPM 1.2 does not unless running libvirt-4.10.0 or later (which is currently unstable). For older versions of libvirt, this can be worked around by uncommenting the "swtpm_user" and "swtpm_group" comments in /etc/libvirt/qemu.conf (should both be set to 'tss').
Created attachment 563466 [details, diff] swtpm ebuild and files Upstream has tagged and generated version 0.1.0, so i've created a new ebuild for it and removed the old Fedora git snapshot.
Created attachment 580206 [details, diff] Make swtpm work with libvirt 5.2.0 The current version of libvirt (5.2.0) does not allow swtpm to work, see https://bugzilla.redhat.com/show_bug.cgi?id=1712556 There are 3 solutions: 1) Apply the above patch picked from the upstream git tree (tested) 2) Upgrade to libvirt 5.4.0 (not in portage) (untested) 3) Apply the workaround in the bug above to /etc/libvirt/qemu.conf (tested)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29420beac9c404288d3c9577958515f6018abd46 commit 29420beac9c404288d3c9577958515f6018abd46 Author: Salah Coronya <salah.coronya@gmail.com> AuthorDate: 2019-08-02 01:55:12 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2019-08-02 11:25:05 +0000 app-crypt/swtpm: New ebuild swtpm is a libtpms TPM emulator. It is used by qemu to emulate a TPM for guests. Closes: https://bugs.gentoo.org/675298 Signed-off-by: Salah Coronya <salah.coronya@gmail.com> Package-Manager: Portage-2.3.66, Repoman-2.3.11 Closes: https://github.com/gentoo/gentoo/pull/11247 Signed-off-by: Joonas Niilola <juippis@gentoo.org> app-crypt/swtpm/Manifest | 1 + .../files/swtpm-disable-test-dependencies.patch | 36 +++++++++++++ app-crypt/swtpm/files/swtpm-fix-localca-path.patch | 29 ++++++++++ app-crypt/swtpm/metadata.xml | 16 ++++++ app-crypt/swtpm/swtpm-0.2.0.ebuild | 63 ++++++++++++++++++++++ 5 files changed, 145 insertions(+)