Skip to content

Instantly share code, notes, and snippets.

@theterg
Created February 10, 2012 17:31
Show Gist options
  • Save theterg/1791114 to your computer and use it in GitHub Desktop.
Save theterg/1791114 to your computer and use it in GitHub Desktop.
UDEV rules for arduino and Sierra Wireless 888 on BUG Base
# Internal Ethernet lacks EEPROM for MAC address so each reboot it gets
# random one. In effect it appears as usb0 but we prefer to have it as eth0
ACTION=="add", KERNEL=="omap-backlight", SUBSYSTEM=="platform", RUN+="/sbin/modprobe bug_backlight"
KERNEL=="ttyS1", SUBSYSTEMS=="tty", RUN+="/etc/udev/scripts/bt_init.sh"
ACTION=="add", SUBSYSTEM=="bmi", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
ACTION=="remove", SUBSYSTEM=="bmi", RUN+="/bin/sh /etc/udev/scripts/bmi_eventpipe.sh"
KERNEL=="ttyS0", SUBSYSTEMS=="platform", SYMLINK+="ttyBMI2"
KERNEL=="ttySC0", SUBSYSTEMS=="platform", SYMLINK+="ttyBMI0"
KERNEL=="ttySC1", SUBSYSTEMS=="platform", SYMLINK+="ttyBMI3"
# Whenever the second SD card gets inserted export them as usb-storage
ACTION=="add" KERNEL=="mmcblk1*", RUN+="/sbin/modprobe g_file_storage file=/dev/%k removable=1"
ACTION=="remove" KERNEL=="mmcblk1*", RUN+="/sbin/modprobe -r g_file_storage"
# For Novatel USB 3G (CDMA) Dongle
SUBSYSTEMS=="scsi",DRIVERS=="sr",ATTRS{vendor}=="Novatel ",ACTION=="add",RUN+="/usr/bin/eject %k"
# For Sprint U301 3g/4g
ATTRS{idVendor}=="1a40", ATTRS{idProduct}=="0101", RUN+="/usr/bin/eject %k"
ATTRS{idVendor}=="16d8", ATTRS{idProduct}=="6008" RUN+="/sbin/modprobe usbserial vendor=0x16d8 product=0x6008"
# For libertas_sdio named eth1
SUBSYSTEMS=="sdio", DRIVERS=="libertas_sdio", NAME="wlan0"
KERNEL=="event*",ATTRS{name}=="twl4030_pwrbutton",SYMLINK+="input/power_button"
KERNEL=="event*",ATTRS{name}=="TWL4030 Keypad",SYMLINK+="input/user_button"
# Set eth1assoc as the default trigger for the wifi-green LED
SUBSYSTEMS=="sdio", DRIVERS=="libertas_sdio", NAME="wlan0", RUN+="/etc/udev/scripts/wlan-trigger.sh"
#
# Catch ARDUINO devices first, symlink so arduino points to the first one
#
SUBSYSTEMS=="usb", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", NAME="arduino%n", SYMLINK+="arduino"
SUBSYSTEMS=="usb", ATTRS{idProduct}=="0001", ATTRS{idVendor}=="2341", NAME="arduino%n", SYMLINK+="arduino"
#
# Other useful serial ones, aliasing by manufacturer...
#
KERNEL=="ttyUSB[0-9]", DRIVERS=="pl2303", NAME="ttyPL2303", MODE="0666"
KERNEL=="ttyUSB[0-9]", DRIVERS=="ftdi_sio", NAME="ttyFTDI%n", MODE="0666"
KERNEL=="ttyUSB[0-9]", DRIVERS=="option1", NAME="ttyOPT%n", MODE="0666"
#
# The following will work for a sierra wireless compass 888 modem ONLY
# This seperates the data and AT command ports from the rest
#
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v1199p6890*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="03", ATTRS{bInterfaceProtocol}=="ff", NAME="ttysierra_at0", SYMLINK+="ttysierra_at"
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v1199p6890*", KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="04", ATTRS{bInterfaceProtocol}=="ff", NAME="ttysierra_data0", SYMLINK+="ttysierra_data", RUN+="/bin/sh -c /home/root/sierra_unbind.sh"
#!/bin/sh
echo "1-2.2:1.0" > /sys/bus/usb/drivers/sierra/unbind
echo "1-2.2:1.1" > /sys/bus/usb/drivers/sierra/unbind
echo "1-2.2:1.2" > /sys/bus/usb/drivers/sierra/unbind
echo "1-2.2:1.5" > /sys/bus/usb/drivers/sierra/unbind
echo "1-2.2:1.6" > /sys/bus/usb/drivers/sierra/unbind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment