From ce8d880513c8599185db11a6624d7adcaf59701f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= <mail-github@cgundogan.de>
Date: Fri, 3 Nov 2017 13:42:47 +0100
Subject: [PATCH] packer: add dfu-util and bluepill udev rules

---
 dist/tools/packer/preseed.cfg                | 2 +-
 dist/tools/packer/riot.json                  | 4 +++-
 dist/tools/packer/udev_rules/99-custom.rules | 4 ++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dist/tools/packer/preseed.cfg b/dist/tools/packer/preseed.cfg
index 856d391545..30eaa4a161 100644
--- a/dist/tools/packer/preseed.cfg
+++ b/dist/tools/packer/preseed.cfg
@@ -26,7 +26,7 @@ d-i pkgsel/include string openssh-server ntp curl nfs-common build-essential \
     python-setuptools libusb-1.0-0 libusb-1.0-0-dev libudev-dev libftdi1 \
     libftdi-dev libftdipp1-dev libftdipp1-2v5 libhidapi-dev libhidapi-hidraw0 \
     libhidapi-libusb0 cmake autotools-dev autoconf pkg-config jimsh libtool \
-    valgrind openocd python-serial python3-serial xsltproc
+    valgrind openocd python-serial python3-serial xsltproc dfu-util
 
 d-i pkgsel/install-language-support boolean false
 d-i pkgsel/update-policy select none
diff --git a/dist/tools/packer/riot.json b/dist/tools/packer/riot.json
index 029f0b63dd..d14c000489 100644
--- a/dist/tools/packer/riot.json
+++ b/dist/tools/packer/riot.json
@@ -48,7 +48,9 @@
         ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "iotlab-m3", "--vendorid", "0x0403", "--productid",  "0x6010"],
         ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "samr21-xpro", "--vendorid", "0x03eb", "--productid",  "0x2111"],
         ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "Arduino Mega 2560", "--vendorid", "0x2341", "--productid",  "0x0042"],
-        ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "Phytec phyWAVE KW22", "--vendorid", "0x0d28", "--productid",  "0x0204"]
+        ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "Phytec phyWAVE KW22", "--vendorid", "0x0d28", "--productid",  "0x0204"],
+        ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "Bluepill", "--vendorid", "0x1d50", "--productid",  "0x6017"],
+        ["usbfilter", "add", "0", "--target", "{{.Name}}", "--name", "Bluepill", "--vendorid", "0x1d50", "--productid",  "0x6018"]
       ],
       "virtualbox_version_file": ".vbox_version",
       "vm_name": "{{user `vm_name`}}"
diff --git a/dist/tools/packer/udev_rules/99-custom.rules b/dist/tools/packer/udev_rules/99-custom.rules
index 9c3e189a80..28c333c577 100644
--- a/dist/tools/packer/udev_rules/99-custom.rules
+++ b/dist/tools/packer/udev_rules/99-custom.rules
@@ -7,4 +7,8 @@ ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="660", GROUP="plugdev",
 # Arduino Due
 ATTRS{idVendor}=="2341", ATTRS{idProduct}=="003d", MODE="660", GROUP="plugdev", TAG+="uaccess"
 
+# bluepill
+ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6017", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6018", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
 LABEL="custom_rules_end"
-- 
GitLab