[Testing] os240py - collaboration over wireless

James Cameron quozl at laptop.org
Thu Jun 3 01:47:01 EDT 2010


On Thu, Jun 03, 2010 at 12:34:30AM -0400, Bernie Innocenti wrote:
> I'll be traveling around until Friday night. Daniel, could you apply a
> patch to olpc-os-builder?

Here's a simple patch.  Could be better, but it works for me.  Tested on
os240py, but not tested through a complete build using olpc-os-builder.

>From 3ab33d16f6e9aa1ee384f93a3fd458db8581ee6c Mon Sep 17 00:00:00 2001
From: James Cameron <quozl at laptop.org>
Date: Thu, 3 Jun 2010 15:41:14 +1000
Subject: [PATCH] add multicast route for mesh collaboration

Add a multicast route when msh0 is raised by Network Manager.  Fix a
minor backslash quoting issue on eth0.

Tested by creating the file on os240py and starting mesh, then
checking with "ip route list" command and confirming that a Chat
activity shared from an os802 laptop causes an icon to appear in the
Neighbourhood View of the os240py laptop.
---
 modules/base/kspost.10.core.inc |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/modules/base/kspost.10.core.inc b/modules/base/kspost.10.core.inc
index 40c7483..03e2345 100644
--- a/modules/base/kspost.10.core.inc
+++ b/modules/base/kspost.10.core.inc
@@ -96,12 +96,21 @@ echo "NM_IGNORE_HOSTNAME_LOCALHOST=yes" >> /etc/sysconfig/network
 cat >/etc/NetworkManager/dispatcher.d/adhoc-route <<EOF
 #!/bin/sh
 # workaround for http://dev.laptop.org/ticket/9669
-[ "\$1" = "eth0" ] || exit 0
-if [ "\$2" = "down" ]; then
-	/sbin/ip route del 224.0.0.0/4 dev eth0 &>/dev/null
+if [ "\$1" = "eth0" ]; then
+    if [ "\$2" = "down" ]; then
+        /sbin/ip route del 224.0.0.0/4 dev eth0 &>/dev/null
 else
-	/sbin/iwconfig \$1 | /bin/grep -q "Mode:Ad-Hoc" && \
-		/sbin/ip route add 224.0.0.0/4 dev eth0 &>/dev/null
+    else
+        /sbin/iwconfig eth0 | /bin/grep -q "Mode:Ad-Hoc" && \\
+            /sbin/ip route add 224.0.0.0/4 dev eth0 &>/dev/null
+    fi
+fi
+if [ "\$1" = "msh0" ]; then
+    if [ "\$2" = "down" ]; then
+        /sbin/ip route del 224.0.0.0/4 dev msh0 &>/dev/null
+    else
+        /sbin/ip route add 224.0.0.0/4 dev msh0 &>/dev/null
+    fi
 fi
 exit 0
 EOF
-- 
1.7.1

-- 
James Cameron
http://quozl.linux.org.au/



More information about the Devel mailing list