trustfence: make sign script threadsafe
Ensure that the signing script is not executed in parallel. This is required in order to avoid problems during PKI generation and CST usage when building with Yocto or the Android build system. https://jira.digi.com/browse/DEL-2849 Signed-off-by: Diaz de Grenu, Jose <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
parent
e0b7905d67
commit
ed22789224
|
|
@ -22,6 +22,13 @@
|
|||
#
|
||||
#===============================================================================
|
||||
|
||||
# Avoid parallel execution of this script
|
||||
SINGLE_PROCESS_LOCK="/tmp/sign_script.lock.d"
|
||||
trap 'rm -rf "${SINGLE_PROCESS_LOCK}"' INT TERM EXIT
|
||||
while ! mkdir "${SINGLE_PROCESS_LOCK}" > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
SCRIPT_NAME="$(basename ${0})"
|
||||
SCRIPT_PATH="$(cd $(dirname ${0}) && pwd)"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue