Merge branch 'feature/test_rpi' into feature/pointgrey

This commit is contained in:
Pedro Gonçalves 2017-05-03 16:34:43 +01:00
commit 407eebad04
41 changed files with 11409 additions and 2538 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@
/lauv-aux-rpi
/ntnu-b2xx
/stamp9g20
/lctr-rpi

View File

@ -1,6 +1,6 @@
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2013 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2014 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -0,0 +1,15 @@
start()
{
if [ ! -f /opt/check_wlan ]; then
cp -ri /etc/check_wlan /opt/
fi
sh /opt/check_wlan < /dev/null > /dev/null 2>&1 &
}
stop()
{
echo "* Stopping process..."
killall sh /opt/check_wlan -9 > /dev/null 2>&1
echo "* Process not running."
}

View File

@ -0,0 +1,87 @@
start()
{
ifconfig wlan0 up
if [ -n "$cfg_eth_ext_ip$cfg_eth_prv_ip" ]; then
while [ 1 ]; do
echo "* Waiting for wlan0 device..."
ifconfig wlan0 > /dev/null 2>&1
[ $? -eq 0 ] && break
usleep 250000
done
fi
if [ -n "$cfg_bridge0_ip" ]; then
for itf in $cfg_bridge0_itfs; do
ifconfig $itf 0.0.0.0
done
brctl addbr bridge0
for itf in $cfg_bridge0_itfs; do
brctl addif bridge0 $itf
done
ifconfig bridge0 $cfg_bridge0_ip netmask $cfg_bridge0_nmask up
ifconfig bridge0 multicast
route add -net 224.0.0.0 netmask 240.0.0.0 dev bridge0
fi
# Public ethernet.
if [ -n "$cfg_eth_ext_ip" ]; then
if [ -n "$cfg_eth_ext_mk" ]; then
ifconfig wlan0 "$cfg_eth_ext_ip" netmask "$cfg_eth_ext_mk" up
else
ifconfig wlan0 "$cfg_eth_ext_ip" up
fi
ifconfig wlan0 multicast
route add -net 224.0.0.0 netmask 240.0.0.0 dev wlan0
# Fixed mac address with $cfg_eth_ext_mac based derivated from IP address $cfg_eth_ext_ip
if [ -n "$cfg_eth_ext_mac" ]; then
ifconfig wlan0 hw ether $cfg_eth_ext_mac
fi
fi
if [ -n "$cfg_eth_ext_gw" ]; then
route add default gw "$cfg_eth_ext_gw"
fi
if [ -n "$cfg_eth_ext_dns" ]; then
echo "nameserver $cfg_eth_ext_dns" > /etc/resolv.conf
fi
# Private ethernet.
if [ -n "$cfg_eth_prv_ip" ]; then
ifconfig wlan0:prv "$cfg_eth_prv_ip" up
fi
# Static ARP table.
if [ -n "$cfg_arp_table" ]; then
for e in $cfg_arp_table; do
ip="$(echo $e | cut -f1 -d'|')"
mac="$(echo $e | cut -f2 -d'|')"
arp -s "$ip" "$mac"
done
fi
iw wlan0 connect LSTS
ifconfig eth0 down
}
stop()
{
# Public ethernet.
if [ -n "$cfg_eth_ext_gw" ]; then
route del default
fi
if [ -n "$cfg_eth_ext_ip" ]; then
route del -net 224.0.0.0 netmask 240.0.0.0 dev wlan0
ifconfig wlan0 down
fi
# Private ethernet.
if [ -n "$cfg_eth_prv_ip" ]; then
ifconfig wlan0:prv down
fi
}

34
rules/iw/default.bash Normal file
View File

@ -0,0 +1,34 @@
version=\
(
"4.9"
)
url=\
(
"http://lsts.pt/glued/iw-$version.tar.bz2"
)
md5=\
(
"ae8ccaa154449300c2c02eb90a37eebb"
)
maintainer=\
(
'Pedro Gonçalves <pedro@lsts.pt>'
)
configure()
{
mv "../iw_$version/etc" "../iw-$version/"
mv "../iw_$version/lib" "../iw-$version/"
mv "../iw_$version/sbin" "../iw-$version/"
}
target_install()
{
$cmd_cp -r "etc/"* "$cfg_dir_rootfs/etc/"
$cmd_cp -r "sbin/"* "$cfg_dir_rootfs/sbin/"
$cmd_cp -r "lib/"* "$cfg_dir_rootfs/lib/"
$cmd_cp -r "$pkg_dir/fs/"* "$cfg_dir_rootfs/"
}

View File

@ -0,0 +1,46 @@
#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin:/bin
############################# USER INPUT ###########################
ip_dest=10.0.30.3
####################################################################
############### DON'T EDIT ##########################################
check_interval=1
log=/opt/.wifi.log
wlan=wlan0
eth=eth0
exec 1> /dev/null
exec 2>> $log
echo $(date) > $log
# without check_interval set, we risk a 0 sleep = busy loop
if [ ! "$check_interval" ]; then
echo "No check interval set!" >> $log
exit 1
fi
startWifi () {
iw wlan0 connect LSTS >> $log
}
ifconfig $eth down
ifconfig $wlan up
while [ 1 ]; do
ping -q -c1 $ip_dest > /dev/null
if [ $? -ne 0 ]; then
echo $(date)" attempting restart..." >> $log
startWifi
sleep 1
else
echo "IS LINKED" >> $log
sleep $check_interval
fi
done
#####################################################################

View File

@ -2,21 +2,19 @@
version=\
(
'3.18_2015-06-03'
'4.4_2017-01-27'
)
url=\
(
"https://github.com/rasmartins/rpi-linux/archive/rpi-linux-$version.tar.gz"
"http://lsts.pt/glued/rpi-linux-$version.zip"
)
md5=\
(
'0b0255e50ca358b619bb78653ac2db2e'
'f31d48a9d2c93509b35e750be489b44c'
)
post_unpack()
{
rmdir "../linux-$version" &&
mv "../rpi-linux-rpi-linux-$version" "../linux-$version"
}
build_dir="rpi-linux-rpi-linux-$version"
find_patches

View File

@ -0,0 +1,54 @@
version=\
(
"1.0.0"
)
url=\
(
"http://lsts.pt/glued/raspicam-$version.zip"
)
md5=\
(
"169e62fd17d41455a42711a2f9c54fd1"
)
maintainer=\
(
'Pedro Gonçalves <pedro@lsts.pt>'
)
configure()
{
LINKER_ADDED_FLAGS="-Wl,-rpath,${cfg_dir_rootfs}/usr/lib"
${cfg_dir_toolchain}/usr/local/bin/cmake \
-DCMAKE_SYSTEM_NAME="Linux" \
-DCMAKE_SYSTEM_VERSION="1" \
-DCMAKE_FIND_ROOT_PATH="${cfg_dir_toolchain_sysroot}/usr ${cfg_dir_rootfs}/usr" \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_C_COMPILER="${cmd_target_cc}" \
-DCMAKE_CXX_COMPILER="${cmd_target_cxx}" \
-DCMAKE_C_FLAGS="${cfg_target_gcc_flags}" \
.
}
build()
{
$cmd_make VERBOSE=1
}
host_install()
{
cd build/
$cmd_cp -r "lib/"* "$cfg_dir_toolchain_sysroot/usr/lib/"
$cmd_cp -r "inc/"* "$cfg_dir_toolchain_sysroot/usr/include/"
}
target_install()
{
cd build/
$cmd_cp -r "lib/"* "$cfg_dir_rootfs/usr/lib/"
$cmd_cp -r "bin/"* "$cfg_dir_rootfs/usr/bin/"
}

View File

@ -1,31 +1,29 @@
version=\
(
'2015-06-03'
'2017-02-02'
)
url=\
(
"https://github.com/rasmartins/rpi-boot-firmware/archive/rpi-boot-firmware-$version.tar.gz"
"http://lsts.pt/glued/rpi-boot-firmware-$version.zip"
)
maintainer=\
(
'Ricardo Martins <rasm@fe.up.pt>'
'Pedro Gonçalves <pedro@lsts.pt>'
)
md5=\
(
'a80ee36b66cccda4e9ccb7eb26bd6bb8'
'eb42664fce4d73f167064e697dfacb76'
)
target_install()
{
$cmd_mkdir \
"$cfg_dir_rootfs/boot" &&
$cmd_mkdir "$cfg_dir_rootfs/boot"
for f in bootcode.bin fixup.dat start.elf; do
$cmd_cp -r "../$pkg-$pkg-$version/$f" "$cfg_dir_rootfs/boot"
done &&
$cmd_cp "../$pkg-$version/"* "$cfg_dir_rootfs/boot/"
tar -C "$pkg_dir/fs" -c -f - . | tar -C "$cfg_dir_rootfs" -x -v -f -
}

View File

@ -1 +1 @@
dwc_otg.lpm_enable=0 console=ttyAMA0,115200,8n1 root=/dev/mmcblk0p2 elevator=deadline rootwait quiet
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 elevator=deadline rootwait quiet

45
rules/uv4l/default.bash Normal file
View File

@ -0,0 +1,45 @@
version=\
(
"1.0.0"
)
url=\
(
"http://lsts.pt/glued/uv4l.$version.tar.bz2"
)
md5=\
(
"869e884accbfa9c2356e2fd9307dd71c"
)
maintainer=\
(
'Pedro Gonçalves <pedro@lsts.pt>'
)
post_unpack()
{
mv "../etc" "../uv4l-$version/"
mv "../usr" "../uv4l-$version/"
touch startStreamRaspiCam.sh
echo "#!/bin/sh" >> startStreamRaspiCam.sh
echo "killall uv4l" >> startStreamRaspiCam.sh
echo "modprobe cuse" >> startStreamRaspiCam.sh
echo "uv4l -nopreview --auto-video_nr --driver raspicam --encoding h264 --width 1080 --height 720 --framerate 12 --quality 8 --server-option '--port=9090' --server-option '--max-queued-connections=30' --server-option '--max-streams=25' --server-option '--max-threads=29'" >> startStreamRaspiCam.sh
}
host_install()
{
$cmd_cp -r "usr/lib/"* "$cfg_dir_toolchain_sysroot/usr/lib/"
$cmd_cp -r "usr/include/"* "$cfg_dir_toolchain_sysroot/usr/include/"
}
target_install()
{
$cmd_cp -r "usr/lib/"* "$cfg_dir_rootfs/usr/lib/"
$cmd_cp -r "usr/bin/"* "$cfg_dir_rootfs/usr/bin/"
$cmd_cp -r "startStreamRaspiCam.sh" "$cfg_dir_rootfs/usr/bin/"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,12 @@ cfg_services1='lauv-storage-server'
cfg_services2='dune'
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind nfs-utils rpi-boot-firmware linux/rpi'
cfg_target_linux_kernel='arch/arm/boot/zImage'
cfg_target_linux_dtb='arch/arm/boot/dts/bcm2709-rpi-2-b.dtb'
cfg_ptpd_interface='eth0'
cfg_terminal='ttyAMA0'
cfg_lauv_storage_dir='/opt/lsts/dune/log'
cfg_partitions=\
(
rpi-boot boot0 512B 32MiB
rpi-boot BOOT0 512B 32MiB
root root0 32MiB 544MiB
data data0 544MiB -1
)

View File

@ -1 +1,9 @@
# Core.
arm_freq=1000
# Disable BT on Rpi3.
dtoverlay=pi3-disable-bt
# Enable RasPicam
start_x=1
gpu_mem=128

View File

@ -0,0 +1,2 @@
cfg_hostname='lauv-arpao-aux'
cfg_eth_ext_ip='10.0.10.63'

View File

@ -3,3 +3,4 @@ cfg_eth_ext_ip='10.0.200.24'
cfg_eth_ext_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1'
cfg_ptpd_interface='eth0'
cfg_services1=''

View File

@ -136,7 +136,7 @@ CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
CONFIG_KALLSYMS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
@ -1124,15 +1124,15 @@ CONFIG_SCx200_ACB=y
# PPS support
#
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
CONFIG_PPS_DEBUG=y
CONFIG_NTP_PPS=y
#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
CONFIG_PPS_CLIENT_KTIMER=y
CONFIG_PPS_CLIENT_LDISC=y
# CONFIG_PPS_CLIENT_GPIO is not set
CONFIG_PPS_CLIENT_GPIO=y
#
# PPS generators support
@ -1900,7 +1900,7 @@ CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_INFO=y
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=2048

View File

@ -0,0 +1,2 @@
cfg_hostname='lauv-arpao'
cfg_eth_ext_ip='10.0.10.60'

View File

@ -1,2 +1,3 @@
cfg_hostname='lauv-xplore-1'
cfg_eth_ext_ip='10.0.10.120'
cfg_modules="$cfg_modules ftdi_sio"

View File

@ -1,6 +0,0 @@
cfg_hostname='mariner-01'
cfg_storage='data0:ext4:/opt'
cfg_eth_ext_ip='10.0.20.125'
cfg_eth_ext_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1'
cfg_packages='u-boot dropbear rsync busybox e2fsprogs ptpd i2c-tools am33xx-cm3/host linux libav'

View File

@ -0,0 +1,31 @@
diff -Nru linux-3.14.63/arch/arm/boot/dts/am335x-lctr-b2xx.dts linux-3.14.63.mc/arch/arm/boot/dts/am335x-lctr-b2xx.dts
--- linux-3.14.63/arch/arm/boot/dts/am335x-lctr-b2xx.dts 2017-01-17 14:12:07.019022866 +0000
+++ linux-3.14.63.mc/arch/arm/boot/dts/am335x-lctr-b2xx.dts 2017-01-17 14:26:45.657383756 +0000
@@ -60,6 +60,16 @@
0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)
>;
};
+
+ /* UART4. */
+ uart4_pins: pinmux_uart4_pins {
+ pinctrl-single,pins = <
+ /* uart4_rxd */
+ 0x70 (PIN_INPUT_PULLUP | MUX_MODE6)
+ /* uart4_txd */
+ 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)
+ >;
+ };
};
/* Enable UART1. */
@@ -75,3 +85,10 @@
pinctrl-0 = <&uart2_pins>;
status = "okay";
};
+
+/* Enable UART4. */
+&uart4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart4_pins>;
+ status = "okay";
+};

File diff suppressed because it is too large Load Diff

17
systems/lctr-rpi/config Normal file
View File

@ -0,0 +1,17 @@
cfg_architecture='cortex-a8-hardfp'
cfg_storage='data0:ext4:/opt'
cfg_modules=''
cfg_services0='network dropbear storage upgrade syslog ptpd'
cfg_services2='dune'
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind rpi-boot-firmware linux/rpi'
cfg_target_linux_kernel='arch/arm/boot/zImage'
cfg_ptpd_interface='eth0'
cfg_eth_ext_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1'
cfg_terminal='tty1'
cfg_partitions=\
(
rpi-boot BOOT0 512B 32MiB
root root0 32MiB 544MiB
data data0 544MiB -1
)

View File

@ -0,0 +1,9 @@
# Core.
arm_freq=1000
# Disable BT on Rpi3.
dtoverlay=pi3-disable-bt
# Enable RasPicam
start_x=1
gpu_mem=128

View File

@ -0,0 +1,4 @@
::sysinit:/sbin/services sysinit
::restart:/sbin/init
::respawn:-/usr/sbin/dropbear -F
::shutdown:/sbin/services syshalt

View File

@ -0,0 +1,2 @@
ttyAMA0 root:root 660 >terminal
ttyUSB[0-9]* root:root 660 */sbin/mdev-ttyusb

View File

@ -0,0 +1,4 @@
cfg_hostname='mariner-01'
cfg_eth_ext_ip='10.0.20.125'
cfg_packages="$cfg_packages raspicam libjpeg-turbo v4l-utils uv4l libav"
cfg_modules="$cfg_modules ftdi_sio"

View File

@ -0,0 +1,4 @@
cfg_hostname='nest-1'
cfg_eth_ext_ip='10.0.35.1'
cfg_services1='huawei'
cfg_packages="$cfg_packages ppp iptables"

View File

@ -0,0 +1,9 @@
cfg_hostname='test-rpi'
cfg_eth_ext_ip='10.0.200.52'
cfg_services1=''
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind rpi-boot-firmware linux/rpi raspicam libjpeg-turbo v4l-utils uv4l iw'
cfg_services0='network-wlan dropbear storage upgrade syslog ptpd check_wlan'
cfg_modules="$cfg_modules ftdi_sio rt73usb"
cfg_terminal='tty1'
cfg_ptpd_interface='wlan0'

View File

@ -0,0 +1,4 @@
cfg_hostname='x2o-01'
cfg_eth_ext_ip='10.0.20.140'
cfg_packages="$cfg_packages raspicam libjpeg-turbo v4l-utils uv4l libav"
cfg_modules="$cfg_modules ftdi_sio"

View File

@ -0,0 +1,4 @@
cfg_hostname='x2o-02'
cfg_eth_ext_ip='10.0.20.145'
cfg_packages="$cfg_packages raspicam libjpeg-turbo v4l-utils uv4l libav"
cfg_modules="$cfg_modules ftdi_sio"

View File

@ -0,0 +1,4 @@
cfg_hostname='x8-08'
cfg_eth_ext_ip='10.0.20.115'
cfg_packages="$cfg_packages raspicam libjpeg-turbo v4l-utils uv4l libav"
cfg_modules="$cfg_modules ftdi_sio"

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2015 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #

View File

@ -1,7 +1,7 @@
#! /bin/bash
###########################################################################
# GLUED: GNU/Linux Uniform Environment Distribution #
# Copyright (C) 2007-2013 Universidade do Porto - Faculdade de Engenharia #
# Copyright (C) 2007-2017 Universidade do Porto - Faculdade de Engenharia #
# Laboratório de Sistemas e Tecnologia Subaquática (LSTS) #
###########################################################################
# This program is free software; you can redistribute it and/or modify #