mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Codespace updated
Debian pre/post scripts modified for HyperBian
This commit is contained in:
		| @@ -16,5 +16,5 @@ | ||||
| 		}, | ||||
| 	}, | ||||
| 	"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 | ||||
| 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` | ||||
| OS_HYPERBIAN=`grep ID /etc/os-release | grep -m1 -c HyperBian` | ||||
|  | ||||
| #Check for a bootloader as Berryboot | ||||
| 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 | ||||
| 	echo "---> init deamon: systemd" | ||||
| 	# systemd | ||||
| 	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}" | ||||
| 	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 | ||||
| 		# 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 | ||||
|  | ||||
| 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-qt $BINTP/hyperion-qt 2>/dev/null | ||||
|  | ||||
| # install desktop icons | ||||
| echo "---> Install Hyperion desktop icons" | ||||
| mkdir /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 | ||||
| # install desktop icons / not on HyperBian | ||||
| if [ $OS_HYPERBIAN -ne 1 ]; then | ||||
| 	echo "---> Install Hyperion desktop icons" | ||||
| 	mkdir /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 | ||||
| fi | ||||
|  | ||||
| # cleanup desktop icons | ||||
| rm -r /usr/share/hyperion/desktop 2>/dev/null | ||||
|   | ||||
| @@ -12,7 +12,7 @@ then | ||||
| 	then | ||||
| 		echo "--> stop init deamon: systemd" | ||||
| 		# systemd | ||||
| 		systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null | ||||
| 		systemctl stop hyperion hyperiond"@${FOUND_USR}" 2> /dev/null | ||||
|  | ||||
| 	elif [ -e /sbin/initctl ] | ||||
| 	then | ||||
|   | ||||
| @@ -13,10 +13,10 @@ if grep -m1 systemd /proc/1/comm > /dev/null | ||||
| then | ||||
| 	echo "---> stop init deamon: systemd" | ||||
| 	# systemd | ||||
| 	$HYPERION_RUNNING && systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null | ||||
| 	# disable user specific symlink | ||||
| 	$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" 2> /dev/null | ||||
| 	# disable user specific symlink / not on HyperBian | ||||
| 	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 | ||||
|  | ||||
| elif [ -e /sbin/initctl ] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user