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 Feb 5, 2018
2 parents 14b2016 + 5b3c63c commit be2d10c
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 9 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.5.0"
os_version="2.6.0"
80 changes: 80 additions & 0 deletions board/common/overlay/usr/share/post-upgrade/2.6.0.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
4 changes: 2 additions & 2 deletions package/kerberosio-machinery/CPackConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ 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.4.0")
SET(CPACK_PACKAGE_VERSION "2.5.0")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_MINOR "5")
SET(CPACK_PACKAGE_VERSION_PATCH "0")

SET(CPACK_SYSTEM_NAME "armhf")
Expand Down
59 changes: 59 additions & 0 deletions package/libv4l/0002-ir-ctl-fixes-for-musl-compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From 9908872aaa614a6c4bba80d7a5f1adea7ca7117e Mon Sep 17 00:00:00 2001
From: Peter Seiderer <[email protected]>
Date: Tue, 14 Feb 2017 21:27:59 +0100
Subject: [PATCH] ir-ctl: fixes for musl compile

- add copy of TEMP_FAILURE_RETRY macro
- use strdup instead of strdupa

Fixes [1]:

ir-ctl.c:(.text+0xb06): undefined reference to `strndupa'
ir-ctl.c:(.text+0xe01): undefined reference to `TEMP_FAILURE_RETRY'

[1] http://autobuild.buildroot.net/results/b8b96c7bbf2147dacac62485cbfdbcfd758271a5

Signed-off-by: Peter Seiderer <[email protected]>
---
utils/ir-ctl/ir-ctl.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
index bc58cee..e9da777 100644
--- a/utils/ir-ctl/ir-ctl.c
+++ b/utils/ir-ctl/ir-ctl.c
@@ -44,6 +44,15 @@

# define N_(string) string

+/* taken from glibc unistd.h */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif

/* See drivers/media/rc/ir-lirc-codec.c line 23 */
#define LIRCBUF_SIZE 512
@@ -344,12 +353,14 @@ static struct file *read_scancode(const char *name)
return NULL;
}

- pstr = strndupa(name, p - name);
+ pstr = strndup(name, p - name);

if (!protocol_match(pstr, &proto)) {
fprintf(stderr, _("error: protocol '%s' not found\n"), pstr);
+ free(pstr);
return NULL;
}
+ free(pstr);

if (!strtoscancode(p + 1, &scancode)) {
fprintf(stderr, _("error: invalid scancode '%s'\n"), p + 1);
--
2.11.0

21 changes: 17 additions & 4 deletions package/libv4l/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ config BR2_PACKAGE_LIBV4L
depends on !BR2_STATIC_LIBS # dlopen()
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 # media headers
select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC
select BR2_PACKAGE_ARGP_STANDALONE if BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL
select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
help
libv4l is a collection of libraries which adds a thin abstraction
layer on top of video4linux2 devices. libv4l consists of 3 different
libraries: libv4lconvert, libv4l1 and libv4l2.

http://freshmeat.net/projects/libv4l
http://linuxtv.org/wiki/index.php/V4l-utils

if BR2_PACKAGE_LIBV4L

Expand All @@ -21,11 +21,24 @@ comment "libv4l JPEG support not enabled"

config BR2_PACKAGE_LIBV4L_UTILS
bool "v4l-utils tools"
depends on BR2_ENABLE_LOCALE
select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
help
v4l-utils is a collection of various video4linux and DVB utilities.
Enable this if you want to build the following tools:
cx18-ctl, ir-keytable, ivtv-ctl, v4l2-ctl, v4l2-sysfs-path and
others.
- cx18-ctl
- dvb-fe-tool, dvbv5-zap, dvbv5-scan, dvb-format-convert
- decode_tm6000
- ir-keytable
- media-ctl
- v4l2-compliance
- v4l2-ctl, cx18-ctl, ivtv-ctl
- v4l2-sysfs-path
- rds-ctl
- qv4l2 (if Qt is enabled)

comment "libv4l-utils tools need a toolchain w/ locale"
depends on !BR2_ENABLE_LOCALE

endif

Expand Down
2 changes: 1 addition & 1 deletion package/libv4l/libv4l.hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Locally calculated
sha256 164abf5c1befcd27e8e6ef824a82d4015bdfb5d99ae82daa00e77d895ff9864c v4l-utils-1.6.3.tar.bz2
sha256 ac9f8c88bfffa3a7e85c0edd04f7d3d54e6a30c214e79f2c6ecc6fbf57cb229d v4l-utils-1.12.2.tar.bz2
35 changes: 34 additions & 1 deletion package/libv4l/libv4l.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

LIBV4L_VERSION = 1.6.3
LIBV4L_VERSION = 1.12.2
LIBV4L_SOURCE = v4l-utils-$(LIBV4L_VERSION).tar.bz2
LIBV4L_SITE = http://linuxtv.org/downloads/v4l-utils
LIBV4L_INSTALL_STAGING = YES
Expand All @@ -18,6 +18,10 @@ LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
LIBV4L_LICENSE = GPLv2+ (utilities), LGPLv2.1+ (libraries)
LIBV4L_LICENSE_FILES = COPYING COPYING.libv4l lib/libv4l1/libv4l1-kernelcode-license.txt

ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
LIBV4L_DEPENDENCIES += alsa-lib
endif

ifeq ($(BR2_PACKAGE_ARGP_STANDALONE),y)
LIBV4L_DEPENDENCIES += argp-standalone
LIBV4L_LIBS += -largp
Expand All @@ -32,17 +36,46 @@ else
LIBV4L_CONF_OPTS += --without-jpeg
endif

ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
LIBV4L_DEPENDENCIES += libgl
endif

ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
LIBV4L_CONF_OPTS += --with-libudev
LIBV4L_DEPENDENCIES += udev
else
LIBV4L_CONF_OPTS += --without-libudev
endif

ifeq ($(BR2_PACKAGE_LIBGLU),y)
LIBV4L_DEPENDENCIES += libglu
endif

ifeq ($(BR2_PACKAGE_LIBV4L_UTILS),y)
LIBV4L_CONF_OPTS += --enable-v4l-utils
# clock_gettime is used, which is provided by librt for glibc < 2.17
LIBV4L_LIBS += -lrt
ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
LIBV4L_DEPENDENCIES += gettext
endif
ifeq ($(BR2_PACKAGE_QT5BASE)$(BR2_PACKAGE_QT5BASE_GUI)$(BR2_PACKAGE_QT5BASE_WIDGETS),yyy)
LIBV4L_CONF_OPTS += --enable-qv4l2
LIBV4L_DEPENDENCIES += qt5base
# protect against host version detection of moc-qt5/rcc-qt5/uic-qt5
LIBV4L_CONF_ENV += \
ac_cv_prog_MOC=$(HOST_DIR)/usr/bin/moc \
ac_cv_prog_RCC=$(HOST_DIR)/usr/bin/rcc \
ac_cv_prog_UIC=$(HOST_DIR)/usr/bin/uic
# qt5 needs c++11 (since qt-5.7)
ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11"
endif
else ifeq ($(BR2_PACKAGE_QT_OPENGL_GL_DESKTOP),y)
LIBV4L_CONF_OPTS += --enable-qv4l2
LIBV4L_DEPENDENCIES += qt
else
LIBV4L_CONF_OPTS += --disable-qv4l2
endif
else
LIBV4L_CONF_OPTS += --disable-v4l-utils
endif
Expand Down

0 comments on commit be2d10c

Please sign in to comment.