From 9f9504af2940940ba9dbcc781182b870f8863076 Mon Sep 17 00:00:00 2001 From: johan Date: Sun, 24 Nov 2013 13:37:30 +0100 Subject: [PATCH] Added XBian install Former-commit-id: 5e00e5ff99c57a31a1861cb2ebe6e03da2bc6e2f --- bin/install_hyperion.sh | 28 +++++++++++++++++++--------- bin/update_hyperion.sh | 38 ++++++++++++++++++++++++++++---------- deploy/hyperion.xbian.conf | 16 ++++++++++++++++ 3 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 deploy/hyperion.xbian.conf diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index ad6b5080..7d59d68d 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -2,6 +2,9 @@ # Script for downloading and installing the latest Hyperion release +# Find out if we are on XBian +IS_XBIAN=`cat /etc/issue | grep XBian | wc -l` + # Make sure that the boblight daemon is no longer running BOBLIGHT_PROCNR=$(ps -e | grep "boblight" | wc -l) if [ $BOBLIGHT_PROCNR -eq 1 ]; @@ -11,24 +14,31 @@ then fi # Stop hyperion daemon if it is running -initctl stop hyperion +/sbin/initctl stop hyperion +# Get the Hyperion executable wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperiond -P /usr/bin/ +chmod +x /usr/bin/hyperiond + +# Get the Hyperion command line utility wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion-remote -P /usr/bin/ +chmod +x /usr/bin/hyperion-remote # Copy the gpio changer (gpio->spi) to the /usr/bin -wget -N github.com/tvdzwan/hyperion/raw/master/deploy/gpio2spi -P /usr/bin/ +if [ $IS_XBIAN -eq 0 ]; then + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/gpio2spi -P /usr/bin/ + chmod +x /usr/bin/gpio2spi +fi # Copy the hyperion configuration file to /etc wget -N github.com/tvdzwan/hyperion/raw/master/config/hyperion.config.json -P /etc/ # Copy the service control configuration to /etc/int -wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.conf -P /etc/init/ - -# Set permissions -chmod +x /usr/bin/hyperiond -chmod +x /usr/bin/hyperion-remote -chmod +x /usr/bin/gpio2spi +if [ $IS_XBIAN -eq 0 ]; then + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.conf -P /etc/init/ +else + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.xbian.conf -P /etc/init/ -O hyperion.conf +fi # Start the hyperion daemon -initctl start hyperion +/sbin/initctl start hyperion diff --git a/bin/update_hyperion.sh b/bin/update_hyperion.sh index 21d039ef..8e1996b5 100755 --- a/bin/update_hyperion.sh +++ b/bin/update_hyperion.sh @@ -2,22 +2,40 @@ # Script for downloading and installing the latest Hyperion release -# Stop hyperion daemon if it is running -initctl stop hyperion +# Find out if we are on XBian +IS_XBIAN=`cat /etc/issue | grep XBian | wc -l` +# Make sure that the boblight daemon is no longer running +BOBLIGHT_PROCNR=$(ps -e | grep "boblight" | wc -l) +if [ $BOBLIGHT_PROCNR -eq 1 ]; +then + echo 'Found running instance of boblight. Please stop boblight via XBMC menu before installing hyperion' + exit +fi + +# Stop hyperion daemon if it is running +/sbin/initctl stop hyperion + +# Get the Hyperion executable wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperiond -P /usr/bin/ +chmod +x /usr/bin/hyperiond + +# Get the Hyperion command line utility wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion-remote -P /usr/bin/ +chmod +x /usr/bin/hyperion-remote # Copy the gpio changer (gpio->spi) to the /usr/bin -wget -N github.com/tvdzwan/hyperion/raw/master/deploy/gpio2spi -P /usr/bin/ +if [ $IS_XBIAN -eq 0 ]; then + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/gpio2spi -P /usr/bin/ + chmod +x /usr/bin/gpio2spi +fi # Copy the service control configuration to /etc/int -wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.conf -P /etc/init/ - -# Set permissions -chmod +x /usr/bin/hyperiond -chmod +x /usr/bin/hyperion-remote -chmod +x /usr/bin/gpio2spi +if [ $IS_XBIAN -eq 0 ]; then + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.conf -P /etc/init/ +else + wget -N github.com/tvdzwan/hyperion/raw/master/deploy/hyperion.xbian.conf -P /etc/init/ -O hyperion.conf +fi # Start the hyperion daemon -initctl start hyperion +/sbin/initctl start hyperion diff --git a/deploy/hyperion.xbian.conf b/deploy/hyperion.xbian.conf new file mode 100644 index 00000000..fa14a327 --- /dev/null +++ b/deploy/hyperion.xbian.conf @@ -0,0 +1,16 @@ +## Hyperion daemon + +description "hyperion" +author "poljvd & tvdzwan" + +start on (runlevel [2345]) +stop on (runlevel [!2345]) + +respawn + +pre-start script +modprobe spi-bcm2708 +end script + +exec /usr/bin/hyperiond /etc/hyperion.config.json +