xbmc-frodo: sync scripts with package 'xbmc'

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-05-30 20:14:59 +02:00
parent 7ec708a6ac
commit 4c2d0c78dc
5 changed files with 85 additions and 11 deletions

View File

@ -1,6 +1,6 @@
################################################################################
# Copyright (C) 2009-2010 OpenELEC.tv
# http://www.openelec.tv
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@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

View File

@ -17,6 +17,7 @@
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# setup XBMC
#
# runlevels: openelec

View File

@ -17,6 +17,7 @@
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# starting XBMC
#
# runlevels: openelec
@ -35,9 +36,6 @@ fi
# hack: make addon-bins executable
chmod +x /storage/.xbmc/addons/*/bin/* > /dev/null 2>&1
# hack: make addon-libs executable
chmod +x /storage/.xbmc/addons/*/lib/* > /dev/null 2>&1
# hack to support user installed fonts
SUBFONTS="/storage/.xbmc/userdata/fonts"
if [ -d "$SUBFONTS" ]; then
@ -64,28 +62,46 @@ fi
# waiting for Xorg to start
wait_for_xorg
# set cpu's to 'on demand'
# set cpu's to 'conservative'
( usleep 15000000
progress "set cpu's to 'on demand'"
cpupower frequency-set -g ondemand > /dev/null 2>&1
progress "set cpu's to 'conservative'"
cpupower frequency-set -g conservative > /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

@ -0,0 +1,28 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@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, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
if [ -f /sys/class/rtc/rtc0/wakealarm ]; then
logger -t setwakeup.sh "### Setting system wakeup time ###"
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo $1 > /sys/class/rtc/rtc0/wakealarm
logger -t setwakeup.sh "### $(cat /proc/driver/rtc) ###"
fi

View File

@ -0,0 +1,29 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@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, 51 Franklin Street, Suite 500, Boston, MA 02110, 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