diff options
author | khilman <khilman@users.noreply.github.com> | 2018-10-18 10:41:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 10:41:32 +0200 |
commit | 444653525a07faeee32eab0c07ec972ed6fe8967 (patch) | |
tree | acb42f5c455385dcac78d82e7ece15da57622405 /lava-slave | |
parent | 24fb00544ba3191216876112d3bad8a742812ed6 (diff) | |
parent | 135f1dca856775d0d365c0c1045a7add8626da01 (diff) |
Merge pull request #53 from montjoie/board_for_user
Permit to give board to user
Diffstat (limited to 'lava-slave')
-rw-r--r-- | lava-slave/Dockerfile | 1 | ||||
-rw-r--r-- | lava-slave/deviceinfo/.empty | 0 | ||||
-rwxr-xr-x | lava-slave/scripts/setup.sh | 17 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lava-slave/Dockerfile b/lava-slave/Dockerfile index c029e47..7b811bf 100644 --- a/lava-slave/Dockerfile +++ b/lava-slave/Dockerfile @@ -39,6 +39,7 @@ COPY scripts/setup.sh . COPY devices/ /root/devices/ COPY tags/ /root/tags/ +COPY deviceinfo/ /root/deviceinfo/ RUN if [ -x /root/extra_actions ] ; then /root/extra_actions ; fi diff --git a/lava-slave/deviceinfo/.empty b/lava-slave/deviceinfo/.empty new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lava-slave/deviceinfo/.empty diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh index f281f6b..9fbd796 100755 --- a/lava-slave/scripts/setup.sh +++ b/lava-slave/scripts/setup.sh @@ -80,6 +80,19 @@ 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 + if [ ! -z "$DEVICE_GROUP" ];then + echo "DEBUG: give $devicename to group $DEVICE_GROUP" + DEVICE_OPTS="$DEVICE_OPTS --group $DEVICE_GROUP" + fi + fi echo "Add device $devicename on $worker" grep -q "$devicename[[:space:]]" /tmp/devices.list if [ $? -eq 0 ];then @@ -106,11 +119,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 |