From: Stefan Schmidt Date: Tue, 2 Nov 2010 15:23:36 +0000 (+0100) Subject: udev-rules-buglabs: Add recipe for Bug 2.0 specific udev rules X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b5c27f05ddc4efef40e6930c79b1c5cf588c253;p=openembedded.git udev-rules-buglabs: Add recipe for Bug 2.0 specific udev rules --- diff --git a/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules b/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules new file mode 100644 index 0000000000..0722c5c235 --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules @@ -0,0 +1,23 @@ +# 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 +ATTRS{idVendor}=="1410", ATTRS{idProduct}=="5030", RUN+="/usr/bin/eject %k" +ATTRS{idVendor}=="1410", ATTRS{idProduct}=="6000", RUN+="/sbin/modprobe usbserial vendor=0x1410 product=0x6000" +# 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}=="omap_twl4030keypad",SYMLINK+="input/user_button" diff --git a/recipes/udev-rules-buglabs/bug-udev/bmi_eventpipe.sh b/recipes/udev-rules-buglabs/bug-udev/bmi_eventpipe.sh new file mode 100644 index 0000000000..9b4210fa6d --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/bmi_eventpipe.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 \ No newline at end of file diff --git a/recipes/udev-rules-buglabs/bug-udev/bt_init.sh b/recipes/udev-rules-buglabs/bug-udev/bt_init.sh new file mode 100755 index 0000000000..858f2c7b63 --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/bt_init.sh @@ -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 diff --git a/recipes/udev-rules-buglabs/bug-udev/mbkb-start.sh b/recipes/udev-rules-buglabs/bug-udev/mbkb-start.sh new file mode 100755 index 0000000000..e939efe082 --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/mbkb-start.sh @@ -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 diff --git a/recipes/udev-rules-buglabs/bug-udev/mbkb-stop.sh b/recipes/udev-rules-buglabs/bug-udev/mbkb-stop.sh new file mode 100755 index 0000000000..47eb5d6101 --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/mbkb-stop.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "KILLING MATCHBOX_KEYBOARD" > /dev/console +/usr/bin/killall -9 matchbox-keyboard diff --git a/recipes/udev-rules-buglabs/bug-udev/working.psr b/recipes/udev-rules-buglabs/bug-udev/working.psr new file mode 100644 index 0000000000..9c83d0dafd --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev/working.psr @@ -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 diff --git a/recipes/udev-rules-buglabs/bug-udev_0.1.bb b/recipes/udev-rules-buglabs/bug-udev_0.1.bb new file mode 100644 index 0000000000..b9238fae06 --- /dev/null +++ b/recipes/udev-rules-buglabs/bug-udev_0.1.bb @@ -0,0 +1,26 @@ +DESCRIPTION = "UDEV Rules for BUG" +LICENSE = "GPL" +SECTION = "x11" +PRIORITY = "optional" +RDEPENDS_${PN} = "udev" +PR = "r25" + +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 \ + " + +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/ +}