Merge branch 'feature/test_rpi' into feature/gcc_5.4

This commit is contained in:
Pedro Gonçalves 2017-05-11 19:36:58 +01:00
commit 7cee4b531b
27 changed files with 11339 additions and 5193 deletions

View File

@ -26,4 +26,5 @@ requires=\
'parted/host' 'parted/host'
'dosfstools/host' 'dosfstools/host'
'e2fsprogs/host' 'e2fsprogs/host'
'cmake/host'
) )

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=\ version=\
( (
'3.18_2015-06-03' '4.4_2017-01-27'
) )
url=\ url=\
( (
"https://github.com/rasmartins/rpi-linux/archive/rpi-linux-$version.tar.gz" "http://lsts.pt/glued/rpi-linux-$version.zip"
) )
md5=\ md5=\
( (
'0b0255e50ca358b619bb78653ac2db2e' 'f31d48a9d2c93509b35e750be489b44c'
) )
post_unpack() build_dir="rpi-linux-rpi-linux-$version"
{
rmdir "../linux-$version" && find_patches
mv "../rpi-linux-rpi-linux-$version" "../linux-$version"
}

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=\ version=\
( (
'2015-06-03' '2017-02-02'
) )
url=\ 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=\ maintainer=\
( (
'Ricardo Martins <rasm@fe.up.pt>' 'Ricardo Martins <rasm@fe.up.pt>'
'Pedro Gonçalves <pedro@lsts.pt>'
) )
md5=\ md5=\
( (
'a80ee36b66cccda4e9ccb7eb26bd6bb8' 'eb42664fce4d73f167064e697dfacb76'
) )
target_install() target_install()
{ {
$cmd_mkdir \ $cmd_mkdir "$cfg_dir_rootfs/boot"
"$cfg_dir_rootfs/boot" &&
for f in bootcode.bin fixup.dat start.elf; do $cmd_cp "../$pkg-$version/"* "$cfg_dir_rootfs/boot/"
$cmd_cp -r "../$pkg-$pkg-$version/$f" "$cfg_dir_rootfs/boot"
done &&
tar -C "$pkg_dir/fs" -c -f - . | tar -C "$cfg_dir_rootfs" -x -v -f - 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_services2='dune'
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind nfs-utils rpi-boot-firmware linux/rpi' 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_kernel='arch/arm/boot/zImage'
cfg_target_linux_dtb='arch/arm/boot/dts/bcm2709-rpi-2-b.dtb'
cfg_ptpd_interface='eth0' cfg_ptpd_interface='eth0'
cfg_terminal='ttyAMA0' cfg_terminal='ttyAMA0'
cfg_lauv_storage_dir='/opt/lsts/dune/log' cfg_lauv_storage_dir='/opt/lsts/dune/log'
cfg_partitions=\ cfg_partitions=\
( (
rpi-boot boot0 512B 32MiB rpi-boot BOOT0 512B 32MiB
root root0 32MiB 544MiB root root0 32MiB 544MiB
data data0 544MiB -1 data data0 544MiB -1
) )

View File

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

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_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1' cfg_eth_ext_gw='10.0.0.1'
cfg_ptpd_interface='eth0' cfg_ptpd_interface='eth0'
cfg_services1=''

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'

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -5,14 +5,13 @@ cfg_services0='network dropbear storage upgrade syslog ptpd'
cfg_services2='dune' cfg_services2='dune'
cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind rpi-boot-firmware linux/rpi' cfg_packages='dropbear rsync busybox e2fsprogs dosfstools ptpd rpcbind rpi-boot-firmware linux/rpi'
cfg_target_linux_kernel='arch/arm/boot/zImage' 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_ptpd_interface='eth0'
cfg_eth_ext_mk='255.255.0.0' cfg_eth_ext_mk='255.255.0.0'
cfg_eth_ext_gw='10.0.0.1' cfg_eth_ext_gw='10.0.0.1'
cfg_terminal='ttyAMA0' cfg_terminal='tty1'
cfg_partitions=\ cfg_partitions=\
( (
rpi-boot boot0 512B 32MiB rpi-boot BOOT0 512B 32MiB
root root0 32MiB 544MiB root root0 32MiB 544MiB
data data0 544MiB -1 data data0 544MiB -1
) )

View File

@ -1 +1,9 @@
# Core.
arm_freq=1000 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,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

@ -1,4 +1,4 @@
cfg_hostname='nest-1' cfg_hostname='nest-1'
cfg_eth_ext_ip='10.0.200.40' cfg_eth_ext_ip='10.0.35.1'
cfg_services1='huawei'
cfg_packages="$cfg_packages ppp iptables" 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"