[meego-commits] 6056: Changes to Trunk/udev-rules-nokia-n900
Peter Zhu
peter.j.zhu at intel.com
Wed Jul 28 14:45:38 UTC 2010
Hi,
I have made the following changes to udev-rules-nokia-n900 in project Trunk. Please review and accept ASAP.
Thank You,
Peter Zhu
[This message was auto-generated]
---
Request #6056:
submit: Trunk:Testing/udev-rules-nokia-n900(r8) -> Trunk/udev-rules-nokia-n900
Message:
Move to Trunk
State: new 2010-07-28T02:38:46 peter
Comment: None
changes files:
--------------
--- udev-rules-nokia-n900.changes
+++ udev-rules-nokia-n900.changes
@@ -0,0 +1,6 @@
+* Tue Jul 27 2010 Carsten Munk <carsten at maemo.org> - 0.2.4
+- Build fix, spec file error.
+
+* Tue Jul 27 2010 Carsten Munk <carsten at maemo.org> - 0.2.3
+- Merge Markus's static-MAC-on-wlan0 hack to further help diagnose connman problems.
+
new:
----
nokia-n900-mac-hack.sh
spec files:
-----------
--- udev-rules-nokia-n900.spec
+++ udev-rules-nokia-n900.spec
@@ -7,6 +7,7 @@
Provides: udev-rules
Source1: udev-rules-nokia-n900-snd.rules
Source2: udev-rules-nokia-n900-hacks.rules
+Source3: nokia-n900-mac-hack.sh
Requires: udev
ExclusiveArch: %{arm}
@@ -22,11 +23,13 @@
install -d $RPM_BUILD_ROOT/etc/udev/rules.d/
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/udev/rules.d/nokia-n900-snd.rules
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/udev/rules.d/nokia-n900-hacks.rules
+install -d $RPM_BUILD_ROOT/lib/udev/
+install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/lib/udev/nokia-n900-mac-hack.sh
%clean
rm -rf $RPM_BUILD_ROOT
%files
-%defattr(644,root,root,-)
%config /etc/udev/rules.d/nokia-n900-snd.rules
%config /etc/udev/rules.d/nokia-n900-hacks.rules
+/lib/udev/nokia-n900-mac-hack.sh
other changes:
--------------
++++++ nokia-n900-mac-hack.sh (new)
--- nokia-n900-mac-hack.sh
+++ nokia-n900-mac-hack.sh
+#!/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
++++++ udev-rules-nokia-n900-hacks.rules
--- udev-rules-nokia-n900-hacks.rules
+++ udev-rules-nokia-n900-hacks.rules
@@ -1,2 +1,6 @@
# Backlight fix: force backlight on after boot
ACTION=="add", SUBSYSTEM=="backlight", ATTR{brightness}="255"
+
+# 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}"
More information about the MeeGo-commits
mailing list