summaryrefslogtreecommitdiffstats
path: root/lava-slave/scripts/setup.sh
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-10-11 09:50:49 +0200
committerCorentin LABBE <clabbe@baylibre.com>2018-10-15 16:48:28 +0200
commit296bc5fbc5d08ed91771a39f47f02ae90164aa6b (patch)
tree944ec198593f023caf93cb783335559d63345222 /lava-slave/scripts/setup.sh
parent24fb00544ba3191216876112d3bad8a742812ed6 (diff)
Permit to give board to user
By default LAVA give owning of boards to admin, this patch permit to give board to a specific user.
Diffstat (limited to 'lava-slave/scripts/setup.sh')
-rwxr-xr-xlava-slave/scripts/setup.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index f281f6b..ef20790 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -80,6 +80,15 @@ do
fi
touch /root/.lavadocker/devicetype-$devicetype
fi
+ DEVICE_OPTS=""
+ if [ -e /root/deviceinfo/$devicename ];then
+ echo "Found customization for $devicename"
+ . /root/deviceinfo/$devicename
+ if [ ! -z "$DEVICE_USER" ];then
+ echo "DEBUG: give $devicename to $DEVICE_USER"
+ DEVICE_OPTS="$DEVICE_OPTS --user $DEVICE_USER"
+ fi
+ fi
echo "Add device $devicename on $worker"
grep -q "$devicename[[:space:]]" /tmp/devices.list
if [ $? -eq 0 ];then
@@ -106,11 +115,11 @@ do
DEVICE_HEALTH='UNKNOWN'
;;
esac
- lavacli $LAVACLIOPTS devices update --worker $worker --health $DEVICE_HEALTH $devicename || exit $?
+ lavacli $LAVACLIOPTS devices update --worker $worker --health $DEVICE_HEALTH $DEVICE_OPTS $devicename || exit $?
# always reset the device dict in case of update of it
lavacli $LAVACLIOPTS devices dict set $devicename /root/devices/$worker/$device || exit $?
else
- lavacli $LAVACLIOPTS devices add --type $devicetype --worker $worker $devicename || exit $?
+ lavacli $LAVACLIOPTS devices add --type $devicetype --worker $worker $DEVICE_OPTS $devicename || exit $?
lavacli $LAVACLIOPTS devices dict set $devicename /root/devices/$worker/$device || exit $?
fi
if [ -e /root/tags/$devicename ];then