Skip to contentSkip to conversation

Upgrade vtpmd to 0.7.2

PATCH In review Matthew Fioravante 1 participant 2 messages Mar 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Upgrade vtpmd to 0.7.2

The following patch upgrades vtpmd from version 0.5.1 to 0.7.2.

Note that version 0.7.2 requires cmake to build. So if building xen tools now with VTPM_TOOLS=y, cmake will be required on the host system.

This patch is standalone from all the subsequent patches I will be submitting for the vtpm and vtpm manager mini-os domains.

tools/vtpm/Makefile +22 -25
diff -Naur xen-unstable-trp-sdp-pristine/tools/vtpm/Makefile xen-unstable-trp-sdp/tools/vtpm/Makefile
@@ -3,16 +3,21 @@
 # Base definitions and rules
 include $(XEN_ROOT)/tools/vtpm/Rules.mk
 
-# Dir name for emulator (as dom0 tpm driver)
-TPM_EMULATOR_DIR = tpm_emulator
 # Dir name for vtpm instance
 VTPM_DIR = vtpm
 ORIG_DIR = orig
 
 # Emulator tarball name
-TPM_EMULATOR_NAME = tpm_emulator-0.5.1
+ifeq ($(APL_INTERNAL), y)
+TPM_EMULATOR_URL = http://msvp-his.jhuapl.edu/xen-extfiles
+else
+TPM_EMULATOR_URL = http://download.berlios.de/tpm-emulator
+endif
+TPM_EMULATOR_NAME = tpm_emulator-0.7.2
 TPM_EMULATOR_TARFILE = $(TPM_EMULATOR_NAME).tar.gz
 
+VTPM_PATCH = vtpm-0.7.2.patch
+
 GMP_HEADER = /usr/include/gmp.h
 
 .PHONY: all
@@ -23,50 +28,42 @@
 
 .PHONY: install
 install: build
-	$(MAKE) -C $(VTPM_DIR) $@
+	install -m 0755 $(VTPM_DIR)/build/tpmd/unix/tpmd $(TOOLS_INSTALL_DIR)/vtpmd
 
 .PHONY: clean
 clean:
-	@if [ -d $(TPM_EMULATOR_DIR) ]; \
-		then $(MAKE) -C $(TPM_EMULATOR_DIR) clean; \
-	fi
-	@if [ -d $(VTPM_DIR) ]; \
-		then $(MAKE) -C $(VTPM_DIR) clean; \
+	@-if [ -d $(VTPM_DIR)/build ]; \
+		then $(MAKE) -C $(VTPM_DIR)/build clean; \
 	fi
 
 .PHONY: mrproper
 mrproper:
-	rm -f $(TPM_EMULATOR_TARFILE) tpm_emulator.patch.old vtpm.patch.old
-	rm -rf $(TPM_EMULATOR_DIR) $(VTPM_DIR) $(ORIG_DIR)
+	rm -f $(TPM_EMULATOR_TARFILE) 
+	rm -rf $(VTPM_DIR) $(ORIG_DIR)
 
 # Download Swiss emulator
 $(TPM_EMULATOR_TARFILE):
-	wget http://download.berlios.de/tpm-emulator/$(TPM_EMULATOR_TARFILE)
+	wget $(TPM_EMULATOR_URL)/$(TPM_EMULATOR_TARFILE)
 
 # Create vtpm dirs
-$(VTPM_DIR)/tpmd/tpmd: $(TPM_EMULATOR_TARFILE) vtpm-0.5.1.patch
+$(VTPM_DIR)/build: $(TPM_EMULATOR_TARFILE) $(VTPM_PATCH)
+	@if ! which cmake &>/dev/null; then echo "cmake not found in PATH. Please install cmake!"; false; fi
 	rm -rf $(VTPM_DIR)
 	tar -xzf $(TPM_EMULATOR_TARFILE)
 	mv $(TPM_EMULATOR_NAME) $(VTPM_DIR)
 
 	set -e; cd $(VTPM_DIR); \
-	patch -p1 < ../vtpm-0.5.1.patch
+	patch -p1 < ../$(VTPM_PATCH); \
+	mkdir build; cd build; cmake -DCMAKE_INSTALL_PREFIX=/usr ..
+	touch $@
 
 orig: $(TPM_EMULATOR_TARFILE)
 	mkdir $(ORIG_DIR);
 	set -e; cd $(ORIG_DIR); \
 	tar -xzf ../$(TPM_EMULATOR_TARFILE);
 
-updatepatches: clean orig
-	find $(VTPM_DIR) -name "*.orig" -print | xargs rm -f; 
-	mv vtpm.patch vtpm.patch.old; 
-	diff -uprN $(TPM_EMULATOR_DIR) $(VTPM_DIR) > vtpm.patch || true;
-
 .PHONY: build_sub
-build_sub: $(VTPM_DIR)/tpmd/tpmd
-	set -e; if [ -e $(GMP_HEADER) ]; then \
-		$(MAKE) -C $(VTPM_DIR); \
-	else \
-		echo "=== Unable to build VTPMs. libgmp could not be found."; \
-	fi
+build_sub: $(VTPM_DIR)/build
+	set -e; \
+	cd $<; $(MAKE) tpmd
 
tools/vtpm/Rules.mk +0 -2
diff -Naur xen-unstable-trp-sdp-pristine/tools/vtpm/Rules.mk xen-unstable-trp-sdp/tools/vtpm/Rules.mk
@@ -23,7 +23,5 @@
 
 -include $(DEPS)
 
-BUILD_EMULATOR = y
-
 # Make sure these are just rules
 .PHONY : all build install clean
tools/vtpm/tpm_emulator.patch +0 -1919

1,919 lines not on this page · raw message

tools/vtpm/vtpm-0.5.1.patch +0 -766

766 lines not on this page · raw message

tools/vtpm/vtpm-0.7.2.patch +647 -0

220 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Part of the diff is not shown here. View the raw message.

#1 lore raw

Also:

Signed off by: Matthew Fioravante <[email protected]>

Quoted 5 lines · Matthew Fioravante

The following patch upgrades vtpmd from version 0.5.1 to 0.7.2.

Note that version 0.7.2 requires cmake to build. So if building xen tools now with VTPM_TOOLS=y, cmake will be required on the host system.

This patch is standalone from all the subsequent patches I will be submitting for the vtpm and vtpm manager mini-os domains.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel