debuggers.hg

view tools/vtpm/Makefile @ 20153:4e67ba3c321a

vtpm: Upgrade to using tpm_emulator-0.5.1

The newer version of the emulator contains several bug fixes, one that
we were seeing in our use of vtpm.

This patch also defines TPM_STRONG_PERSISTENCE for the new emulator.

A couple of important notes about this patch:
-This has only been tested on PVM domU's. In theory it should work for
HVM but I have not tried it at all and can guarantee nothing.
-All the relevant changes in tools/vtpm/vtpm.patch have been ported
to tpm_emulator-0.5.1.
-None of the changes in tpm_emulator.patch have been ported. In
particular this means the BUILD_EMULATOR option, which as I understand
lets you use the tpm_emulator in dom0 for a machine that does
not have a real hardware TPM does not work. This functionality should
be easy to add though because the new emulator already comes with a
kernel module interface.
-No considerations were made for the VTPM_MULTI_VM feature (which is
supposedly unfinished). This patch may or may not break any progress
made on that feature.

Signed-off-by: Matt Fioravante <Matthew.Fioravante@jhuapl.edu>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 24 08:08:52 2009 +0100 (2009-08-24)
parents 59d511c4a8d8
children
line source
1 XEN_ROOT = ../..
3 # Base definitions and rules
4 include $(XEN_ROOT)/tools/vtpm/Rules.mk
6 # Dir name for emulator (as dom0 tpm driver)
7 TPM_EMULATOR_DIR = tpm_emulator
8 # Dir name for vtpm instance
9 VTPM_DIR = vtpm
10 ORIG_DIR = orig
12 # Emulator tarball name
13 TPM_EMULATOR_NAME = tpm_emulator-0.5.1
14 TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
16 GMP_HEADER = /usr/include/gmp.h
18 .PHONY: all
19 all: build
21 .PHONY: build
22 build: build_sub
24 .PHONY: install
25 install: build
26 $(MAKE) -C $(VTPM_DIR) $@
28 .PHONY: clean
29 clean:
30 @if [ -d $(TPM_EMULATOR_DIR) ]; \
31 then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
32 fi
33 @if [ -d $(VTPM_DIR) ]; \
34 then $(MAKE) -C $(VTPM_DIR) clean; \
35 fi
37 .PHONY: mrproper
38 mrproper:
39 rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
40 rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
42 # Download Swiss emulator
43 $(TPM_EMULATOR_TARFILE):
44 wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
46 # Create vtpm dirs
47 $(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
48 rm -rf $(VTPM_DIR)
49 tar -xzf $(TPM_EMULATOR_TARFILE)
50 mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
52 set -e; cd $(VTPM_DIR); \
53 patch -p1 < ../vtpm-0.5.1.patch
55 orig: $(TPM_EMULATOR_TARFILE)
56 mkdir $(ORIG_DIR);
57 set -e; cd $(ORIG_DIR); \
58 tar -xzf ../$(TPM_EMULATOR_TARFILE);
60 updatepatches: clean orig
61 find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f;
62 mv vtpm.patch vtpm.patch.old;
63 diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
65 .PHONY: build_sub
66 build_sub: $(VTPM_DIR)/tpmd/tpmd
67 set -e; if [ -e $(GMP_HEADER) ]; then \
68 $(MAKE) -C $(VTPM_DIR); \
69 else \
70 echo "=== Unable to build VTPMs. libgmp could not be found."; \
71 fi