# # Configure ftdi serial port devices with a symlink based on it's serial number # This sets the permision to 0666 so that anything can use the device # This also sets the device to raw mode # # https://forums.freebsd.org/threads/devd-usb-device-with-unique-dev-name.31551/ attach 1000 { match "vendor" "0x0403"; match "product" "0x6001|6015"; action "stty raw -echo < /dev/cua$ttyname.init"; action "stty raw -echo < /dev/tty$ttyname.init"; action "stty raw -echo < /dev/cua$ttyname.lock"; action "stty raw -echo < /dev/tty$ttyname.lock"; action "chmod 0666 /dev/cua$ttyname /dev/tty$ttyname && ln -sf /dev/cua$ttyname /dev/ftdi-$sernum"; action "echo \"ftdi-$sernum\" >> /tmp/ftdi.lst" }; notify 1000 { match "subsystem" "DEVICE"; match "type" "DETACH"; match "vendor" "0x0403"; match "product" "0x6001|6015"; action "rm /dev/ftdi-$sernum"; action "sed -e'/ftdi-$sernum/d' -i '' /tmp/ftdi.lst" };