[oe-commits] Thomas Zimmermann : shr/merge: netbase: update config files for shr and om-*

git version control git at git.openembedded.org
Fri Oct 23 10:03:02 UTC 2009


Module: openembedded.git
Branch: shr/merge
Commit: e41832586c9c4a358e90dc518f411c7bd471b1f1
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=e41832586c9c4a358e90dc518f411c7bd471b1f1

Author: Thomas Zimmermann <zimmermann at vdm-design.de>
Date:   Fri Oct 23 08:13:24 2009 +0000

shr/merge: netbase: update config files for shr and om-*

Signed-off-by: Klaus Kurzmann <mok at fluxnetz.de>

---

 recipes/netbase/netbase/om-gta01/interfaces |    5 ++-
 recipes/netbase/netbase/om-gta02/interfaces |    7 ++--
 recipes/netbase/netbase/shr/init            |   46 +++++++++++++++++++++++++++
 recipes/netbase/netbase/shr/options         |    1 +
 recipes/netbase/netbase_4.21.bb             |    2 +-
 5 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/recipes/netbase/netbase/om-gta01/interfaces b/recipes/netbase/netbase/om-gta01/interfaces
index 56c485e..e595239 100644
--- a/recipes/netbase/netbase/om-gta01/interfaces
+++ b/recipes/netbase/netbase/om-gta01/interfaces
@@ -16,14 +16,15 @@ iface eth1 inet dhcp
 
 # Ethernet/RNDIS gadget (g_ether)
 # ... or on host side, usbnet and random hwaddr
-allow-hotplug usb0
+auto usb0
 iface usb0 inet static
 	address 192.168.0.202
 	netmask 255.255.255.0
 	network 192.168.0.0
-	gateway 192.168.0.200
+	up route add default gw 192.168.0.200 metric 8
 	up echo nameserver 208.67.222.222 >> /etc/resolv.conf
 	up echo nameserver 208.67.220.220 >> /etc/resolv.conf
+	down route del default gw 192.168.0.200 metric 8
 
 # Bluetooth networking
 iface bnep0 inet dhcp
diff --git a/recipes/netbase/netbase/om-gta02/interfaces b/recipes/netbase/netbase/om-gta02/interfaces
index ceedfc5..08bd3bb 100644
--- a/recipes/netbase/netbase/om-gta02/interfaces
+++ b/recipes/netbase/netbase/om-gta02/interfaces
@@ -16,14 +16,15 @@ iface eth1 inet dhcp
 
 # Ethernet/RNDIS gadget (g_ether)
 # ... or on host side, usbnet and random hwaddr
-allow-hotplug usb0
+auto usb0
 iface usb0 inet static
 	address 192.168.0.202
 	netmask 255.255.255.0
 	network 192.168.0.0
-	gateway 192.168.0.200
-	up echo nameserver 208.67.222.222 >> /etc/resolv.conf
+	up route add default gw 192.168.0.200 metric 8
+	up echo nameserver 208.67.222.222 > /etc/resolv.conf
 	up echo nameserver 208.67.220.220 >> /etc/resolv.conf
+	down route del default gw 192.168.0.200 metric 8
 
 # Bluetooth networking
 iface bnep0 inet dhcp
diff --git a/recipes/netbase/netbase/shr/init b/recipes/netbase/netbase/shr/init
new file mode 100644
index 0000000..32810dc
--- /dev/null
+++ b/recipes/netbase/netbase/shr/init
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# manage network interfaces and configure some networking options
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+if ! [ -x /sbin/ifup ]; then
+    exit 0
+fi
+
+case "$1" in
+    start)
+        echo -n "Configuring network interfaces... "
+        ifup -a
+	echo "done."
+	;;
+    stop)
+        if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+          grep -q "^/ nfs$"; then
+            echo "NOT deconfiguring network interfaces: / is an NFS mount"
+        elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+          grep -q "^/ smbfs$"; then
+            echo "NOT deconfiguring network interfaces: / is an SMB mount"
+	elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts |
+          grep -qE '^(nfs|smbfs|ncp|coda)$'; then
+            echo "NOT deconfiguring network interfaces: network shares still mounted."
+        else
+            echo -n "Deconfiguring network interfaces... "
+            ifdown -a
+	    echo "done."
+        fi
+	;;
+    force-reload|restart)
+        echo -n "Reconfiguring network interfaces... "
+        ifdown -a
+        ifup -a
+	echo "done."
+	;;
+    *)
+	echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/recipes/netbase/netbase/shr/options b/recipes/netbase/netbase/shr/options
new file mode 100644
index 0000000..1cbffcb
--- /dev/null
+++ b/recipes/netbase/netbase/shr/options
@@ -0,0 +1 @@
+# DEPRECATED by /etc/sysctl.conf
diff --git a/recipes/netbase/netbase_4.21.bb b/recipes/netbase/netbase_4.21.bb
index 403ca19..0ce40ba 100644
--- a/recipes/netbase/netbase_4.21.bb
+++ b/recipes/netbase/netbase_4.21.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "This package provides the necessary \
 infrastructure for basic TCP/IP based networking."
 SECTION = "base"
 LICENSE = "GPL"
-PR = "r38"
+PR = "r39"
 
 inherit update-rc.d
 





More information about the Openembedded-commits mailing list