gs-common: Update init scripts from BP2A
Change-Id: Ibb8d3715ec6cb9ebb5d89e116374d468dfcad826
This commit is contained in:
parent
eeb40af781
commit
dc28234ecd
6 changed files with 94 additions and 15 deletions
|
@ -4,22 +4,27 @@ DIR=/data/vendor/dump_touch
|
|||
LOCKFILE="$DIR"/dumping
|
||||
LOGFILE="$DIR"/dump.log
|
||||
|
||||
if [ ! -f $LOCKFILE ]
|
||||
if [ ! -f $LOCKFILE ] || [ ! -f $LOGFILE ] || [ "$(cat $LOCKFILE)" = 0 ]
|
||||
then
|
||||
echo "-----------------------------------------------------"
|
||||
echo "Error : PreDump Touch Logs couldn't be found."
|
||||
echo "Info : Touch debug data not found! Backfilling..."
|
||||
echo "-----------------------------------------------------"
|
||||
exit 2
|
||||
/vendor/bin/predump_touch.sh > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
state=$(cat $LOCKFILE)
|
||||
if [ "$state" != 2 ]
|
||||
then
|
||||
echo "Unexpected state! Expected 2 but found ${state}" >> $LOGFILE
|
||||
echo "Unexpected state! Expected 2 but found ${state}"
|
||||
fi
|
||||
|
||||
cat $LOGFILE
|
||||
echo "" > $LOGFILE
|
||||
|
||||
echo 0 > $LOCKFILE
|
||||
if [ -f $LOGFILE ]
|
||||
then
|
||||
cat $LOGFILE
|
||||
echo "" > $LOGFILE
|
||||
fi
|
||||
|
||||
if [ -f $LOCKFILE ]
|
||||
then
|
||||
echo 0 > $LOCKFILE
|
||||
fi
|
||||
|
|
|
@ -18,10 +18,13 @@ then
|
|||
chmod 660 $LOGFILE
|
||||
fi
|
||||
|
||||
echo $(date) >> $LOGFILE
|
||||
date >> $LOGFILE
|
||||
|
||||
state=$(cat $LOCKFILE)
|
||||
if [ "$state" != 0 ]
|
||||
if [ "$state" = 2 ]
|
||||
then
|
||||
echo "Warning : Pending predump data detected (state=${state})" >> $LOGFILE
|
||||
elif [ "$state" != 0 ]
|
||||
then
|
||||
echo "Unexpected state! Expected 0 but found ${state}" >> $LOGFILE
|
||||
fi
|
||||
|
@ -33,7 +36,7 @@ do
|
|||
echo "----------------------------------" >> $LOGFILE
|
||||
echo "$entry" >> $LOGFILE
|
||||
echo "----------------------------------" >> $LOGFILE
|
||||
sh $entry >> $LOGFILE
|
||||
sh "$entry" >> $LOGFILE 2>&1
|
||||
echo "----------------------------------" >> $LOGFILE
|
||||
done
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue