diff options
author | Cristian Iorga <cristian.iorga@intel.com> | 2012-07-04 14:34:01 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-05 14:21:57 +0100 |
commit | a8d7e1471df012a3292967fe2e6b2e7019956053 (patch) | |
tree | c7c16523f3482c24df4fef87e3bc69bd8188bad2 /meta/recipes-core/netbase/netbase-5.0/init | |
parent | d27b8dd3be1c66cafe71bd84d897937450928776 (diff) | |
download | poky-a8d7e1471df012a3292967fe2e6b2e7019956053.tar.gz |
netbase: update to ver. 5.0
(From OE-Core rev: 5beb7176d361d4bfa279bbfab5a17b8fe4fa3b73)
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/netbase/netbase-5.0/init')
-rw-r--r-- | meta/recipes-core/netbase/netbase-5.0/init | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-core/netbase/netbase-5.0/init b/meta/recipes-core/netbase/netbase-5.0/init new file mode 100644 index 0000000000..bace9df991 --- /dev/null +++ b/meta/recipes-core/netbase/netbase-5.0/init | |||
@@ -0,0 +1,89 @@ | |||
1 | #!/bin/sh -e | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: networking | ||
4 | # Required-Start: mountvirtfs $local_fs | ||
5 | # Required-Stop: $local_fs | ||
6 | # Should-Start: ifupdown | ||
7 | # Should-Stop: ifupdown | ||
8 | # Default-Start: S | ||
9 | # Default-Stop: 0 6 | ||
10 | # Short-Description: Raise network interfaces. | ||
11 | ### END INIT INFO | ||
12 | |||
13 | PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" | ||
14 | |||
15 | [ -x /sbin/ifup ] || exit 0 | ||
16 | |||
17 | check_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 | |||
43 | check_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 | } | ||
57 | |||
58 | case "$1" in | ||
59 | start) | ||
60 | echo -n "Configuring network interfaces... " | ||
61 | ifup -a | ||
62 | echo "done." | ||
63 | ;; | ||
64 | |||
65 | stop) | ||
66 | check_network_file_systems | ||
67 | check_network_swap | ||
68 | |||
69 | echo -n "Deconfiguring network interfaces... " | ||
70 | ifdown -a | ||
71 | echo "done." | ||
72 | ;; | ||
73 | |||
74 | force-reload|restart) | ||
75 | echo "Running $0 $1 is deprecated because it may not enable again some interfaces" | ||
76 | echo "Reconfiguring network interfaces... " | ||
77 | ifdown -a || true | ||
78 | ifup -a | ||
79 | echo "done." | ||
80 | ;; | ||
81 | |||
82 | *) | ||
83 | echo "Usage: /etc/init.d/networking {start|stop}" | ||
84 | exit 1 | ||
85 | ;; | ||
86 | esac | ||
87 | |||
88 | exit 0 | ||
89 | |||