* [ptxdist] [PATCH v2] optee-client: add the "Open Portable Trusted Execution Environment" client
@ 2017-06-12 17:08 Marc Kleine-Budde
0 siblings, 0 replies; only message in thread
From: Marc Kleine-Budde @ 2017-06-12 17:08 UTC (permalink / raw)
To: ptxdist; +Cc: Marc Kleine-Budde
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes since v1
- fix shared libs installation
...eserve-links-to-libraries-during-make-cop.patch | 27 ++++++++++
...efile-create-relative-links-to-shared-lib.patch | 30 +++++++++++
patches/optee-client-2.4.0/series | 5 ++
rules/optee-client.in | 13 +++++
rules/optee-client.make | 59 ++++++++++++++++++++++
5 files changed, 134 insertions(+)
create mode 100644 patches/optee-client-2.4.0/0001-Makefile-preserve-links-to-libraries-during-make-cop.patch
create mode 100644 patches/optee-client-2.4.0/0002-libteec-Makefile-create-relative-links-to-shared-lib.patch
create mode 100644 patches/optee-client-2.4.0/series
create mode 100644 rules/optee-client.in
create mode 100644 rules/optee-client.make
diff --git a/patches/optee-client-2.4.0/0001-Makefile-preserve-links-to-libraries-during-make-cop.patch b/patches/optee-client-2.4.0/0001-Makefile-preserve-links-to-libraries-during-make-cop.patch
new file mode 100644
index 000000000000..e7616e29ec87
--- /dev/null
+++ b/patches/optee-client-2.4.0/0001-Makefile-preserve-links-to-libraries-during-make-cop.patch
@@ -0,0 +1,27 @@
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Mon, 12 Jun 2017 17:13:30 +0200
+Subject: [PATCH] Makefile: preserve links to libraries during make copy_export
+
+During "make copy_export" and "make install" the shared library is
+copied into the LIBDIR. However "cp" is used, thus the links to the
+shared library are not preserved. This patch fixes the problem by using
+"cp -a" instead.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c7462479e5fe..4c2d45851543 100644
+--- a/Makefile
++++ b/Makefile
+@@ -128,7 +128,7 @@ distclean: clean
+
+ copy_export: build
+ mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCLUDEDIR)
+- cp ${O}/libteec/libteec.so* $(DESTDIR)$(LIBDIR)
++ cp -a ${O}/libteec/libteec.so* $(DESTDIR)$(LIBDIR)
+ if [ "$(BUILD-LIBSQLFS)" ]; then cp ${O}/libsqlfs/libsqlfs.so* $(DESTDIR)$(LIBDIR); fi
+ cp ${O}/tee-supplicant/tee-supplicant $(DESTDIR)$(BINDIR)
+ cp public/*.h $(DESTDIR)$(INCLUDEDIR)
diff --git a/patches/optee-client-2.4.0/0002-libteec-Makefile-create-relative-links-to-shared-lib.patch b/patches/optee-client-2.4.0/0002-libteec-Makefile-create-relative-links-to-shared-lib.patch
new file mode 100644
index 000000000000..0b9efe3942a1
--- /dev/null
+++ b/patches/optee-client-2.4.0/0002-libteec-Makefile-create-relative-links-to-shared-lib.patch
@@ -0,0 +1,30 @@
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Mon, 12 Jun 2017 17:55:32 +0200
+Subject: [PATCH] libteec/Makefile: create relative links to shared library
+ instead of absolute ones
+
+Absolute paths in link targets are ugly and there is always a risk that
+they may be packaged incorrectly. Further the *.so* files are always
+expected to reside in the same directory. This patch fixes this problem.
+
+Suggested-by: Jerome Forissier <jerome.forissier@linaro.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ libteec/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libteec/Makefile b/libteec/Makefile
+index 66055a723a2d..f40898569e9e 100644
+--- a/libteec/Makefile
++++ b/libteec/Makefile
+@@ -33,8 +33,8 @@ TEEC_LFLAGS := -lpthread
+ TEEC_LIBRARY := $(OUT_DIR)/$(LIB_MAJ_MIN)
+
+ libteec: $(TEEC_LIBRARY)
+- $(VPREFIX)ln -sf $(TEEC_LIBRARY) $(OUT_DIR)/$(LIB_MAJOR)
+- $(VPREFIX)ln -sf $(OUT_DIR)/$(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME)
++ $(VPREFIX)ln -sf $(LIB_MAJ_MIN) $(OUT_DIR)/$(LIB_MAJOR)
++ $(VPREFIX)ln -sf $(LIB_MAJOR) $(OUT_DIR)/$(LIB_NAME)
+
+ $(TEEC_LIBRARY): $(TEEC_OBJS)
+ @echo " LINK $@"
diff --git a/patches/optee-client-2.4.0/series b/patches/optee-client-2.4.0/series
new file mode 100644
index 000000000000..a5150ee471bc
--- /dev/null
+++ b/patches/optee-client-2.4.0/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Makefile-preserve-links-to-libraries-during-make-cop.patch
+0002-libteec-Makefile-create-relative-links-to-shared-lib.patch
+# 6e062706c976942f1f2f5f9c2c524618 - git-ptx-patches magic
diff --git a/rules/optee-client.in b/rules/optee-client.in
new file mode 100644
index 000000000000..9099b4c48adb
--- /dev/null
+++ b/rules/optee-client.in
@@ -0,0 +1,13 @@
+## SECTION=security
+
+config OPTEE_CLIENT
+ tristate
+ prompt "optee-client"
+ help
+ Open Portable Trusted Execution Environment Client API.
+
+ This package contains libteec.so, which is the library that
+ contains that API for communication with the Trusted OS. And
+ a binary tee-supplicant which is a daemon serving the
+ Trusted OS in secure world with miscellaneous features, such
+ as file system access.
diff --git a/rules/optee-client.make b/rules/optee-client.make
new file mode 100644
index 000000000000..25835ed1e56b
--- /dev/null
+++ b/rules/optee-client.make
@@ -0,0 +1,59 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Marc Kleine-Budde <mkl@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_OPTEE_CLIENT) += optee-client
+
+#
+# Paths and names
+#
+OPTEE_CLIENT_VERSION := 2.4.0
+OPTEE_CLIENT_MD5 := 5c27298b0e28aa9b28d18e44c79cc66d
+OPTEE_CLIENT := optee-client-$(OPTEE_CLIENT_VERSION)
+OPTEE_CLIENT_SUFFIX := tar.gz
+OPTEE_CLIENT_URL := https://github.com/OP-TEE/optee_client/archive/$(OPTEE_CLIENT_VERSION).$(OPTEE_CLIENT_SUFFIX)
+OPTEE_CLIENT_SOURCE := $(SRCDIR)/$(OPTEE_CLIENT).$(OPTEE_CLIENT_SUFFIX)
+OPTEE_CLIENT_DIR := $(BUILDDIR)/$(OPTEE_CLIENT)
+OPTEE_CLIENT_LICENSE := BSD-2-Clause
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+OPTEE_CLIENT_CONF_TOOL := NO
+OPTEE_CLIENT_MAKE_ENV := \
+ $(CROSS_ENV) \
+ LIBDIR=/usr/lib \
+ BINDIR=/usr/bin \
+ INCLUDEDIR=/usr/include
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/optee-client.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, optee-client)
+ @$(call install_fixup, optee-client,PRIORITY,optional)
+ @$(call install_fixup, optee-client,SECTION,base)
+ @$(call install_fixup, optee-client,AUTHOR,"Marc Kleine-Budde <mkl@pengutronix.de>")
+ @$(call install_fixup, optee-client,DESCRIPTION,missing)
+
+ @$(call install_lib, optee-client, 0, 0, 0644, libteec)
+ @$(call install_copy, optee-client, 0, 0, 0755, -, /usr/bin/tee-supplicant)
+
+ @$(call install_finish, optee-client)
+
+ @$(call touch)
+
+# vim: syntax=make
--
2.11.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-12 17:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 17:08 [ptxdist] [PATCH v2] optee-client: add the "Open Portable Trusted Execution Environment" client Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox