summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/init-ifupdown
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core/init-ifupdown
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/init-ifupdown')
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright11
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init90
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces31
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces5
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces8
-rw-r--r--meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb39
14 files changed, 273 insertions, 0 deletions
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 0000000000..2a8e0d1264
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
@@ -0,0 +1,11 @@
1This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
2Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
3<ajt@debian.org> until 2001.
4It is currently maintained by Marco d'Itri <md@linux.it>.
5
6Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
7
8The programs in this package are distributed under the terms of the GNU
9General Public License, version 2 as distributed by the Free Software
10Foundation. On Debian systems, a copy of this license may be found in
11/usr/share/common-licenses/GPL-2.
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 0000000000..fb31c635be
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
@@ -0,0 +1,90 @@
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
13PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
14
15[ -x /sbin/ifup ] || exit 0
16
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}
57
58case "$1" in
59start)
60 echo -n "Configuring network interfaces... "
61 sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
62 ifup -a
63 echo "done."
64 ;;
65
66stop)
67 check_network_file_systems
68 check_network_swap
69
70 echo -n "Deconfiguring network interfaces... "
71 ifdown -a
72 echo "done."
73 ;;
74
75force-reload|restart)
76 echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
77 echo "Reconfiguring network interfaces... "
78 ifdown -a || true
79 ifup -a
80 echo "done."
81 ;;
82
83*)
84 echo "Usage: /etc/init.d/networking {start|stop}"
85 exit 1
86 ;;
87esac
88
89exit 0
90
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 0000000000..0acf4cf441
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -0,0 +1,31 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7# Wireless interfaces
8iface wlan0 inet dhcp
9 wireless_mode managed
10 wireless_essid any
11 wpa-driver wext
12 wpa-conf /etc/wpa_supplicant.conf
13
14iface atml0 inet dhcp
15
16# Wired or wireless interfaces
17auto eth0
18iface eth0 inet dhcp
19iface eth1 inet dhcp
20
21# Ethernet/RNDIS gadget (g_ether)
22# ... or on host side, usbnet and random hwaddr
23iface usb0 inet static
24 address 192.168.7.2
25 netmask 255.255.255.0
26 network 192.168.7.0
27 gateway 192.168.7.1
28
29# Bluetooth networking
30iface bnep0 inet dhcp
31
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 0000000000..750c0a98f9
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
@@ -0,0 +1,39 @@
1#! /bin/sh
2
3# In case the interface is used as nfsroot, avoid ifup, otherwise
4# nfsroot may lose response
5
6nfsroot=0
7
8if test "x$IFACE" = xlo ; then
9 exit 0
10fi
11
12exec 9<&0 < /proc/mounts
13while read dev mtpt fstype rest; do
14 if test $mtpt = "/" ; then
15 case $fstype in
16 nfs | nfs4)
17 nfsroot=1
18 nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
19 break
20 ;;
21 *)
22 ;;
23 esac
24 fi
25done
26exec 0<&9 9<&-
27
28test $nfsroot -eq 0 && exit 0
29
30if [ -x /bin/ip -o -x /sbin/ip ] ; then
31 nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
32fi
33
34if test "x$IFACE" = "x$nfs_iface" ; then
35 echo "ifup skipped for nfsroot interface $nfs_iface"
36 exit 1
37fi
38
39exit 0
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 0000000000..16967763e5
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
@@ -0,0 +1,5 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 0000000000..f62b9a897d
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
@@ -0,0 +1,8 @@
1# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2
3# The loopback interface
4auto lo
5iface lo inet loopback
6
7
8
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 0000000000..3d88506c05
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
@@ -0,0 +1,39 @@
1SUMMARY = "Basic TCP/IP networking init scripts and configuration files"
2DESCRIPTION = "This package provides high level tools to configure network interfaces"
3HOMEPAGE = "http://packages.debian.org/ifupdown"
4SECTION = "base"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
7PR = "r7"
8
9inherit update-rc.d
10
11INITSCRIPT_NAME = "networking"
12INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ."
13
14SRC_URI = "file://copyright \
15 file://init \
16 file://interfaces \
17 file://nfsroot"
18
19do_install () {
20 install -d ${D}${sysconfdir}/init.d \
21 ${D}${sysconfdir}/network/if-pre-up.d \
22 ${D}${sysconfdir}/network/if-up.d \
23 ${D}${sysconfdir}/network/if-down.d \
24 ${D}${sysconfdir}/network/if-post-down.d
25 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking
26 install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces
27 install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d
28}
29
30do_install_append_qemuall () {
31 # Disable network manager on machines that commonly do NFS booting
32 touch ${D}${sysconfdir}/network/nm-disabled-eth0
33}
34
35PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}"
36RDEPENDS_${PN} = "netbase"
37RCONFLICTS_${PN} = "netbase (< 1:5.0)"
38
39CONFFILES_${PN} = "${sysconfdir}/network/interfaces"