summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/busybox/busybox_%.bbappend3
-rwxr-xr-xrecipes-core/busybox/files/ifplugd.init2
-rw-r--r--recipes-core/busybox/files/ifplugd.patch20
-rw-r--r--recipes-core/multitech/config/config-mths/default/dnsmasq17
-rw-r--r--recipes-core/multitech/config/config-mths/default/ntpd36
-rw-r--r--recipes-core/multitech/config/config-mths/default/usb-gadget6
-rw-r--r--recipes-core/multitech/config/config-mths/dnsmasq.d/dhcp.conf4
-rwxr-xr-xrecipes-core/multitech/config/config-mths/ifplugd/ifplugd.action30
-rw-r--r--recipes-core/multitech/config/config-mths/ifplugd/usb0.conf2
-rw-r--r--recipes-core/multitech/config/config-mths/network/interfaces.mths6
10 files changed, 121 insertions, 5 deletions
diff --git a/recipes-core/busybox/busybox_%.bbappend b/recipes-core/busybox/busybox_%.bbappend
index b8bbdf7..6ead22b 100644
--- a/recipes-core/busybox/busybox_%.bbappend
+++ b/recipes-core/busybox/busybox_%.bbappend
@@ -1,4 +1,4 @@
-PR .= ".mlinux3"
+PR .= ".mlinux4"
PACKAGES =+ "busybox-ifplugd"
FILESEXTRAPATHS_prepend := ":${THISDIR}/files:"
RDEPENDS_${PN} += "bash"
@@ -9,6 +9,7 @@ SRC_URI += "file://udhcpd.conf.example \
file://ifplugd.init \
file://eth0.conf \
file://eth1.conf.example \
+ file://ifplugd.patch \
"
do_install_append () {
diff --git a/recipes-core/busybox/files/ifplugd.init b/recipes-core/busybox/files/ifplugd.init
index 87f2408..418b088 100755
--- a/recipes-core/busybox/files/ifplugd.init
+++ b/recipes-core/busybox/files/ifplugd.init
@@ -9,7 +9,7 @@
startdaemon(){
# Start the application
echo -n "Starting ifplugd: "
- CONFS=($(find /etc/ifplugd -name '*.conf'))
+ CONFS=($(find -L /etc/ifplugd -name '*.conf'))
((i=0))
logger -p daemon.info "Found ${#CONFS[@]} Configurations"
while ((i < ${#CONFS[@]})) ; do
diff --git a/recipes-core/busybox/files/ifplugd.patch b/recipes-core/busybox/files/ifplugd.patch
new file mode 100644
index 0000000..839a8a2
--- /dev/null
+++ b/recipes-core/busybox/files/ifplugd.patch
@@ -0,0 +1,20 @@
+#
+# This patch is found here:
+# http://lists.busybox.net/pipermail/busybox/2018-March/086328.html
+# Basically ifplugd will not stay up if the driver is loading.
+# This is particularly apparent with gadget.
+diff -arNu a/networking/ifplugd.c b/networking/ifplugd.c
+--- a/networking/ifplugd.c 2019-05-28 18:11:43.836982315 -0500
++++ b/networking/ifplugd.c 2019-05-28 18:13:13.088979672 -0500
+@@ -358,8 +358,10 @@
+ ifrequest.ifr_flags |= IFF_UP;
+ /* Let user know we mess up with interface */
+ bb_error_msg("upping interface");
+- if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0)
++ if (network_ioctl(SIOCSIFFLAGS, &ifrequest, "setting interface flags") < 0) {
++ if (errno != ENODEV && errno != EADDRNOTAVAIL)
+ xfunc_die();
++ }
+ }
+
+ #if 0 /* why do we mess with IP addr? It's not our business */
diff --git a/recipes-core/multitech/config/config-mths/default/dnsmasq b/recipes-core/multitech/config/config-mths/default/dnsmasq
index a27c1c6..129fda1 100644
--- a/recipes-core/multitech/config/config-mths/default/dnsmasq
+++ b/recipes-core/multitech/config/config-mths/default/dnsmasq
@@ -1,3 +1,5 @@
+# MTHS dnsmasq
+# and a hook to set up config files for MTHS
ENABLED="yes"
# This configuration is for manufacturing test.
@@ -8,3 +10,18 @@ fi
# Stop ntpd. ntpd default is in root.
sed -i 's/ENABLED="yes"/ENABLED="no"/' /etc/default/ntpd
+# Use the ifplugd in /var/config
+if ! [[ -L /etc/ifplugd ]] ; then
+ rm -rf /etc/ifplugd
+ ln -s /var/config/ifplugd /etc/ifplugd
+ # ifplugd is already started (and probably bombed)
+ # restart it.
+ /etc/init.d/ifplugd stop
+ /etc/init.d/ifplugd start
+fi
+
+if ! [[ -L /etc/default/usb-gadget ]] && [[ -f /var/config/default/usb-gadget ]] ; then
+ rm -rf /etc/default/usb-gadget
+ ln -s /var/config/default/usb-gadget /etc/default/usb-gadget
+fi
+
diff --git a/recipes-core/multitech/config/config-mths/default/ntpd b/recipes-core/multitech/config/config-mths/default/ntpd
new file mode 100644
index 0000000..a0d3bcf
--- /dev/null
+++ b/recipes-core/multitech/config/config-mths/default/ntpd
@@ -0,0 +1,36 @@
+ENABLED="no"
+
+
+CONFIGFILE=/etc/ntp.conf
+
+# The GPSD_* parameters in this file are ignored
+# if the uBlox GPS is not present.
+
+# Require a GPS lock/fix before starting NTP
+# This is needed if we are not using NTP servers.
+# NTP will not work with the GPS if the GPS is not
+# locked before starting.
+# See /etc/default/gpsd for the states required.
+GPSD_REQUIRED=0
+
+# Number of seconds between testing for a GPS
+# lock prior to calling ntpd.
+GPSD_WAIT_TIME=120
+
+# Since the HW Clock could be off by a second or
+# so, our GPS might get marked as a false ticker
+# if we do not set the system clock to the GPS
+# first. The current correct way to do this
+# according to the ntp doc is ntpd -gq -c conffile
+# which must be done before ntpd is started.
+# conffile should exclude the local clock, so it is
+# ignored while doing the initial sync.
+# ntpd -gq apparently does not work with the GPS
+# when tested with the clock more than one day off
+# and no ntpd. The gps shared memory is never polled.
+#
+# If there is a uBlox GPS present, the time is
+# read from the GPS to initialize the system time
+# before NTP is started.
+SET_SYSTEM_CLOCK=1
+
diff --git a/recipes-core/multitech/config/config-mths/default/usb-gadget b/recipes-core/multitech/config/config-mths/default/usb-gadget
new file mode 100644
index 0000000..944ef8a
--- /dev/null
+++ b/recipes-core/multitech/config/config-mths/default/usb-gadget
@@ -0,0 +1,6 @@
+# set to "no" to disable usb-gadget
+ENABLED="yes"
+
+USB_MODE="networking"
+MODULE_OPTIONS=""
+
diff --git a/recipes-core/multitech/config/config-mths/dnsmasq.d/dhcp.conf b/recipes-core/multitech/config/config-mths/dnsmasq.d/dhcp.conf
index 837d0e2..47eb1c0 100644
--- a/recipes-core/multitech/config/config-mths/dnsmasq.d/dhcp.conf
+++ b/recipes-core/multitech/config/config-mths/dnsmasq.d/dhcp.conf
@@ -6,3 +6,7 @@ dhcp-option=option:netmask,255.255.255.0
dhcp-option=option:router,10.0.0.1
dhcp-option=option:dns-server,10.0.0.1
dhcp-authoritative
+interface=usb0
+dhcp-range=192.168.3.100,192.168.3.250,12h
+dhcp-option=option:router,192.168.3.1
+dhcp-option=option:dns-server,192.168.3.1
diff --git a/recipes-core/multitech/config/config-mths/ifplugd/ifplugd.action b/recipes-core/multitech/config/config-mths/ifplugd/ifplugd.action
new file mode 100755
index 0000000..e7184c7
--- /dev/null
+++ b/recipes-core/multitech/config/config-mths/ifplugd/ifplugd.action
@@ -0,0 +1,30 @@
+#!/bin/sh
+# $Id: ifplugd.action 99 2004-02-08 20:17:59Z lennart $
+
+# This file is part of ifplugd.
+#
+# ifplugd is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# ifplugd is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with ifplugd; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+set -e
+
+if [ -z "$1" ] || [ -z "$2" ] ; then
+ echo "Wrong arguments" > /dev/stderr
+ exit 1
+fi
+
+[ "$2" = "up" ] && exec /sbin/ifup $1
+[ "$2" = "down" ] && exec /sbin/ifdown $1
+
+exit 0
diff --git a/recipes-core/multitech/config/config-mths/ifplugd/usb0.conf b/recipes-core/multitech/config/config-mths/ifplugd/usb0.conf
new file mode 100644
index 0000000..2fa70b3
--- /dev/null
+++ b/recipes-core/multitech/config/config-mths/ifplugd/usb0.conf
@@ -0,0 +1,2 @@
+INTERFACE="usb0"
+ARGS="-M -fI -i ${INTERFACE} -u 0 -d 10 -r /etc/ifplugd/ifplugd.action"
diff --git a/recipes-core/multitech/config/config-mths/network/interfaces.mths b/recipes-core/multitech/config/config-mths/network/interfaces.mths
index 0f1541e..2463e0a 100644
--- a/recipes-core/multitech/config/config-mths/network/interfaces.mths
+++ b/recipes-core/multitech/config/config-mths/network/interfaces.mths
@@ -5,8 +5,8 @@ netmask 255.0.0.0
pre-up bash -c '([[ -d /sys/class/net/wifi1 ]] || /opt/rs9113/onebox_util rpine0 create_vap wifi1 ap)'
# Gadget USB
-auto usb1
-iface usb1 inet static
-address 192.168.2.1
+auto usb0
+iface usb0 inet static
+address 192.168.3.1
netmask 255.255.255.0