From 0a9644dac8bbc494f35efdc64dbcf0a97bf05a49 Mon Sep 17 00:00:00 2001
From: Jerome Forissier <jerome.forissier@linaro.org>
Date: Fri, 17 Aug 2018 10:34:59 +0200
Subject: [PATCH] buildroot: tee-supplicant: use -d (daemonize) option and
 print OK/FAIL

Init scripts normally print OK or FAIL when they start daemons. Update
our tee-supplicant script to do just that. The -d option to tee-supplicant
is used so that when the tee-supplicant command returns, we  know for sure
if initialization went well or not.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 br-ext/package/optee_client/S30optee | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/br-ext/package/optee_client/S30optee b/br-ext/package/optee_client/S30optee
index c893243..11d9993 100755
--- a/br-ext/package/optee_client/S30optee
+++ b/br-ext/package/optee_client/S30optee
@@ -7,9 +7,9 @@
 case "$1" in
     start)
 	if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
-		echo "Starting tee-supplicant..."
-		/usr/sbin/tee-supplicant &
-		exit 0
+		printf "Starting tee-supplicant... "
+		/usr/sbin/tee-supplicant -d
+		[ $? = 0 ] && echo "OK" || echo "FAIL"
 	else
 		echo "tee-supplicant or TEE device not found"
 		exit 1
-- 
GitLab