lctr-rpi/rpi-camera-aux: add lauv-storage-client to cfg_services1.

This commit is contained in:
Pedro Gonçalves 2018-04-30 18:41:12 +01:00
parent 970365d5bf
commit 3cbf0f9d71
2 changed files with 50 additions and 1 deletions

View File

@ -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
}

View File

@ -2,6 +2,10 @@ cfg_hostname='lauv-xtreme-2-cam'
cfg_eth_ext_ip='10.0.10.52' cfg_eth_ext_ip='10.0.10.52'
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_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_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' cfg_packages='dropbear rsync busybox e2fsprogs dosfstools rpcbind rpi-boot-firmware linux/rpi exiv2 pointgrey opencv nfs-utils ptpd'