busybox/init-ifupdown: do not use ifplugd on master

- remove file with wrong path to ifplugd
  recipes-core/busybox/files/busybox-ifplugd.sh
  DAEMON=/usr/bin/ifplugd vs. /usr/sbin/ifplugd

- use lambda expression for sysmobts/sysmobsc-kernel to
  include busybox-ifplugd or not

- use different defconfig files between master
  and dora to enable ifplugd or not

- use different interfaces files between master
  and dora to enable auto stanza or not
  for the dhcp interface

Fixes:  SYS#868 and SYS#1535

[hfreyther: Try to pick an option less likely to break the
Dora support but allowing us to move forward. Not entirely
compile tested due IO load of the system]
This commit is contained in:
Henning Heinold 2015-06-23 16:59:54 +02:00 committed by Holger Hans Peter Freyther
parent 29faf705ed
commit 576577f9c9
14 changed files with 204 additions and 152 deletions

View File

@ -19,7 +19,7 @@ EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
MACHINE_FEATURES = "kernel26 serial"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
busybox-ifplugd \
${@['', 'busybox-ifplugd'][d.getVar('DISTRO_VERSION', True)[0:3] == '1.5']} \
${@['watchdog', ''][d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd']} \
kernel \
kernel-module-dspdl \

View File

@ -34,4 +34,5 @@ GLIBC_EXTRA_OECONF = "--with-tls"
#MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\
busybox-ifplugd linux-firmware-rtl-nic "
${@['', 'busybox-ifplugd'][d.getVar('DISTRO_VERSION', True)[0:3] == '1.5']} \
linux-firmware-rtl-nic "

View File

@ -0,0 +1,17 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
#eth0 is our gateway to the network.
auto eth0
iface eth0 inet dhcp
#eth0 will provide dhcp to clients
#auto eth0:1
#iface eth0:1 inet static
# address 10.42.123.1
# netmask 255.255.255.0
# network 10.42.123.0

View File

@ -0,0 +1,23 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
#eth0 is our gateway to the network.
auto eth0
iface eth0 inet dhcp
#eth1 will provide dhcp to clients
auto eth1
iface eth1 inet static
address 10.23.24.1
netmask 255.255.255.0
network 10.23.24.0
auto eth1:1
iface eth1:1 inet static
address 10.23.123.1
netmask 255.255.255.0
network 10.23.123.0

View File

@ -0,0 +1,127 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# eth0 is attached to the IDU-internal managed switch (IES-3080)
# in the future we will use VLANs to use individual switch ports as
# break-out interfaces. For now we simply do DHCP.
# VLAN 2000: The iridium openport satellite modem attached to
# port 1 of the IES-3080
auto eth0.2000
iface eth0.2000 inet static
address 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
post-up ip r add 10.6.1.0/24 via 192.168.0.1
post-up ip r add 5.9.81.48/32 via 192.168.0.1 metric 100
# VLAN 2001: Reserved for a future C-Band satellite modem
# attached to port 8 of the IES-3080
auto eth0.2001
iface eth0.2001 inet manual
# VLAN 2002: Reserved for a future Inmarsat satellite modem
# attached to port 7 of the IES-3080
auto eth0.2002
#iface eth0.2002 inet dhcp
iface eth0.2002 inet manual
# management VLAN of IES-3080 switch (172.16.2.3)
auto eth0.6
iface eth0.6 inet manual
# video VLAN on IES-3080
auto eth0.9
iface eth0.9 inet manual
#eth1 is our admin interface and will provide dhcp to clients
auto eth1
iface eth1 inet static
address 172.16.6.1
netmask 255.255.255.0
network 172.16.6.0
# eth2 is attached to the IDU-internal SOB-JB02-SW
auto eth2
iface eth2 inet static
bridge_ports eth2
bridge_maxwait 0
address 172.16.4.1
netmask 255.255.254.0
network 172.16.4.0
# management VLAN towards {N,P}JB
auto eth2.6
iface eth2.6 inet manual
# bridge for VLAN 6: management VLAN
auto br-mgmt
iface br-mgmt inet static
bridge_ports eth2.6 eth0.6
bridge_maxwait 0
address 172.16.2.1
netmask 255.255.254.0
network 172.16.2.0
# bridge for VLAN9: video
auto br-video
iface br-video inet static
bridge_ports eth2.9 eth0.9
bridge_maxwait 0
address 172.16.9.1
netmask 255.255.255.0
network 172.16.9.0
# 172.16.1.1 is the service IP address for SOBMGMT
auto br-mgmt:0
iface br-mgmt:0 inet static
address 172.16.1.1
netmask 255.255.255.255
# GSM management VLAN
auto eth2.7
iface eth2.7 inet static
address 172.16.7.1
netmask 255.255.255.0
network 172.16.7.0
# Video VLAN on JB02, part of br-video
auto eth2.9
iface eth2.9 inet manual
# admin WiFi
auto eth2.1001
iface eth2.1001 inet static
address 172.16.8.1
netmask 255.255.255.0
network 172.16.8.0
# onboad WiFi
auto eth2.1002
iface eth2.1002 inet static
address 172.16.128.1
netmask 255.255.252.0
network 172.16.128.0
# remote WiFi
auto eth2.1003
iface eth2.1003 inet static
address 172.16.132.1
netmask 255.255.252.0
network 172.16.132.0
# JB-facing device for Inmarsat Satlite Crew
auto eth2.1004
iface eth2.1004 inet manual
# uplink of Inmarsat Satlite Crew
auto eth0.1004
iface eth0.1004 inet manual
auto br-satlite
iface br-satlite inet manual
bridge_ports eth0.1004 eth2.1004
bridge_maxwait 0

View File

@ -0,0 +1,10 @@
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
auto lo eth0
# The loopback interface
iface lo inet loopback
# eth0
iface eth0 inet dhcp

View File

@ -0,0 +1,2 @@
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/init-ifupdown-${PV}:${SYSMOCOM}/init-ifupdown-master:"

View File

@ -1,36 +0,0 @@
#!/bin/sh
DAEMON=/usr/sbin/ifplugd
NAME=ifplugd
DESC="Busybox ifplugd Server"
ARGS=" -i eth0 -M -I -r /etc/ifplugd.sh"
test -f $DAEMON || exit 1
set -e
case "$1" in
start)
echo -n "starting $DESC: $NAME... "
/sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
echo "done."
;;
stop)
echo -n "stopping $DESC: $NAME... "
/sbin/start-stop-daemon -K -n $NAME
echo "done."
;;
restart)
echo "Not restarting $DESC: $NAME... "
;;
reload)
echo -n "reloading $DESC: $NAME... "
killall -HUP $(basename ${DAEMON})
echo "done."
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac
exit 0

View File

@ -772,7 +772,7 @@ CONFIG_FEATURE_IFCONFIG_STATUS=y
CONFIG_FEATURE_IFCONFIG_HW=y
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
# CONFIG_IFENSLAVE is not set
CONFIG_IFPLUGD=y
# CONFIG_IFPLUGD is not set
CONFIG_IFUPDOWN=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
# CONFIG_FEATURE_IFUPDOWN_IP is not set

View File

@ -1,62 +0,0 @@
Upstream-Status: Backport
Signed-off-by: Henning Heinold <henning@itconsulting-heinold.de>
From da331d779c19d7d5d4ef05152ee467d617913a01 Mon Sep 17 00:00:00 2001
From: Tito Ragusa <farmatito@tiscali.it>
Date: Sun, 4 Aug 2013 18:08:40 +0200
Subject: [PATCH 001/104] ifplugd: use a larger netlink buffer
function old new delta
check_existence_through_netlink 310 321 +11
Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
networking/ifplugd.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/networking/ifplugd.c b/networking/ifplugd.c
index 3cdc2c9..b578f4c 100644
--- a/networking/ifplugd.c
+++ b/networking/ifplugd.c
@@ -451,20 +451,24 @@ static smallint detect_link(void)
static NOINLINE int check_existence_through_netlink(void)
{
int iface_len;
- char replybuf[1024];
+ /* Buffer was 1K, but on linux-3.9.9 it was reported to be too small.
+ * netlink.h: "limit to 8K to avoid MSG_TRUNC when PAGE_SIZE is very large".
+ * Note: on error returns (-1) we exit, no need to free replybuf.
+ */
+ enum { BUF_SIZE = 8 * 1024 };
+ char *replybuf = xmalloc(BUF_SIZE);
iface_len = strlen(G.iface);
while (1) {
struct nlmsghdr *mhdr;
ssize_t bytes;
- bytes = recv(netlink_fd, &replybuf, sizeof(replybuf), MSG_DONTWAIT);
+ bytes = recv(netlink_fd, replybuf, BUF_SIZE, MSG_DONTWAIT);
if (bytes < 0) {
if (errno == EAGAIN)
- return G.iface_exists;
+ goto ret;
if (errno == EINTR)
continue;
-
bb_perror_msg("netlink: recv");
return -1;
}
@@ -507,6 +511,8 @@ static NOINLINE int check_existence_through_netlink(void)
}
}
+ ret:
+ free(replybuf);
return G.iface_exists;
}
--
1.7.10.4

View File

@ -1,20 +1,16 @@
SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/busybox-${SYSMOCOM_ORIG_PV}:${SYSMOCOM}/files:"
PRINC = "27"
PRINC = "28"
SRC_URI += "file://busybox-ifplugd.sh \
file://ifplugd.sh \
file://udhcpc-ntp.sh \
SRC_URI += "file://udhcpc-ntp.sh \
file://udhcpc-ntp.default \
file://udhcpc.default \
"
PACKAGES =+ "${PN}-ifplugd ${PN}-udhcpc-ntp"
PACKAGES =+ "${PN}-udhcpc-ntp"
FILES_${PN}-udhcpc += "${sysconfdir}/default/udhcpc"
FILES_${PN}-ifplugd = "${sysconfdir}/ifplugd.sh ${sysconfdir}/init.d/busybox-ifplugd.sh"
FILES_${PN}-udhcpc-ntp = "${sysconfdir}/udhcpc.d/60ntp \
${sysconfdir}/default/udhcpc-ntp \
"
@ -22,15 +18,9 @@ FILES_${PN}-udhcpc-ntp = "${sysconfdir}/udhcpc.d/60ntp \
CONFFILES_${PN}-udhcpc += "${sysconfdir}/default/udhcpc"
CONFFILES_${PN}-udhcpc-ntp = "${sysconfdir}/default/udhcpc-ntp"
INITSCRIPT_PACKAGES += "${PN}-ifplugd"
INITSCRIPT_NAME = "busybox-ifplugd.sh"
RDEPENDS_${PN}-udhcpc-ntp = "${PN}-udhcpc"
do_install_append() {
install -m 0755 ${WORKDIR}/ifplugd.sh ${D}${sysconfdir}/
install -m 0755 ${WORKDIR}/busybox-ifplugd.sh ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/udhcpc-ntp.sh ${D}/${sysconfdir}/udhcpc.d/60ntp
install -d ${D}/${sysconfdir}/default
install -m 0644 ${WORKDIR}/udhcpc-ntp.default ${D}/${sysconfdir}/default/udhcpc-ntp

View File

@ -1,2 +1,18 @@
SRC_URI += "file://ifplugd-use-a-larger-netlink-buffer.patch"
PRINC := "${@int(PRINC) + 1}"
SRC_URI += "file://ifplugd-use-a-larger-netlink-buffer.patch \
file://busybox-ifplugd.sh \
file://ifplugd.sh \
"
PACKAGES =+ "${PN}-ifplugd"
FILES_${PN}-ifplugd = "${sysconfdir}/ifplugd.sh ${sysconfdir}/init.d/busybox-ifplugd.sh"
INITSCRIPT_PACKAGES += "${PN}-ifplugd"
INITSCRIPT_NAME = "busybox-ifplugd.sh"
do_install_append() {
install -m 0755 ${WORKDIR}/ifplugd.sh ${D}${sysconfdir}/
install -m 0755 ${WORKDIR}/busybox-ifplugd.sh ${D}${sysconfdir}/init.d/
}

View File

@ -1,36 +0,0 @@
#!/bin/sh
DAEMON=/usr/bin/ifplugd
NAME=ifplugd
DESC="Busybox ifplugd Server"
ARGS=" -i eth0 -M -I -r /etc/ifplugd.sh"
test -f $DAEMON || exit 1
set -e
case "$1" in
start)
echo -n "starting $DESC: $NAME... "
/sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
echo "done."
;;
stop)
echo -n "stopping $DESC: $NAME... "
/sbin/start-stop-daemon -K -n $NAME
echo "done."
;;
restart)
echo "Not restarting $DESC: $NAME... "
;;
reload)
echo -n "reloading $DESC: $NAME... "
killall -HUP $(basename ${DAEMON})
echo "done."
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
;;
esac
exit 0

View File

@ -1 +1 @@
require recipes-bsp/init-ifupdown/${PN}_sysmocom.inc
require recipes-bsp/init-ifupdown/${PN}_sysmocom-master.inc