Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Verstraeten committed Mar 31, 2018
2 parents be2d10c + 07fac2f commit e654847
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 36 deletions.
2 changes: 1 addition & 1 deletion board/common/overlay/etc/version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
os_name="Kerberos.io OS"
os_short_name="kios"
os_prefix="kios"
os_version="2.6.0"
os_version="2.6.1"
80 changes: 80 additions & 0 deletions board/common/overlay/usr/share/post-upgrade/2.6.1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash

##########################################
#
# Update configuration files for machinery
#

KERBEROS_CONFIG_DIR="/etc/opt/kerberosio/config"
DATA_CONFIG_DIR="/data/machinery/config"
TEMP_CONFIG_DIR="/tmp/config"

# Copy files to tmp folder and overwrite data config files

rm -rf $TEMP_CONFIG_DIR
mkdir -p $TEMP_CONFIG_DIR
cp -r $DATA_CONFIG_DIR/* $TEMP_CONFIG_DIR
cp -r $KERBEROS_CONFIG_DIR/* $DATA_CONFIG_DIR

# Loop over old config files and adjust new configuration
# with previous values.

for oldfile in $TEMP_CONFIG_DIR/*
do
for newfile in $DATA_CONFIG_DIR/*
do
if [ ${oldfile#$TEMP_CONFIG_DIR} == ${newfile#$DATA_CONFIG_DIR} ]
then
lineNumber=1

while read p
do
name=`echo $p | grep -E "\<(.*?)\>(.*?)<(.*?)\>" | cut -d ">" -f1 | cut -d "<" -f2 | cut -d " " -f1`
value=`echo $p | grep -E "\<(.*?)\>(.*?)<(.*?)\>" | cut -d ">" -f2 | cut -d "<" -f1`

if [ -n "$name" ]
then
#echo "looking for " $name " in " $newfile " with old value " $value

while read -r line ; do
number=`echo $line | cut -d ':' -f1`
if [[ $lineNumber -le $number ]]
then
newvalue=`echo $line | sed -e "s/^$number:[ \t]*//"`
echo $newvalue
if [[ "$p" != "$newvalue" ]]
then
# convert & special characters.
p=`echo $p | sed "s#\&#aampperssand#g"`

sed $number"s#$newvalue#$p#" $newfile > $newfile"1"

# revert special characters
sed $number"s#aampperssand#\&#g" $newfile"1" > $newfile"2"
rm $newfile"1"

mv $newfile"2" $newfile
fi
lineNumber=$number
break
fi
done <<< "$(grep -n "$name " $newfile)"
fi

done < $oldfile
fi
done
done

chmod -R 777 $DATA_CONFIG_DIR

mkdir -p /data/machinery/h264
chmod -R 777 /data/machinery/h264

##########################################
#
# Update configuration files for web
#

cp /var/www/web/config/app.php /data/web/config/app.php
chmod 777 /data/web/config/app.php
17 changes: 17 additions & 0 deletions package/ffmpeg/workaround-chinese-ipcameras.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 261e970b75..a8f10485f9 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -949,6 +949,12 @@ static void rtsp_parse_transport(AVFormatContext *s,
&th->server_port_max, &p);
}
} else if (!strcmp(parameter, "interleaved")) {
+ /*
+ * Workaround for some chinese cameras
+ * This should be safe as RFC states that 'interleaved' is for TCP
+ * ref Page 40 of rfc2326
+ */
+ th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
if (*p == '=') {
p++;
rtsp_parse_range(&th->interleaved_min,
4 changes: 2 additions & 2 deletions package/kerberosio-machinery/CPackConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Cédric Verstraeten")
SET(CPACK_PACKAGE_DESCRIPTION "Kerberos is a low-budget surveillance solution, that uses computer vision algorithms to detect changes, and that can trigger other devices. Kerberos is open source so you, but also other people, can customize the source to your needs and share it with our community. It has a green footprint when deploying on the Raspberry Pi and it's easy to install, you only need to transfer the image to the SD card and you're done.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION}")

SET(CPACK_PACKAGE_VERSION "2.5.0")
SET(CPACK_PACKAGE_VERSION "2.5.1")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "5")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_VERSION_PATCH "1")

SET(CPACK_SYSTEM_NAME "armhf")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
Expand Down
40 changes: 7 additions & 33 deletions package/kerberosio-machinery/buildroot.patch
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
diff --git a/.travis.yml b/.travis.yml
index b96f04d..8c84722 100755
index a4c4dc8..cfd18f6 100755
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,14 @@
@@ -1,3 +1,7 @@
+branches:
+ except:
+ - buildroot-patch
+
sudo:
- false
-
+
- false
os:
- linux
-
-language:
+
+language:
- cpp

services:
@@ -17,7 +21,7 @@ before_install:
- sudo apt-get update
- sudo apt-get install x264 v4l-utils

-script:
+script:
mkdir build && cd build && cmake .. && make && make check && sudo make install

notifications:
@@ -39,4 +43,4 @@ after_success:
docker build --build-arg APP_ENV="$TRAVIS_BRANCH" -t kerberos/machinery:$TRAVIS_BRANCH .;
docker push kerberos/machinery:$TRAVIS_BRANCH;
fi
- fi
\ No newline at end of file
+ fi
diff --git a/cmake/External-Googletest.cmake b/cmake/External-Googletest.cmake
index fd95600..f0b0e1b 100755
--- a/cmake/External-Googletest.cmake
Expand All @@ -51,17 +25,17 @@ index fd95600..f0b0e1b 100755
INSTALL_COMMAND ""
)
diff --git a/cmake/External-Mosquitto.cmake b/cmake/External-Mosquitto.cmake
index 3873da3..6d50002 100644
index 74ac55c..9d34110 100644
--- a/cmake/External-Mosquitto.cmake
+++ b/cmake/External-Mosquitto.cmake
@@ -10,6 +10,7 @@ ExternalProject_Add(mosquitto
CMAKE_GENERATOR ${gen}
INSTALL_COMMAND mkdir -p ../thirdparty/lib/ && cp lib/cpp/libmosquittopp.a ../thirdparty/lib/
INSTALL_COMMAND mkdir -p ../thirdparty/lib/ && cp lib/cpp/libmosquittopp.a ../thirdparty/lib/ && cp lib/libmosquitto.a ../thirdparty/lib/
CMAKE_ARGS
+ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/../../host/usr/share/buildroot/toolchainfile.cmake
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/thirdparty
-DWITH_UUID=no
-DWITH_WEBSOCKETS=no
-DWITH_WEBSOCKETS=OFF
-DWITH_SRV=OFF
diff --git a/cmake/External-OpenCV.cmake b/cmake/External-OpenCV.cmake
index 25adc1e..a8a0e0e 100755
--- a/cmake/External-OpenCV.cmake
Expand Down

0 comments on commit e654847

Please sign in to comment.