Merge pull request #247 from Gujs/openelec-updates

xbmc & xbmc-pvr: redesign of poweroff and reboot.
This commit is contained in:
Stephan Raue 2012-02-29 02:05:46 -08:00
commit 193df23d8f
8 changed files with 110 additions and 6 deletions

View File

@ -71,22 +71,40 @@ fi
cpupower frequency-set -g ondemand > /dev/null 2>&1
)&
# prevent restrating XBMC at reboot or shutdown
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
# starting XBMC
usleep $XBMC_STARTDELAY
while true; do
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
usleep 250000
done
DISPLAY=:0.0 /usr/lib/xbmc/xbmc.bin $XBMC_ARGS > /dev/null 2>&1
RET=$?
case "$RET" in
0)
poweroff -f
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
64)
poweroff -f
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
66)
reboot
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
reboot
fi
;;
255)
echo "Abnormal Exit. Exited with code $RET"

View File

@ -27,6 +27,7 @@ PYTHON_LIBDIR="`ls -d $INSTALL/usr/lib/python*`"
mkdir -p $INSTALL/usr/bin
cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin
cp $PKG_DIR/scripts/gputemp $INSTALL/usr/bin
cp $PKG_DIR/scripts/wait_on_xbmc_exit $INSTALL/usr/bin
cp $PKG_BUILD/tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send
mkdir -p $INSTALL/usr/lib/xbmc

View File

@ -0,0 +1,29 @@
#!/bin/sh
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
count=0
while [ $(pidof xbmc.bin) -a $count -le 20 ]; do
usleep 250000
logger -t wait_on_xbmc_exit "### Waiting for XBMC to Exit - $count ###"
count=$((count+1))
done

View File

@ -71,22 +71,40 @@ fi
cpupower frequency-set -g ondemand > /dev/null 2>&1
)&
# prevent restrating XBMC at reboot or shutdown
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
[ -f "$LOCKDIR/$LOCKFILE" ] && rm -f "$LOCKDIR/$LOCKFILE" &
# starting XBMC
usleep $XBMC_STARTDELAY
while true; do
while [ -f "$LOCKDIR/$LOCKFILE" ]; do
usleep 250000
done
DISPLAY=:0.0 /usr/lib/xbmc/xbmc.bin $XBMC_ARGS > /dev/null 2>&1
RET=$?
case "$RET" in
0)
poweroff -f
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
64)
poweroff -f
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
poweroff -f
fi
;;
66)
reboot
if [ ! $(pidof console-kit-daemon) ]; then
touch "$LOCKDIR/$LOCKFILE"
reboot
fi
;;
255)
echo "Abnormal Exit. Exited with code $RET"

View File

@ -27,6 +27,7 @@ PYTHON_LIBDIR="`ls -d $INSTALL/usr/lib/python*`"
mkdir -p $INSTALL/usr/bin
cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin
cp $PKG_DIR/scripts/gputemp $INSTALL/usr/bin
cp $PKG_DIR/scripts/wait_on_xbmc_exit $INSTALL/usr/bin
cp $PKG_BUILD/tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send
mkdir -p $INSTALL/usr/lib/xbmc

View File

@ -0,0 +1,29 @@
#!/bin/sh
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
count=0
while [ $(pidof xbmc.bin) -a $count -le 20 ]; do
usleep 250000
logger -t wait_on_xbmc_exit "### Waiting for XBMC to Exit - $count ###"
count=$((count+1))
done

View File

@ -20,4 +20,8 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
touch "$LOCKDIR/$LOCKFILE"
wait_on_xbmc_exit
reboot

View File

@ -20,4 +20,8 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
LOCKDIR="/var/lock/"
LOCKFILE="xbmc.disabled"
touch "$LOCKDIR/$LOCKFILE"
wait_on_xbmc_exit
poweroff