#!/bin/sh
mount /proc
chmod -R 755 /opt/deploy
echo "Preparing PDK environment variables...."
`/opt/deploy/bin/setDeploymentEnv`
if [ "$DeployPath" = "" ] ; then
   echo "CRITICAL ERROR: DeployPath is not defined."
   sleep 180
fi
chmod -R 755 $DeployPath
echo "Initializing PDK hardware detect and log files...."
prepareDeployment
if [ $? -eq 0 ]
then
    addLogRecord rc.local INFO "Deployment started"
    customDeployment
fi
evaluateDeployment
ret=$?
echo "finished deployment with error level $ret"
addLogRecord initpdk INFO "Deployment finished with error level $ret"
