From 311c9bdb8848a5baced57b4c4af6c6b738f69939 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 5 Jun 2016 14:34:09 +0300 Subject: [PATCH] raspberrypi: always use motion-mrdave by default --- board/common/overlay/etc/init.d/S40network | 10 +++++- board/raspberrypi/overlay/usr/bin/motion | 36 ---------------------- board/raspberrypi2/overlay/usr/bin/motion | 36 ---------------------- board/raspberrypi3/overlay/usr/bin/motion | 36 ---------------------- 4 files changed, 9 insertions(+), 109 deletions(-) delete mode 100755 board/raspberrypi/overlay/usr/bin/motion delete mode 100755 board/raspberrypi2/overlay/usr/bin/motion delete mode 100755 board/raspberrypi3/overlay/usr/bin/motion diff --git a/board/common/overlay/etc/init.d/S40network b/board/common/overlay/etc/init.d/S40network index 989ae758a3..437d0d6d5d 100755 --- a/board/common/overlay/etc/init.d/S40network +++ b/board/common/overlay/etc/init.d/S40network @@ -83,6 +83,10 @@ start_wlan() { return 1 fi + if [ -n "$mtu" ]; then + ip link set mtu $mtu dev $wlan + fi + if [ -n "$static_ip" ]; then msg_done $static_ip ifconfig $wlan $static_ip up @@ -125,7 +129,7 @@ start_eth() { fi done - # wait up to link_nego_timeout seconds for link + # wait up to $link_nego_timeout seconds for link count=0 while [ "$(cat /sys/class/net/$eth/carrier 2>&1)" != "1" ]; do sleep 1 @@ -135,6 +139,10 @@ start_eth() { return 1 fi done + + if [ -n "$mtu" ]; then + ip link set mtu $mtu dev $eth + fi if [ -n "$static_ip" ]; then msg_done $static_ip diff --git a/board/raspberrypi/overlay/usr/bin/motion b/board/raspberrypi/overlay/usr/bin/motion deleted file mode 100755 index 1244c595cc..0000000000 --- a/board/raspberrypi/overlay/usr/bin/motion +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -MOTION_SVN="/usr/bin/motion-svn" -MOTION_MRDAVE="/usr/bin/motion-mrdave" -MOTION_MMAL="/usr/bin/motion-mmal" - -if [ "$1" == "-h" ]; then - # when asked about version, always report MrDave's, - # as it's the most featureful one - motion=$MOTION_MRDAVE - -else - conf_count=$(ls -1 /data/etc/thread-*.conf 2>/dev/null | wc -l) - - if [ "$conf_count" -eq 0 ]; then # no cameras - motion=$MOTION_MRDAVE - - elif [ "$conf_count" -eq 1 ]; then # one camera - if cat /data/etc/thread-*.conf | grep -E '^videodevice' &>/dev/null && - lsmod | grep bcm2835_v4l2 &>/dev/null; then # RPI CSI camera module - - motion=$MOTION_MMAL - else - motion=$MOTION_MRDAVE - - fi - - else # two or more cameras - motion=$MOTION_MRDAVE - fi -fi - -echo "using motion binary $motion" - -exec $motion "$@" - diff --git a/board/raspberrypi2/overlay/usr/bin/motion b/board/raspberrypi2/overlay/usr/bin/motion deleted file mode 100755 index 1244c595cc..0000000000 --- a/board/raspberrypi2/overlay/usr/bin/motion +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -MOTION_SVN="/usr/bin/motion-svn" -MOTION_MRDAVE="/usr/bin/motion-mrdave" -MOTION_MMAL="/usr/bin/motion-mmal" - -if [ "$1" == "-h" ]; then - # when asked about version, always report MrDave's, - # as it's the most featureful one - motion=$MOTION_MRDAVE - -else - conf_count=$(ls -1 /data/etc/thread-*.conf 2>/dev/null | wc -l) - - if [ "$conf_count" -eq 0 ]; then # no cameras - motion=$MOTION_MRDAVE - - elif [ "$conf_count" -eq 1 ]; then # one camera - if cat /data/etc/thread-*.conf | grep -E '^videodevice' &>/dev/null && - lsmod | grep bcm2835_v4l2 &>/dev/null; then # RPI CSI camera module - - motion=$MOTION_MMAL - else - motion=$MOTION_MRDAVE - - fi - - else # two or more cameras - motion=$MOTION_MRDAVE - fi -fi - -echo "using motion binary $motion" - -exec $motion "$@" - diff --git a/board/raspberrypi3/overlay/usr/bin/motion b/board/raspberrypi3/overlay/usr/bin/motion deleted file mode 100755 index 1244c595cc..0000000000 --- a/board/raspberrypi3/overlay/usr/bin/motion +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -MOTION_SVN="/usr/bin/motion-svn" -MOTION_MRDAVE="/usr/bin/motion-mrdave" -MOTION_MMAL="/usr/bin/motion-mmal" - -if [ "$1" == "-h" ]; then - # when asked about version, always report MrDave's, - # as it's the most featureful one - motion=$MOTION_MRDAVE - -else - conf_count=$(ls -1 /data/etc/thread-*.conf 2>/dev/null | wc -l) - - if [ "$conf_count" -eq 0 ]; then # no cameras - motion=$MOTION_MRDAVE - - elif [ "$conf_count" -eq 1 ]; then # one camera - if cat /data/etc/thread-*.conf | grep -E '^videodevice' &>/dev/null && - lsmod | grep bcm2835_v4l2 &>/dev/null; then # RPI CSI camera module - - motion=$MOTION_MMAL - else - motion=$MOTION_MRDAVE - - fi - - else # two or more cameras - motion=$MOTION_MRDAVE - fi -fi - -echo "using motion binary $motion" - -exec $motion "$@" -