summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rwxr-xr-xlava-slave/scripts/setup.sh4
-rwxr-xr-xlavalab-gen.py7
3 files changed, 13 insertions, 1 deletions
diff --git a/README.md b/README.md
index 07139d7..32f53ed 100644
--- a/README.md
+++ b/README.md
@@ -268,7 +268,8 @@ boards:
tags: (optional) List of tag to set on this device
- tag1
- tag2
- user: (optional) Name of user owning the board (LAVA default is admin)
+ user: (optional) Name of user owning the board (LAVA default is admin) user is exclusive with group
+ group: (optional) Name of group owning the board (no LAVA default) group is exclusive with user
# One of uart or connection_command must be choosen
uart:
idvendor: The VID of the UART (Formated as 0xXXXX)
diff --git a/lava-slave/scripts/setup.sh b/lava-slave/scripts/setup.sh
index ef20790..9fbd796 100755
--- a/lava-slave/scripts/setup.sh
+++ b/lava-slave/scripts/setup.sh
@@ -88,6 +88,10 @@ do
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
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 17eba31..9af872b 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -490,6 +490,13 @@ def main():
deviceinfo = open("%s/deviceinfo/%s" % (workerdir, board_name), 'w')
deviceinfo.write("DEVICE_USER=%s\n" % board["user"])
deviceinfo.close()
+ if "group" in board:
+ if "user" in board:
+ print("user and group are exclusive")
+ sys.exit(1)
+ deviceinfo = open("%s/deviceinfo/%s" % (workerdir, board_name), 'w')
+ deviceinfo.write("DEVICE_GROUP=%s\n" % board["group"])
+ deviceinfo.close()
if "custom_option" in board:
for coption in board["custom_option"]:
device_line += "{%% %s %%}\n" % coption