summaryrefslogtreecommitdiffstats
path: root/lava-slave/scripts
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2019-07-02 11:22:51 +0200
committerCorentin LABBE <clabbe@baylibre.com>2019-08-26 14:36:50 +0200
commit12aa09489580123698d1f791b01daf8371fa0228 (patch)
tree08299f38b21654b6c3ae6f30089b6e12f8b5fac5 /lava-slave/scripts
parent63da4cb3d258222ff1b11052951c7e5d7ca8e02c (diff)
Add support for device-type alias
This patch adds support for the device-type aliases.
Diffstat (limited to 'lava-slave/scripts')
-rwxr-xr-xlava-slave/scripts/setup.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index 1fb0bb3..4bf2f67 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -143,6 +143,22 @@ do
done
done
+for devicetype in $(ls /root/aliases/)
+do
+ lavacli $LAVACLIOPTS device-types aliases list $devicetype > /tmp/device-types-aliases-$devicetype.list
+ while read alias
+ do
+ grep -q " $alias$" /tmp/device-types-aliases-$devicetype.list
+ if [ $? -eq 0 ];then
+ echo "DEBUG: $alias for $devicetype already present"
+ continue
+ fi
+ echo "DEBUG: Add alias $alias to $devicetype"
+ lavacli $LAVACLIOPTS device-types aliases add $devicetype $alias || exit $?
+ echo " $alias" >> /tmp/device-types-aliases-$devicetype.list
+ done < /root/aliases/$devicetype
+done
+
if [ -e /etc/lava-dispatcher/certificates.d/$(hostname).key ];then
echo "INFO: Enabling encryption"
sed -i 's,.*ENCRYPT=.*,ENCRYPT="--encrypt",' /etc/lava-dispatcher/lava-slave