mirror of
https://github.com/libretro/Lakka.git
synced 2024-12-03 13:40:56 +00:00
Merge pull request #247 from Gujs/openelec-updates
xbmc & xbmc-pvr: redesign of poweroff and reboot.
This commit is contained in:
commit
193df23d8f
@ -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"
|
||||
|
@ -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
|
||||
|
29
packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit
Executable file
29
packages/mediacenter/xbmc-pvr/scripts/wait_on_xbmc_exit
Executable 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
|
@ -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"
|
||||
|
@ -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
|
||||
|
29
packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit
Executable file
29
packages/mediacenter/xbmc/scripts/wait_on_xbmc_exit
Executable 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
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user