Permalink
Browse files

bug-udev: Add set of Buglabs specific udev rules.

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
  • Loading branch information...
1 parent 5302c0c commit 567bc0a2f800b0dd2ec3bedf1f135f9681ba74fa @Stefan-Schmidt Stefan-Schmidt committed Nov 29, 2011
@@ -0,0 +1,24 @@
+# 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"
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# This script passes BMI state variables to the running JVM.
+#
+if [ ${BMIBUS_PRODUCT} != "" ] && [ ${BMIBUS_SLOT} != "" ] && [ ${ACTION} != "" ];
+then
+ echo $BMIBUS_PRODUCT 0 $BMIBUS_SLOT $ACTION > /tmp/eventpipe
+fi
@@ -0,0 +1,7 @@
+#!/bin/sh
+echo "Setting up bluetooth hci_uart" > /dev/console
+/usr/sbin/bccmd -t bcsp -d /dev/ttyS1 psload -r -s psram /etc/udev/scripts/working.psr
+/usr/sbin/bccmd -t bcsp -d /dev/ttyS1 psload -r -s psram /etc/udev/scripts/working.psr
+hciattach /dev/ttyS1 bcsp 115200
+hciconfig hci0 reset
+echo "Bluetooth setup completed." > /dev/console
@@ -0,0 +1,10 @@
+#!/bin/sh
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+
+echo "RUNNING UDEV SCRIPT FOR MATCHBOX" > /dev/console
+export DISPLAY=:0.0
+/usr/bin/matchbox-keyboard -d bug
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "KILLING MATCHBOX_KEYBOARD" > /dev/console
+/usr/bin/killall -9 matchbox-keyboard
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ -e /sys/class/net/eth0 ]; then
+ echo phy1assoc > /sys/class/leds/omap3bug\:green\:wifi/trigger
+else
+ echo phy0assoc > /sys/class/leds/omap3bug\:green\:wifi/trigger
+fi
+echo none > /sys/class/leds/omap3bug\:red\:wifi/trigger
@@ -0,0 +1,9 @@
+&0001 = 0011 2821 005b 6789
+&01f9 = 0001
+&01fe = 6590
+&01be = 01d8
+&002a = 0011
+&01ab = 0001
+&0028 = 0200 0000 0000
+&002b = 000b
+&01b3 = 18800002
@@ -0,0 +1,29 @@
+DESCRIPTION = "UDEV Rules for BUG"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+RDEPENDS_${PN} = "udev"
+PR = "r1"
+
+SRC_URI = "file://00-bug20.rules \
+ file://bmi_eventpipe.sh \
+ file://bt_init.sh \
+ file://working.psr \
+ file://mbkb-stop.sh \
+ file://mbkb-start.sh \
+ file://wlan-trigger.sh \
+ "
+
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+ install -d ${D}/etc/udev/rules.d
+ install -d ${D}/etc/udev/scripts
+ install -m 0644 *.rules ${D}/etc/udev/rules.d
+ install -m 0775 *.sh ${D}/etc/udev/scripts
+ install -m 0644 working.psr ${D}/etc/udev/scripts/
+}
+pkg_postinst_${PN} (){
+ sed -i "s/0011 2821 005b 6789/$(sed -e 's/smsc95xx.mac=\(..:..:..:..:..:..\) .*/\1/' -e 's/\(..\):\(..\):\(..\):\(..\):\(..\):\(..\)/00\4 \5\6 00\3 \1\2/' /proc/cmdline)/" /etc/udev/scripts/working.psr
+}

0 comments on commit 567bc0a

Please sign in to comment.