From 3cbf0f9d71e5d431472d661e3ba1c4bb1227dce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Gon=C3=A7alves?= Date: Mon, 30 Apr 2018 18:41:12 +0100 Subject: [PATCH] lctr-rpi/rpi-camera-aux: add lauv-storage-client to cfg_services1. --- .../fs/etc/rc.d/lauv-storage-client | 45 +++++++++++++++++++ systems/lauv-aux-rpi/lauv-xtreme-2-cam.cfg | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 systems/lauv-aux-rpi/fs/etc/rc.d/lauv-storage-client diff --git a/systems/lauv-aux-rpi/fs/etc/rc.d/lauv-storage-client b/systems/lauv-aux-rpi/fs/etc/rc.d/lauv-storage-client new file mode 100644 index 0000000..00ba17a --- /dev/null +++ b/systems/lauv-aux-rpi/fs/etc/rc.d/lauv-storage-client @@ -0,0 +1,45 @@ +mount_path() +{ + rpath="$cfg_lauv_storage_host:$1" + lpath="$1" + + mkdir -p "$lpath" + + mount -t nfs -o wsize=32768 "$rpath" "$lpath" + if [ $? -eq 0 ]; then + echo "* Mounted '$rpath' in '$lpath'" + return 0 + fi + + return 1 +} + +start() +{ + /usr/bin/rpcbind + if [ $? -ne 0 ]; then + echo "ERROR: failed to start rpcbind." + return 1 + fi + + for path in $cfg_lauv_storage_paths; do + n=0; while [ $n -lt "$cfg_lauv_storage_timeout" ]; do + mount_path "$path" + if [ $? -eq 0 ]; then + break + fi + + let n++ + sleep 1 + done + done +} + +stop() +{ + killall rpcbind + + for path in $cfg_lauv_storage_paths; do + umount "$path" + done +} diff --git a/systems/lauv-aux-rpi/lauv-xtreme-2-cam.cfg b/systems/lauv-aux-rpi/lauv-xtreme-2-cam.cfg index cb26b09..5375523 100644 --- a/systems/lauv-aux-rpi/lauv-xtreme-2-cam.cfg +++ b/systems/lauv-aux-rpi/lauv-xtreme-2-cam.cfg @@ -2,6 +2,10 @@ cfg_hostname='lauv-xtreme-2-cam' cfg_eth_ext_ip='10.0.10.52' cfg_eth_ext_mk='255.255.0.0' cfg_eth_ext_gw='10.0.0.1' +cfg_lauv_storage_dir=/opt/lsts/dune/log +cfg_lauv_storage_host=10.0.10.53 +cfg_lauv_storage_paths=/opt/lsts/dune/log +cfg_lauv_storage_timeout=60 cfg_ptpd_interface='eth0' -cfg_services1='usbmount' +cfg_services1='lauv-storage-client' cfg_packages='dropbear rsync busybox e2fsprogs dosfstools rpcbind rpi-boot-firmware linux/rpi exiv2 pointgrey opencv nfs-utils ptpd'