Update documentation for Cluster-API and Flux
[icn.git] / deploy / kud-plugin-addons / device-plugins / qat / driver / collect_qat_driver.sh
1 #!/bin/bash
2
3 # usage: collect_qat_driver.sh [target]
4
5 set -ex
6
7 if [ $# -ne 1 ] ; then
8     echo "Please input the target folder!"
9     exit 0
10 fi
11
12 VER="0.1"
13 MKDIR_P="mkdir -p"
14 target=$1
15 package=qat1.7.l.4.6.0-00025
16
17 # download driver source package
18 if [ ! -e /tmp/$package.tar.gz ]; then
19     wget -P /tmp https://01.org/sites/default/files/downloads/$package.tar.gz
20 fi
21 cp /tmp/$package.tar.gz .
22
23 # compile
24 $MKDIR_P $package
25 tar xzvf $package.tar.gz -C $package
26 pushd `pwd`
27 cd $package
28 ./configure --enable-icp-sriov=host
29 make
30 popd
31
32 # copy to target
33 $MKDIR_P qat_driver
34 cp -r $package/build/* qat_driver/
35 cp install_qat.sh qat_driver/install.sh
36 cp qat qat_driver/
37
38 if [ ! -d $target/driver ]; then
39     $MKDIR_P $target/driver;
40 fi;
41
42 tar czvf $target/driver/qat_driver-$VER.tar.gz qat_driver/
43
44 # clear
45 rm -rf $package
46 rm -rf qat_driver
47 rm $package.tar.gz