summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlavalab-gen.py6
-rwxr-xr-xlavalab-gen.sh4
2 files changed, 6 insertions, 4 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 0e0b583..55f2317 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -42,7 +42,6 @@ def main(args):
fp = open(boards_yaml, "r")
labs = yaml.load(fp)
fp.close()
- udev_line =""
tdc = open("docker-compose.template", "r")
dockcomp = yaml.load(tdc)
tdc.close()
@@ -62,6 +61,7 @@ def main(args):
fp.close()
for lab_name in labs:
+ udev_line =""
lab = labs[lab_name]
for board_name in lab["boardlist"]:
b = lab["boardlist"][board_name]
@@ -101,7 +101,9 @@ def main(args):
fp = open(board_device_file, "w")
fp.write(device_line)
fp.close()
- fp = open("lavalab-udev-%s.rules" % lab_name, "w")
+ if not os.path.isdir("udev"):
+ os.mkdir("udev")
+ fp = open("udev/99-lavalab-udev-%s.rules" % lab_name, "w")
fp.write(udev_line)
fp.close()
if lab.has_key("dispatcher_ip"):
diff --git a/lavalab-gen.sh b/lavalab-gen.sh
index 26cbc23..d6fcf94 100755
--- a/lavalab-gen.sh
+++ b/lavalab-gen.sh
@@ -5,7 +5,7 @@ rm -rv lava-master/slaves/
rm -rv lava-slave/conmux/
rm -rv lava-master/tokens/
rm -rv lava-master/users/
-rm lavalab*rules
+rm udev/*lavalab*rules
if [ "$1" = "mrproper" ];then
exit 0
@@ -19,7 +19,7 @@ if [ $(id -u) -ne 0 ];then
BEROOT="sudo "
fi
$BEROOT rm /etc/udev/rules.d/*lavalab*rules
-$BEROOT cp *lavalab*rules /etc/udev/rules.d/
+$BEROOT cp udev/*lavalab*rules /etc/udev/rules.d/
$BEROOT udevadm control --reload-rules || exit $?
$BEROOT udevadm trigger || exit $?