From 576577f9c9496679da46efed098d79b5ad89a2cb Mon Sep 17 00:00:00 2001 From: Henning Heinold Date: Tue, 23 Jun 2015 16:59:54 +0200 Subject: [PATCH] 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] --- conf/machine/include/sysmobts.inc | 2 +- conf/machine/sysmocom-bsc.conf | 3 +- .../sysmobts-v2/interfaces | 17 +++ .../sysmocom-bsc/interfaces | 23 ++++ .../sysmocom-idu/interfaces | 127 ++++++++++++++++++ .../sysmocom-odu/interfaces | 10 ++ .../init-ifupdown_sysmocom-master.inc | 2 + .../busybox/busybox-1.23.2/busybox-ifplugd.sh | 36 ----- recipes-core/busybox/busybox-1.23.2/defconfig | 2 +- .../ifplugd-use-a-larger-netlink-buffer.patch | 62 --------- recipes-core/busybox/busybox_sysmocom.inc | 16 +-- .../busybox/busybox_sysmocom_1.21.1.inc | 18 ++- recipes-core/busybox/files/busybox-ifplugd.sh | 36 ----- yocto-master/init-ifupdown_1.0.bbappend | 2 +- 14 files changed, 204 insertions(+), 152 deletions(-) create mode 100644 recipes-bsp/init-ifupdown/init-ifupdown-master/sysmobts-v2/interfaces create mode 100644 recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-bsc/interfaces create mode 100644 recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces create mode 100644 recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-odu/interfaces create mode 100644 recipes-bsp/init-ifupdown/init-ifupdown_sysmocom-master.inc delete mode 100644 recipes-core/busybox/busybox-1.23.2/busybox-ifplugd.sh delete mode 100644 recipes-core/busybox/busybox-1.23.2/ifplugd-use-a-larger-netlink-buffer.patch delete mode 100644 recipes-core/busybox/files/busybox-ifplugd.sh diff --git a/conf/machine/include/sysmobts.inc b/conf/machine/include/sysmobts.inc index f18e099..e1c71b1 100644 --- a/conf/machine/include/sysmobts.inc +++ b/conf/machine/include/sysmobts.inc @@ -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 \ diff --git a/conf/machine/sysmocom-bsc.conf b/conf/machine/sysmocom-bsc.conf index c7d81b7..65bc535 100644 --- a/conf/machine/sysmocom-bsc.conf +++ b/conf/machine/sysmocom-bsc.conf @@ -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 " diff --git a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmobts-v2/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmobts-v2/interfaces new file mode 100644 index 0000000..0282859 --- /dev/null +++ b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmobts-v2/interfaces @@ -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 + diff --git a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-bsc/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-bsc/interfaces new file mode 100644 index 0000000..65a70b4 --- /dev/null +++ b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-bsc/interfaces @@ -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 + diff --git a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces new file mode 100644 index 0000000..86d2c8b --- /dev/null +++ b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-idu/interfaces @@ -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 diff --git a/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-odu/interfaces b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-odu/interfaces new file mode 100644 index 0000000..7817a4c --- /dev/null +++ b/recipes-bsp/init-ifupdown/init-ifupdown-master/sysmocom-odu/interfaces @@ -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 + diff --git a/recipes-bsp/init-ifupdown/init-ifupdown_sysmocom-master.inc b/recipes-bsp/init-ifupdown/init-ifupdown_sysmocom-master.inc new file mode 100644 index 0000000..f9c58ed --- /dev/null +++ b/recipes-bsp/init-ifupdown/init-ifupdown_sysmocom-master.inc @@ -0,0 +1,2 @@ +SYSMOCOM := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +FILESEXTRAPATHS_prepend := "${SYSMOCOM}/init-ifupdown-${PV}:${SYSMOCOM}/init-ifupdown-master:" diff --git a/recipes-core/busybox/busybox-1.23.2/busybox-ifplugd.sh b/recipes-core/busybox/busybox-1.23.2/busybox-ifplugd.sh deleted file mode 100644 index 05052bc..0000000 --- a/recipes-core/busybox/busybox-1.23.2/busybox-ifplugd.sh +++ /dev/null @@ -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 diff --git a/recipes-core/busybox/busybox-1.23.2/defconfig b/recipes-core/busybox/busybox-1.23.2/defconfig index 4bef60a..058eb98 100644 --- a/recipes-core/busybox/busybox-1.23.2/defconfig +++ b/recipes-core/busybox/busybox-1.23.2/defconfig @@ -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 diff --git a/recipes-core/busybox/busybox-1.23.2/ifplugd-use-a-larger-netlink-buffer.patch b/recipes-core/busybox/busybox-1.23.2/ifplugd-use-a-larger-netlink-buffer.patch deleted file mode 100644 index a0670a5..0000000 --- a/recipes-core/busybox/busybox-1.23.2/ifplugd-use-a-larger-netlink-buffer.patch +++ /dev/null @@ -1,62 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Henning Heinold - -From da331d779c19d7d5d4ef05152ee467d617913a01 Mon Sep 17 00:00:00 2001 -From: Tito Ragusa -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 -Signed-off-by: Denys Vlasenko ---- - 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 - diff --git a/recipes-core/busybox/busybox_sysmocom.inc b/recipes-core/busybox/busybox_sysmocom.inc index 76a469e..9be36e2 100644 --- a/recipes-core/busybox/busybox_sysmocom.inc +++ b/recipes-core/busybox/busybox_sysmocom.inc @@ -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 diff --git a/recipes-core/busybox/busybox_sysmocom_1.21.1.inc b/recipes-core/busybox/busybox_sysmocom_1.21.1.inc index 130fab6..a4fa5e3 100644 --- a/recipes-core/busybox/busybox_sysmocom_1.21.1.inc +++ b/recipes-core/busybox/busybox_sysmocom_1.21.1.inc @@ -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/ +} diff --git a/recipes-core/busybox/files/busybox-ifplugd.sh b/recipes-core/busybox/files/busybox-ifplugd.sh deleted file mode 100644 index da09605..0000000 --- a/recipes-core/busybox/files/busybox-ifplugd.sh +++ /dev/null @@ -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 diff --git a/yocto-master/init-ifupdown_1.0.bbappend b/yocto-master/init-ifupdown_1.0.bbappend index 486a6a7..5536549 100644 --- a/yocto-master/init-ifupdown_1.0.bbappend +++ b/yocto-master/init-ifupdown_1.0.bbappend @@ -1 +1 @@ -require recipes-bsp/init-ifupdown/${PN}_sysmocom.inc +require recipes-bsp/init-ifupdown/${PN}_sysmocom-master.inc