changeset 10707:dbf1500f9fbb

6886809 SUNWtpm has implied prerequisite depend on package, SUNWrmodr, but is using common depend file
author Wyllys Ingersoll <wyllys.ingersoll@sun.com>
date Fri, 02 Oct 2009 08:10:43 -0700
parents c76698327301
children c68a5b74788e
files usr/src/pkgdefs/SUNWtpm/Makefile usr/src/pkgdefs/SUNWtpm/postinstall.tmpl
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkgdefs/SUNWtpm/Makefile	Fri Oct 02 14:03:51 2009 +0100
+++ b/usr/src/pkgdefs/SUNWtpm/Makefile	Fri Oct 02 08:10:43 2009 -0700
@@ -27,9 +27,21 @@
 TMPLFILES += postinstall preremove
 DATAFILES += depend
 
+ACTION=grep SUNWrmodr depend > /dev/null || \
+	(chmod 666 depend; \
+	echo "P SUNWrmodr	Realmode Modules, (Root)" >> depend; \
+	chmod 444 depend;)
+
 .KEEP_STATE:
 
-all: $(FILES)
+all: $(FILES) action_$(MACH)
+
+action_i386: depend
+	$(ACTION)
+	touch $@
+
+action_sparc:
+
 install: all pkg
 
 include ../Makefile.targ
--- a/usr/src/pkgdefs/SUNWtpm/postinstall.tmpl	Fri Oct 02 14:03:51 2009 +0100
+++ b/usr/src/pkgdefs/SUNWtpm/postinstall.tmpl	Fri Oct 02 08:10:43 2009 -0700
@@ -80,7 +80,12 @@
 # Add entry to /etc/devlink.tab if not there already
 # Note: the tab after ${DRV} here is important.
 if [ "${ISA_TYPE}" = "${ISA_TYPE_I386}" ]; then
-	add_acpi
+	/usr/bin/pkginfo SUNWrmodr > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "The SUNWrmodr package must be installed in order for TPM device to be recognized"
+	else
+		add_acpi
+	fi
 	add_driver
 else 
 	if [ "${ISA_TYPE}" = "${ISA_TYPE_SPARC}" -a "${MACH}" = "sun4v" ]; then