Merge remote-tracking branch 'refs/remotes/origin/master' into Beta

Former-commit-id: 4ad7195cb635410c8f4c36bb074c5cd4f22c1944
This commit is contained in:
brindosch 2016-05-05 14:12:24 +02:00
commit cd0526a414
3 changed files with 54 additions and 31 deletions

View File

@ -12,6 +12,9 @@ Hyperion is an opensource 'AmbiLight' implementation supported by many devices.
* A scriptable effect engine. * A scriptable effect engine.
* Generic software architecture to support new devices and new algorithms easily. * Generic software architecture to support new devices and new algorithms easily.
More information can be found on the [wiki](wiki.hyperion-project.org) or the [Hyperion webpage/forum](www.hyperion-project.org). More information can be found on the official Hyperion [Wiki](https://wiki.hyperion-project.org)
If you need further support please open a topic at the our new forum!
[Hyperion webpage/forum](https://www.hyperion-project.org).
The source is released under MIT-License (see http://opensource.org/licenses/MIT). The source is released under MIT-License (see http://opensource.org/licenses/MIT).

View File

@ -23,7 +23,7 @@ fi
#Set welcome message #Set welcome message
if [ $BETA -eq 1 ]; then if [ $BETA -eq 1 ]; then
WMESSAGE="echo This script will update Hyperion to the latest BETA" WMESSAGE="echo This script will update Hyperion to the latest BETA"
else WMESSAGE="echo This script will install/update Hyperion ambilight" else WMESSAGE="echo This script will install/update Hyperion Ambilight"
fi fi
#Welcome message #Welcome message
@ -32,8 +32,10 @@ $WMESSAGE
echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.' echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.'
echo '*******************************************************************************' echo '*******************************************************************************'
# Find out if we are on OpenElec / OSMC / Raspbian # Find out if we are on OpenElec (Rasplex) / OSMC / Raspbian
OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue` OS_OPENELEC=`grep -m1 -c 'OpenELEC\|RasPlex\|LibreELEC' /etc/issue`
OS_LIBREELEC=`grep -m1 -c LibreELEC /etc/issue`
OS_RASPLEX=`grep -m1 -c RasPlex /etc/issue`
OS_OSMC=`grep -m1 -c OSMC /etc/issue` OS_OSMC=`grep -m1 -c OSMC /etc/issue`
OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue` OS_RASPBIAN=`grep -m1 -c 'Raspbian\|RetroPie' /etc/issue`
@ -96,21 +98,25 @@ fi
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -ne 1 ]; then
SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l` SPIOK=`grep '^\dtparam=spi=on' /boot/config.txt | wc -l`
if [ $SPIOK -ne 1 ]; then if [ $SPIOK -ne 1 ]; then
echo '---> Raspberry Pi found, but SPI is not ready, we write "dtparam=spi=on" to /boot/config.txt' echo '---> Raspberry Pi found, but SPI is not set, we write "dtparam=spi=on" to /boot/config.txt'
sed -i '$a dtparam=spi=on' /boot/config.txt sed -i '$a dtparam=spi=on' /boot/config.txt
if [ $HCInstall -ne 1 ]; then
REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to /boot/config.txt" REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to /boot/config.txt"
fi fi
fi
fi fi
#Check, if dtparam=spi=on is in place (just for OPENELEC) #Check, if dtparam=spi=on is in place (just for OPENELEC/LibreELEC
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ]; then
SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l` SPIOK=`grep '^\dtparam=spi=on' /flash/config.txt | wc -l`
if [ $SPIOK -ne 1 ]; then if [ $SPIOK -ne 1 ]; then
mount -o remount,rw /flash mount -o remount,rw /flash
echo '---> Raspberry Pi with OpenELEC found, but SPI is not ready, we write "dtparam=spi=on" to /flash/config.txt' echo '---> RPi with OpenELEC/LibreELEC found, but SPI is not set, we write "dtparam=spi=on" to /flash/config.txt'
sed -i '$a dtparam=spi=on' /flash/config.txt sed -i '$a dtparam=spi=on' /flash/config.txt
mount -o remount,ro /flash mount -o remount,ro /flash
REBOOTMESSAGE="echo Please reboot your OpenELEC, we inserted dtparam=spi=on to /flash/config.txt" if [ $HCInstall -ne 1 ]; then
REBOOTMESSAGE="echo Please reboot your OpenELEC/LibreELEC, we inserted dtparam=spi=on to /flash/config.txt"
fi
fi fi
fi fi
@ -128,7 +134,19 @@ if [ $BETA -eq 1 ]; then
else HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release else HYPERION_ADDRESS=https://sourceforge.net/projects/hyperion-project/files/release
fi fi
# Select the appropriate release # Select the appropriate release
if [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then if [ $CPU_RPI -eq 1 ] && [ $OS_RASPLEX -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_rasplex.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_LIBREELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_le.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_LIBREELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi2_le.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_LIBREELEC -eq 1 ] && [ $RPI_3 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi3_le.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_1 -eq 1 ]; then
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi_oe.tar.gz
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then elif [ $CPU_RPI -eq 1 ] && [ $OS_OPENELEC -eq 1 ] && [ $RPI_2 -eq 1 ]; then
@ -167,9 +185,9 @@ fi
echo '---> Downloading the appropriate Hyperion release' echo '---> Downloading the appropriate Hyperion release'
if [ $OS_OPENELEC -eq 1 ]; then if [ $OS_OPENELEC -eq 1 ]; then
# OpenELEC has a readonly file system. Use alternative location # OpenELEC has a readonly file system. Use alternative location
echo '---> Downloading Hyperion OpenELEC release' echo '---> Downloading Hyperion OpenELEC/LibreELEC release'
curl -# -L --get $HYPERION_RELEASE | tar -C /storage -xz curl -# -L --get $HYPERION_RELEASE | tar -C /storage -xz
echo '---> Downloading Hyperion OpenELEC dependencies' echo '---> Downloading Hyperion OpenELEC/LibreELEC dependencies'
curl -# -L --get $OE_DEPENDECIES | tar -C /storage/hyperion/bin -xz curl -# -L --get $OE_DEPENDECIES | tar -C /storage/hyperion/bin -xz
#set the executen bit (failsave) #set the executen bit (failsave)
chmod +x -R /storage/hyperion/bin chmod +x -R /storage/hyperion/bin
@ -204,16 +222,18 @@ if [ $USE_INITCTL -eq 1 ]; then
initctl reload-configuration initctl reload-configuration
elif [ $OS_OPENELEC -eq 1 ]; then elif [ $OS_OPENELEC -eq 1 ]; then
#modify all old installs with a logfile output #modify all old installs with a logfile output
sed -i 's|/dev/null|/storage/logfiles/hyperion.log|g' /storage/.config/autostart.sh sed -i 's|/dev/null|/storage/logfiles/hyperion.log|g' /storage/.config/autostart.sh 2>/dev/null
# only add to start script if hyperion is not present yet # only add to start script if hyperion is not present yet
mkdir /storage/logfiles 2>/dev/null
touch /storage/.config/autostart.sh 2>/dev/null
if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then
echo '---> Adding Hyperion to OpenELEC autostart.sh' echo '---> Adding Hyperion to OpenELEC/LibreELEC autostart.sh'
echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh
chmod +x /storage/.config/autostart.sh chmod +x /storage/.config/autostart.sh
fi fi
# only add hyperion-x11 to startup, if not found and x32x64 detected # only add hyperion-x11 to startup, if not found and x32x64 detected
if [ $CPU_X32X64 -eq 1 ] && [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperion-x11 | wc -l` -eq 0 ]; then if [ $CPU_X32X64 -eq 1 ] && [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperion-x11 | wc -l` -eq 0 ]; then
echo '---> Adding Hyperion-x11 to OpenELEC autostart.sh' echo '---> Adding Hyperion-x11 to OpenELEC/LibreELEC autostart.sh'
echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 </dev/null >/storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh echo "DISPLAY=:0.0 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-x11 </dev/null >/storage/logfiles/hyperion.log 2>&1 &" >> /storage/.config/autostart.sh
fi fi
elif [ $USE_SYSTEMD -eq 1 ]; then elif [ $USE_SYSTEMD -eq 1 ]; then

View File

@ -42,8 +42,8 @@ esac
done done
echo "---> You entered \"$CONFIRM\". Remove Hyperion!" echo "---> You entered \"$CONFIRM\". Remove Hyperion!"
fi fi
# Find out if we are on OpenElec # Find out if we are on OpenElec or RasPlex
OS_OPENELEC=`grep -m1 -c OpenELEC /etc/issue` OS_OPENELEC=`grep -m1 -c 'OpenELEC\|RasPlex\|LibreELEC' /etc/issue`
# check which init script we should use # check which init script we should use
USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm` USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm`
@ -63,10 +63,10 @@ elif [ $USE_SERVICE -eq 1 ]; then
/usr/sbin/service hyperion stop 2>/dev/null /usr/sbin/service hyperion stop 2>/dev/null
elif [ $USE_SYSTEMD -eq 1 ]; then elif [ $USE_SYSTEMD -eq 1 ]; then
service hyperion stop 2>/dev/null service hyperion stop 2>/dev/null
while [ $SERVICEC -le 20 ]; do # while [ $SERVICEC -le 20 ]; do
service hyperion_fw$SERVICEC stop 2>/dev/null # service hyperion_fw$SERVICEC stop 2>/dev/null
((SERVICEC++)) # ((SERVICEC++))
done # done
fi fi
#reset count #reset count
@ -86,19 +86,19 @@ elif [ $USE_SYSTEMD -eq 1 ]; then
# Delete and disable Hyperion systemd script # Delete and disable Hyperion systemd script
echo '---> Delete and disable Hyperion systemd script' echo '---> Delete and disable Hyperion systemd script'
systemctl disable hyperion.service systemctl disable hyperion.service
while [ $SERVICEC -le 20 ]; do # while [ $SERVICEC -le 20 ]; do
systemctl -q disable hyperion_fw$SERVICEC.service 2>/dev/null # systemctl -q disable hyperion_fw$SERVICEC.service 2>/dev/null
((SERVICEC++)) # ((SERVICEC++))
done # done
rm -v /etc/systemd/system/hyperion* 2>/dev/null rm -v /etc/systemd/system/hyperion* 2>/dev/null
elif [ $USE_SERVICE -eq 1 ]; then elif [ $USE_SERVICE -eq 1 ]; then
# Delete and disable Hyperion init.d script # Delete and disable Hyperion init.d script
echo '---> Delete and disable Hyperion init.d script' echo '---> Delete and disable Hyperion init.d script'
update-rc.d -f hyperion remove update-rc.d -f hyperion remove
while [ $SERVICEC -le 20 ]; do # while [ $SERVICEC -le 20 ]; do
update-rc.d -f hyperion_fw$SERVICEC remove 2>/dev/null # update-rc.d -f hyperion_fw$SERVICEC remove 2>/dev/null
((SERVICEC++)) # ((SERVICEC++))
done # done
rm /etc/init.d/hyperion* 2>/dev/null rm /etc/init.d/hyperion* 2>/dev/null
fi fi