mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Codespace updated
Debian pre/post scripts modified for HyperBian
This commit is contained in:
parent
0cbb276631
commit
a42aae44d1
@ -16,5 +16,5 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
"forwardPorts": [8090, 8092],
|
"forwardPorts": [8090, 8092],
|
||||||
"postCreateCommand": "git submodule update --recursive --init && sudo apt-get install -y git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev"
|
"postCreateCommand": "git submodule update --recursive --init && sudo apt-get update && sudo apt-get install -y git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libcec-dev libxcb-image0-dev libxcb-util0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libssl-dev zlib1g-dev"
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Hyperion ambient light systemd service for OpenELEC/LibreELEC/RasPlex
|
|
||||||
After=graphical.target
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
WorkingDirectory=/storage/hyperion/bin/
|
|
||||||
Environment=LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
|
|
||||||
ExecStart=./hyperiond /storage/.config/hyperion/hyperion.config.json
|
|
||||||
TimeoutStopSec=5
|
|
||||||
KillMode=mixed
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=2
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
@ -21,6 +21,7 @@ echo "---Hyperion ambient light postinstall ---"
|
|||||||
#check system
|
#check system
|
||||||
CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710\|BCM2835\|BCM2836\|BCM2837\|BCM2711' /proc/cpuinfo`
|
CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710\|BCM2835\|BCM2836\|BCM2837\|BCM2711' /proc/cpuinfo`
|
||||||
CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l`
|
CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l`
|
||||||
|
OS_HYPERBIAN=`grep ID /etc/os-release | grep -m1 -c HyperBian`
|
||||||
|
|
||||||
#Check for a bootloader as Berryboot
|
#Check for a bootloader as Berryboot
|
||||||
BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab)
|
BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab)
|
||||||
@ -47,12 +48,19 @@ if grep -m1 systemd /proc/1/comm > /dev/null
|
|||||||
then
|
then
|
||||||
echo "---> init deamon: systemd"
|
echo "---> init deamon: systemd"
|
||||||
# systemd
|
# systemd
|
||||||
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperiond@.service
|
if [ $OS_HYPERBIAN -eq 1 ]; then
|
||||||
# service registration just on Raspberry Pi, probably need to ask the user how we should use the service. TODO service start in user login scope eg for x11?!
|
# start service only
|
||||||
if [ $ENABLE_SERVICE -eq 1 ]; then
|
echo "--> Service file already exists, skip creation"
|
||||||
systemctl enable hyperiond"@${FOUND_USR}".service
|
start_msg="--> systemctl start hyperion"
|
||||||
start_msg="--> systemctl start hyperiond for user ${FOUND_USR}"
|
systemctl start hyperion
|
||||||
systemctl start hyperiond"@${FOUND_USR}"
|
else
|
||||||
|
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperiond@.service
|
||||||
|
# service registration just on Raspberry Pi, probably need to ask the user how we should use the service. TODO service start in user login scope eg for x11?!
|
||||||
|
if [ $ENABLE_SERVICE -eq 1 ]; then
|
||||||
|
systemctl enable hyperiond"@${FOUND_USR}".service
|
||||||
|
start_msg="--> systemctl start hyperiond for user ${FOUND_USR}"
|
||||||
|
systemctl start hyperiond"@${FOUND_USR}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ -e /sbin/initctl ]
|
elif [ -e /sbin/initctl ]
|
||||||
@ -92,11 +100,13 @@ ln -fs $BINSP/hyperion-xcb $BINTP/hyperion-xcb 2>/dev/null
|
|||||||
ln -fs $BINSP/hyperion-aml $BINTP/hyperion-aml 2>/dev/null
|
ln -fs $BINSP/hyperion-aml $BINTP/hyperion-aml 2>/dev/null
|
||||||
ln -fs $BINSP/hyperion-qt $BINTP/hyperion-qt 2>/dev/null
|
ln -fs $BINSP/hyperion-qt $BINTP/hyperion-qt 2>/dev/null
|
||||||
|
|
||||||
# install desktop icons
|
# install desktop icons / not on HyperBian
|
||||||
echo "---> Install Hyperion desktop icons"
|
if [ $OS_HYPERBIAN -ne 1 ]; then
|
||||||
mkdir /usr/share/pixmaps/hyperion 2>/dev/null
|
echo "---> Install Hyperion desktop icons"
|
||||||
cp /usr/share/hyperion/desktop/*.png /usr/share/pixmaps/hyperion 2>/dev/null
|
mkdir /usr/share/pixmaps/hyperion 2>/dev/null
|
||||||
desktop-file-install /usr/share/hyperion/desktop/hyperiond.desktop 2>/dev/null
|
cp /usr/share/hyperion/desktop/*.png /usr/share/pixmaps/hyperion 2>/dev/null
|
||||||
|
desktop-file-install /usr/share/hyperion/desktop/hyperiond.desktop 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# cleanup desktop icons
|
# cleanup desktop icons
|
||||||
rm -r /usr/share/hyperion/desktop 2>/dev/null
|
rm -r /usr/share/hyperion/desktop 2>/dev/null
|
||||||
|
@ -12,7 +12,7 @@ then
|
|||||||
then
|
then
|
||||||
echo "--> stop init deamon: systemd"
|
echo "--> stop init deamon: systemd"
|
||||||
# systemd
|
# systemd
|
||||||
systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null
|
systemctl stop hyperion hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||||
|
|
||||||
elif [ -e /sbin/initctl ]
|
elif [ -e /sbin/initctl ]
|
||||||
then
|
then
|
||||||
|
@ -13,10 +13,10 @@ if grep -m1 systemd /proc/1/comm > /dev/null
|
|||||||
then
|
then
|
||||||
echo "---> stop init deamon: systemd"
|
echo "---> stop init deamon: systemd"
|
||||||
# systemd
|
# systemd
|
||||||
$HYPERION_RUNNING && systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null
|
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||||
# disable user specific symlink
|
# disable user specific symlink / not on HyperBian
|
||||||
echo "---> Disable service and remove entry"
|
echo "---> Disable service and remove entry"
|
||||||
systemctl -q disable hyperiond"@${FOUND_USR}"
|
systemctl -q disable hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||||
rm -v /etc/systemd/system/hyperiond@.service 2>/dev/null
|
rm -v /etc/systemd/system/hyperiond@.service 2>/dev/null
|
||||||
|
|
||||||
elif [ -e /sbin/initctl ]
|
elif [ -e /sbin/initctl ]
|
||||||
|
Loading…
Reference in New Issue
Block a user