Codespace updated

Debian pre/post scripts modified for HyperBian
This commit is contained in:
Paulchen Panther 2020-11-24 21:28:02 +00:00 committed by GitHub
parent 0cbb276631
commit a42aae44d1
5 changed files with 26 additions and 32 deletions

View File

@ -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"
} }

View File

@ -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

View File

@ -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,6 +48,12 @@ if grep -m1 systemd /proc/1/comm > /dev/null
then then
echo "---> init deamon: systemd" echo "---> init deamon: systemd"
# systemd # systemd
if [ $OS_HYPERBIAN -eq 1 ]; then
# start service only
echo "--> Service file already exists, skip creation"
start_msg="--> systemctl start hyperion"
systemctl start hyperion
else
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperiond@.service 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?! # 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 if [ $ENABLE_SERVICE -eq 1 ]; then
@ -54,6 +61,7 @@ then
start_msg="--> systemctl start hyperiond for user ${FOUND_USR}" start_msg="--> systemctl start hyperiond for user ${FOUND_USR}"
systemctl start hyperiond"@${FOUND_USR}" systemctl start hyperiond"@${FOUND_USR}"
fi fi
fi
elif [ -e /sbin/initctl ] elif [ -e /sbin/initctl ]
then then
@ -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
if [ $OS_HYPERBIAN -ne 1 ]; then
echo "---> Install Hyperion desktop icons" echo "---> Install Hyperion desktop icons"
mkdir /usr/share/pixmaps/hyperion 2>/dev/null mkdir /usr/share/pixmaps/hyperion 2>/dev/null
cp /usr/share/hyperion/desktop/*.png /usr/share/pixmaps/hyperion 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 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

View File

@ -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

View File

@ -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 ]