diff options
author | Klaus Kurzmann <mok@fluxnetz.de> | 2010-10-02 16:34:50 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2010-10-27 23:12:13 +0200 |
commit | a8d15196e943b20461994a3e9efaae0d0d592ec5 (patch) | |
tree | fcb79a4d430a68b9a57a7f509372523bb83d8a9c /recipes | |
parent | d838df9eace1c7c185c2a0a77a2b1630121dc87f (diff) | |
download | openembedded-a8d15196e943b20461994a3e9efaae0d0d592ec5.tar.gz |
udev_151.bb: add rules for nokia900
Signed-off-by: Klaus Kurzmann <mok@fluxnetz.de>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes')
-rw-r--r-- | recipes/udev/files/nokia900/10-cmt_speech.rules | 1 | ||||
-rw-r--r-- | recipes/udev/files/nokia900/nokia-n900-mac-hack.sh | 23 | ||||
-rw-r--r-- | recipes/udev/files/nokia900/udev-rules-nokia-n900-hacks.rules | 8 | ||||
-rw-r--r-- | recipes/udev/files/nokia900/udev-rules-nokia-n900-snd.rules | 10 | ||||
-rw-r--r-- | recipes/udev/udev_151.bb | 16 |
5 files changed, 57 insertions, 1 deletions
diff --git a/recipes/udev/files/nokia900/10-cmt_speech.rules b/recipes/udev/files/nokia900/10-cmt_speech.rules new file mode 100644 index 0000000000..25f46efeaa --- /dev/null +++ b/recipes/udev/files/nokia900/10-cmt_speech.rules @@ -0,0 +1 @@ +KERNEL=="cmt_speech", MODE="0777" diff --git a/recipes/udev/files/nokia900/nokia-n900-mac-hack.sh b/recipes/udev/files/nokia900/nokia-n900-mac-hack.sh new file mode 100644 index 0000000000..c0b8251ae9 --- /dev/null +++ b/recipes/udev/files/nokia900/nokia-n900-mac-hack.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ $# -ne 2 ]; then + echo "Usage: $0 iface newmac" + echo " newmac is only saved if /etc/<iface>MAC is not found" + exit 1 +fi + +iface="$1" +newmac="$2" +macfile=/etc/"$iface"mac + +# If no MAC is found, save the one given as argument +if [ ! -e $macfile ]; then + /bin/echo "$newmac" > $macfile +# Otherwise load MAC from file +else + newmac=`/bin/cat $macfile` +fi + +# Configure interface +/sbin/ifconfig "$iface" down +/sbin/ifconfig "$iface" hw ether $newmac diff --git a/recipes/udev/files/nokia900/udev-rules-nokia-n900-hacks.rules b/recipes/udev/files/nokia900/udev-rules-nokia-n900-hacks.rules new file mode 100644 index 0000000000..8c19e65a22 --- /dev/null +++ b/recipes/udev/files/nokia900/udev-rules-nokia-n900-hacks.rules @@ -0,0 +1,8 @@ +# MAC address hack +# forces n900 to always use the same MAC address that is generated in the first boot +SUBSYSTEM=="net",KERNEL=="wlan0", RUN+="/lib/udev/nokia-n900-mac-hack.sh %k $attr{address}" + +# Create inputdev symlinks for kbslider contextkit plugin +SUBSYSTEM=="input" ATTRS{name}=="TWL4030 Keypad" SYMLINK+="input/keypad" +SUBSYSTEM=="input" ATTRS{name}=="gpio-keys" SYMLINK+="input/gpio-keys" + diff --git a/recipes/udev/files/nokia900/udev-rules-nokia-n900-snd.rules b/recipes/udev/files/nokia900/udev-rules-nokia-n900-snd.rules new file mode 100644 index 0000000000..413c1656f0 --- /dev/null +++ b/recipes/udev/files/nokia900/udev-rules-nokia-n900-snd.rules @@ -0,0 +1,10 @@ +# ALSA devices +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" + +KERNEL=="snd", SUBSYSTEM=="module", ACTION=="add", \ + RUN+="/bin/ln -sf /proc/asound/oss/sndstat $root/sndstat" diff --git a/recipes/udev/udev_151.bb b/recipes/udev/udev_151.bb index 554f86b913..4796957a69 100644 --- a/recipes/udev/udev_151.bb +++ b/recipes/udev/udev_151.bb @@ -3,7 +3,7 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod the hotplug package and requires a kernel not older than 2.6.12." LICENSE = "GPLv2+" -PR = "r19" +PR = "r20" # Untested DEFAULT_PREFERENCE = "-1" @@ -41,6 +41,13 @@ SRC_URI_append_bug = " \ file://10-mx31.rules \ file://bmi_eventpipe.sh " +SRC_URI_append_nokia900 = " \ + file://10-cmt_speech.rules \ + file://udev-rules-nokia-n900-hacks.rules \ + file://udev-rules-nokia-n900-snd.rules \ + file://nokia-n900-mac-hack.sh \ +" + PACKAGE_ARCH_bug = "bug" inherit update-rc.d autotools @@ -145,6 +152,13 @@ do_install_append_bug() { install -m 0644 ${WORKDIR}/bmi_eventpipe.sh ${D}${sysconfdir}/udev/scripts/bmi_eventpipe.sh } +do_install_append_nokia900() { + install -m 0644 ${WORKDIR}/10-cmt_speech.rules ${D}${sysconfdir}/udev/rules.d/10-cmt_speech.rules + install -m 0644 ${WORKDIR}/udev-rules-nokia-n900-hacks.rules ${D}${sysconfdir}/udev/rules.d/udev-rules-nokia-n900-hacks.rules + install -m 0644 ${WORKDIR}/udev-rules-nokia-n900-snd.rules ${D}${sysconfdir}/udev/rules.d/udev-rules-nokia-n900-snd.rules + install -m 0755 ${WORKDIR}/nokia-n900-mac-hack.sh ${D}${sysconfdir}/udev/scripts/nokia-n900-mac-hack.sh +} + # Create the cache after checkroot has run pkg_postinst_udev_append() { if test "x$D" != "x"; then |