-
Notifications
You must be signed in to change notification settings - Fork 942
Expand file tree
/
Copy pathsign_library.sh
More file actions
executable file
·43 lines (36 loc) · 1.08 KB
/
sign_library.sh
File metadata and controls
executable file
·43 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Copyright (c) Qualcomm Innovation Center, Inc.
# All rights reserved
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
if [[ -z $HEXAGON_SDK_ROOT || -z $QNN_SDK_ROOT ]]; then
echo "please export HEXAGON_SDK_ROOT and QNN_SDK_ROOT"
exit -1
fi
usage() {
echo "Usage: Sign the LPAI library for a given LPAI architecture"
echo "e.g.: executorch$ $0 --lpai_arch v6"
exit 1;
}
short=l:,h
long=lpai_arch:,help
args=$(getopt -a -o $short -l $long -n $0 -- $@)
eval set -- $args
lpai_arch=""
while true; do
case $1 in
-l | --lpai_arch) lpai_arch=$2; shift 2;;
-h | --help) usage;;
--) shift; break;;
*) echo "unknown keyword: $1"; usage;;
esac
done
if [[ -z $lpai_arch ]]; then
echo "please specify lpai version"
usage
fi
signed_folder=$QNN_SDK_ROOT/lib/lpai-$lpai_arch/signed
signer=$HEXAGON_SDK_ROOT/tools/elfsigner/elfsigner.py
mkdir -p $signed_folder
yes 2>/dev/null | python $signer -i $QNN_SDK_ROOT/lib/lpai-$lpai_arch/unsigned/libQnnLpaiSkel.so -o $signed_folder