-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·90 lines (80 loc) · 2.43 KB
/
install.sh
File metadata and controls
executable file
·90 lines (80 loc) · 2.43 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# auto: means automatic detect the $libdir
if [ -z $1 ];then
platform="auto"
else
platform=$1
fi
if [ -z $2 ];then
echo "Please input cmd as (sudo ./install [<platform>][<dest install dir>]). "
echo "defalut dir:/"
destdir=""
else
destdir=$2
fi
#multiarch=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
project_path=$(cd `dirname $0`;pwd)
install_pkg_path=$destdir/usr/lib/pkgconfig
install_path=$destdir/usr/lib/openncc
include_path=$destdir/usr/include/openncc
rule_path=$destdir/etc/udev/rules.d
native_lib_path=$project_path/native_vpu_api
resource_path=$native_lib_path/platform_engine
firmware_path=$native_lib_path/firmware
model_path=$project_path/model_zoo
if [ ! -d "$install_path" ];then
mkdir -p $install_path
else
rm -r $install_path
mkdir -p $install_path
fi
if [ ! -d "$include_path" ];then
mkdir -p $include_path
else
rm -r $include_path
mkdir -p $include_path
fi
if [ ! -d "$rule_path" ];then
mkdir -p $rule_path
fi
if [ $platform = "ubuntu" ] || [ $platform = "rk3568" ] || [ $platform = "raspi4" ];then
echo "Starting to install OpenNCC Native libs for $platform"
cd $resource_path/$platform/
./install.sh $install_path
elif [ $platform = "auto" ]; then
if [[ `uname -m` =~ "x86_64" ]]; then
install_arch=ubuntu
elif [[ `uname -m` =~ "aarch64" ]]; then
install_arch=rk3568
elif [[ `uname -m` =~ "armv7l" ]]; then
install_arch=raspi4
else
install_arch=unknown
echo "Unknown platform!"
echo "Please input cmd as (sudo ./install [<platform>]). "
echo "[<platform>]: [ubuntu][rk3568][raspi4]"
exit
fi
echo "Detected ARCH: $install_arch "
cd $resource_path/$install_arch/
./install.sh $install_path
else
echo "Unknown platform!"
echo "Please input cmd as (sudo ./install [<platform>]). "
echo "[<platform>]: [ubuntu][rk3568][raspi4][auto]"
exit
fi
cp $firmware_path/* $install_path
cp $resource_path/include/* $include_path
cp $native_lib_path/96-openncc.rules $rule_path
sudo udevadm control --reload-rules
sudo udevadm trigger
cp -r $model_path $install_path
if [ ! -d "$install_pkg_path" ];then
mkdir $install_pkg_path
fi
#cp -f $native_lib_path/OpenNCC_native.pc $install_pkg_path/
echo "Installing $firmware_path to $install_path"
echo "Installing $resource_path/include to $include_path"
echo "Installing $model_path to $install_path"
echo "Installing $native_lib_path/96-openncc.rules to $rule_path"