Merge commit '3f2d2d338122e71b6a22f58f43e57ac8dfb3fcc1' into dora

This commit is contained in:
Holger Hans Peter Freyther 2015-02-13 19:17:41 +01:00
commit 0f2f51f20c
6 changed files with 114 additions and 18 deletions

View File

@ -1,6 +1,6 @@
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/netbase-${PV}:${SYSMOCOM}/netbase:"
PRINC = "5"
PRINC = "7"
# systemd does not look at /etc/rcS.d for the script. Make sure
# there is a symlink available

View File

@ -0,0 +1,91 @@
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: networking
# Required-Start: mountvirtfs $local_fs
# Required-Stop: $local_fs
# Should-Start: ifupdown
# Should-Stop: ifupdown
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Raise network interfaces.
### END INIT INFO
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
[ -x /sbin/ifup ] || exit 0
check_network_file_systems() {
[ -e /proc/mounts ] || return 0
if [ -e /etc/iscsi/iscsi.initramfs ]; then
echo "not deconfiguring network interfaces: iSCSI root is mounted."
exit 0
fi
exec 9<&0 < /proc/mounts
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network devices still mounted."
exit 0
;;
esac
case $FSTYPE in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
echo "not deconfiguring network interfaces: network file systems still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
check_network_swap() {
[ -e /proc/swaps ] || return 0
exec 9<&0 < /proc/swaps
while read DEV MTPT FSTYPE REST; do
case $DEV in
/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
echo "not deconfiguring network interfaces: network swap still mounted."
exit 0
;;
esac
done
exec 0<&9 9<&-
}
case "$1" in
start)
echo -n "Configuring network interfaces... "
mkdir /run/network || true
sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
ifup -a
echo "done."
;;
stop)
check_network_file_systems
check_network_swap
echo -n "Deconfiguring network interfaces... "
ifdown -a
echo "done."
;;
force-reload|restart)
echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
echo "Reconfiguring network interfaces... "
ifdown -a || true
ifup -a
echo "done."
;;
*)
echo "Usage: /etc/init.d/networking {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -58,8 +58,12 @@ do_install () {
install -d ${D}${sysconfdir}/dbus-1/system.d
install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
fi
install -d ${D}/srv/tftp
}
FILES_${PN} += "/srv/tftp"
CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf"
RPROVIDES_${PN} += "${PN}-systemd"

View File

@ -286,8 +286,3 @@ dhcp-range=10.0.0.10,10.0.0.200,2h
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf

View File

@ -32,7 +32,7 @@ bogus-priv
# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
#resolv-file=/etc/resolv.conf.dhcp
# By default, dnsmasq will send queries to any of the upstream
# servers it knows about and tries to favour servers to are known
@ -72,7 +72,7 @@ bogus-priv
# If you want dnsmasq to listen for requests only on specified interfaces
# (and the loopback) give the name of the interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=eth2
#interface=eth2
# Or you can specify which interface _not_ to listen on
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
@ -106,7 +106,7 @@ interface=eth2
# 2) Sets the "domain" DHCP option thereby potentially setting the
# domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"
#domain=thekelleys.org.uk
domain=vessel.sob.sysmocom.de
# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
@ -121,7 +121,17 @@ interface=eth2
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
dhcp-range=172.16.2.2,172.16.3.254,255.255.254.0,168h
# DHCP range for the management network of the SOB-JB
dhcp-range=mgmt,172.16.2.10,172.16.3.254,255.255.254.0,168h
# DHCP range for native IP, this is just temporary so we see if
# there are any devices with wrong configuration
dhcp-range=native,172.16.4.10,172.16.4.254,255.255.254.0,168h
# DHCP range for administrative access via eth1
dhcp-range=admin,172.16.6.2,172.16.6.255,255.255.255.0,24h
# This is an example of a DHCP range with a network-id, so that
# some DHCP options may be set only for this network.
@ -287,8 +297,9 @@ dhcp-range=172.16.2.2,172.16.3.254,255.255.254.0,168h
# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
dhcp-hostsfile=/etc/dnsmasq.dhcp-hosts
enable-tftp
tftp-root=/srv/tftp/
tftp-secure

View File

@ -26,11 +26,6 @@ do_install() {
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifdown.${BPN}
ln -s ${base_sbindir}/ifup.${BPN} ${D}${base_sbindir}/ifquery
install -D -m 0755 settle-dad.sh ${D}/lib/ifupdown/settle-dad.sh
if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d ${localstatedir}/run/network - - - -" \
> ${D}${sysconfdir}/tmpfiles.d/02-ifupdown.conf
fi
}
inherit update-alternatives