summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/netbase
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2012-05-21 16:39:07 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-24 07:51:39 (GMT)
commit3db152524f8cfc2a772810e24081377be85c4db8 (patch)
treefe669d92a4c28d3e92783d30c708ef7819e44832 /meta/recipes-core/netbase
parentb099511bd9a39f2503c0da21d7ce52e72bf16b6a (diff)
downloadpoky-3db152524f8cfc2a772810e24081377be85c4db8.tar.gz
netbase: merge init script updates from upstream
* Read /proc/mounts only once. * Support many more network filesystem types. * Remaining differences to netbase 4.47: - Uses the mountvirtfs keyword instead of mountkernfs - Doesn't use lsb functions - Doesn't print a warning if /etc/network/options exists - Doesn't use --exclude parameter for ifup, because busybox doesn't support it. (From OE-Core rev: faca42ee5249cf6aae9e53e44bb404de21dd4471) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/netbase')
-rw-r--r--meta/recipes-core/netbase/netbase-4.47/init101
-rw-r--r--meta/recipes-core/netbase/netbase_4.47.bb2
2 files changed, 70 insertions, 33 deletions
diff --git a/meta/recipes-core/netbase/netbase-4.47/init b/meta/recipes-core/netbase/netbase-4.47/init
index 8a67e1c..bace9df 100644
--- a/meta/recipes-core/netbase/netbase-4.47/init
+++ b/meta/recipes-core/netbase/netbase-4.47/init
@@ -1,52 +1,89 @@
1#!/bin/sh 1#!/bin/sh -e
2#
3### BEGIN INIT INFO 2### BEGIN INIT INFO
4# Provides: networking 3# Provides: networking
5# Required-Start: $local_fs mountvirtfs 4# Required-Start: mountvirtfs $local_fs
6# Required-Stop: $local_fs 5# Required-Stop: $local_fs
6# Should-Start: ifupdown
7# Should-Stop: ifupdown
7# Default-Start: S 8# Default-Start: S
8# Default-Stop: 0 6 9# Default-Stop: 0 6
9# Short-Description: Raise network interfaces and configure them 10# Short-Description: Raise network interfaces.
10### END INIT INFO 11### END INIT INFO
11 12
12PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 13PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
13 14
14if ! [ -x /sbin/ifup ]; then 15[ -x /sbin/ifup ] || exit 0
15 exit 0 16
16fi 17check_network_file_systems() {
18 [ -e /proc/mounts ] || return 0
19
20 if [ -e /etc/iscsi/iscsi.initramfs ]; then
21 echo "not deconfiguring network interfaces: iSCSI root is mounted."
22 exit 0
23 fi
24
25 exec 9<&0 < /proc/mounts
26 while read DEV MTPT FSTYPE REST; do
27 case $DEV in
28 /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
29 echo "not deconfiguring network interfaces: network devices still mounted."
30 exit 0
31 ;;
32 esac
33 case $FSTYPE in
34 nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
35 echo "not deconfiguring network interfaces: network file systems still mounted."
36 exit 0
37 ;;
38 esac
39 done
40 exec 0<&9 9<&-
41}
42
43check_network_swap() {
44 [ -e /proc/swaps ] || return 0
45
46 exec 9<&0 < /proc/swaps
47 while read DEV MTPT FSTYPE REST; do
48 case $DEV in
49 /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
50 echo "not deconfiguring network interfaces: network swap still mounted."
51 exit 0
52 ;;
53 esac
54 done
55 exec 0<&9 9<&-
56}
17 57
18case "$1" in 58case "$1" in
19 start) 59start)
20 echo -n "Configuring network interfaces... " 60 echo -n "Configuring network interfaces... "
21 ifup -a 61 ifup -a
22 echo "done." 62 echo "done."
23 ;; 63 ;;
24 stop) 64
25 if sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts | 65stop)
26 grep -q "^/ nfs$"; then 66 check_network_file_systems
27 echo "NOT deconfiguring network interfaces: / is an NFS mount" 67 check_network_swap
28 elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts | 68
29 grep -q "^/ smbfs$"; then 69 echo -n "Deconfiguring network interfaces... "
30 echo "NOT deconfiguring network interfaces: / is an SMB mount" 70 ifdown -a
31 elif sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\2/p' /proc/mounts | 71 echo "done."
32 grep -qE '^(nfs|smbfs|ncp|coda)$'; then
33 echo "NOT deconfiguring network interfaces: network shares still mounted."
34 else
35 echo -n "Deconfiguring network interfaces... "
36 ifdown -a
37 echo "done."
38 fi
39 ;; 72 ;;
40 force-reload|restart) 73
41 echo -n "Reconfiguring network interfaces... " 74force-reload|restart)
42 ifdown -a 75 echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
43 ifup -a 76 echo "Reconfiguring network interfaces... "
77 ifdown -a || true
78 ifup -a
44 echo "done." 79 echo "done."
45 ;; 80 ;;
46 *) 81
47 echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}" 82*)
83 echo "Usage: /etc/init.d/networking {start|stop}"
48 exit 1 84 exit 1
49 ;; 85 ;;
50esac 86esac
51 87
52exit 0 88exit 0
89
diff --git a/meta/recipes-core/netbase/netbase_4.47.bb b/meta/recipes-core/netbase/netbase_4.47.bb
index 1c85997..634560a 100644
--- a/meta/recipes-core/netbase/netbase_4.47.bb
+++ b/meta/recipes-core/netbase/netbase_4.47.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "http://packages.debian.org/netbase"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "GPLv2" 5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab" 6LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
7PR = "r2" 7PR = "r3"
8 8
9inherit update-rc.d 9inherit update-rc.d
10 10