update the info yaml
[icn.git] / tools / cloud-configs.sh
1 #!/usr/bin/env bash
2 set -eu -o pipefail
3
4 # This script is called by cloud-init on worker nodes
5 # What does this script do:
6 # 1. Copy qat driver tarball and sriov tarball from share folder
7 # 2. Extract the tarball and run install.sh to install the drivers
8
9 # Need a variable named $SHARE_FOLDER to indicate the share folder location
10
11 MODULES_LIST="qat_driver sriov_driver"
12 VER="0.1"
13 SHARE_FOLDER=${SHARE_FOLDER:-"package"}
14
15 for module in $MODULES_LIST; do
16     filename=$module-$VER.tar.gz
17     if [ ! -e $filename ]; then
18         if [ ! -e $SHARE_FOLDER/$filename ]; then
19         echo "Cannot install module $module ..."
20         continue
21     else
22             cp $SHARE_FOLDER/$filename .
23         fi
24     fi
25
26     tar xvzf $filename
27     if [ -d $module ]; then
28         echo "Installing module $module ..."
29         pushd $module
30         bash ./install.sh
31         popd
32     rm -rf $module
33     fi
34 done
35