2016-05-24 19:56:43 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-10-02 18:02:52 +02:00
|
|
|
echo "--- postinst called with args= " $1 $2
|
|
|
|
|
|
|
|
# If $1=configure and $2 is set, this is an upgrade
|
|
|
|
if [ "$1" = configure ] && [ "$2" != "" ]; then
|
|
|
|
IS_UPGRADE=true
|
|
|
|
else
|
|
|
|
IS_UPGRADE=false
|
|
|
|
fi
|
|
|
|
|
2016-05-24 19:56:43 +02:00
|
|
|
install_file()
|
|
|
|
{
|
|
|
|
src="$1"
|
|
|
|
dest="$2"
|
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
if [ ! -e "$dest" ]
|
2018-12-28 18:12:45 +01:00
|
|
|
then
|
2017-02-08 14:36:28 +01:00
|
|
|
cp "$src" "${dest}"
|
2016-06-02 19:54:37 +02:00
|
|
|
return 1
|
2017-02-08 14:36:28 +01:00
|
|
|
else
|
|
|
|
echo "--> Service file already exists, skip creation"
|
|
|
|
return 0
|
2016-05-24 19:56:43 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
echo "--- Hyperion ambient light postinstall ---"
|
2017-02-08 14:36:28 +01:00
|
|
|
|
|
|
|
#check system
|
2020-06-17 20:59:26 +02:00
|
|
|
CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710\|BCM2835\|BCM2836\|BCM2837\|BCM2711' /proc/cpuinfo`
|
2017-02-08 14:36:28 +01:00
|
|
|
CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l`
|
|
|
|
|
|
|
|
#Check for a bootloader as Berryboot
|
|
|
|
BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab)
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
#get current system ip
|
2019-01-07 23:33:27 +01:00
|
|
|
NET_IP=`hostname -I | cut -d " " -f1`
|
2016-06-02 19:54:37 +02:00
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
# search for users in system, returns first entry
|
2019-08-10 12:30:08 +02:00
|
|
|
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2016-06-02 19:54:37 +02:00
|
|
|
start_msg=""
|
|
|
|
restart_msg=""
|
|
|
|
|
2021-10-02 18:02:52 +02:00
|
|
|
# service registration if no gui is present (only on initial installation and not upgrade)
|
|
|
|
if [ "$IS_UPGRADE" = false ]; then
|
|
|
|
if [ -z "${DISPLAY}" ] && [ -z "${WAYLAND_DISPLAY}" ] && [ -z "${XDG_CURRENT_DESKTOP}" ]; then
|
|
|
|
STARTUP_MSG="echo ---> Hyperion has been installed as service, it will start on each system startup"
|
|
|
|
|
|
|
|
if grep -m1 systemd /proc/1/comm > /dev/null
|
|
|
|
then
|
|
|
|
# systemd
|
|
|
|
echo "---> init deamon: systemd"
|
|
|
|
install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperion@.service
|
|
|
|
systemctl enable hyperion"@${FOUND_USR}".service
|
|
|
|
start_msg="--> systemctl start hyperion for user ${FOUND_USR}"
|
|
|
|
systemctl start hyperion"@${FOUND_USR}"
|
|
|
|
elif [ -e /sbin/initctl ]
|
|
|
|
then
|
|
|
|
# upstart
|
|
|
|
echo "---> init deamon: upstart"
|
|
|
|
install_file /usr/share/hyperion/service/hyperion.initctl /etc/init/hyperion.conf && initctl reload-configuration
|
|
|
|
start_msg="--> initctl start hyperion"
|
|
|
|
initctl start hyperion
|
|
|
|
else
|
|
|
|
# sysV
|
|
|
|
echo "---> init deamon: sysV"
|
|
|
|
install_file /usr/share/hyperion/service/hyperion.init /etc/init.d/hyperion && chmod +x /etc/init.d/hyperion && update-rc.d hyperion defaults 98 02
|
|
|
|
start_msg="---> service hyperion start"
|
|
|
|
service hyperion start
|
2020-11-24 22:28:02 +01:00
|
|
|
fi
|
2021-10-02 18:02:52 +02:00
|
|
|
else
|
|
|
|
STARTUP_MSG="echo ---> You can start Hyperion from your menu now"
|
2019-01-07 23:33:27 +01:00
|
|
|
fi
|
2017-02-08 14:36:28 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#cleanup
|
|
|
|
rm -r /usr/share/hyperion/service
|
|
|
|
|
|
|
|
#link binarys and set exec bit
|
2021-10-02 18:02:52 +02:00
|
|
|
BINSP=/usr/share/hyperion
|
2017-02-08 14:36:28 +01:00
|
|
|
BINTP=/usr/bin
|
2021-10-02 18:02:52 +02:00
|
|
|
chmod +x -R $BINSP/bin
|
|
|
|
ln -fs $BINSP/bin/hyperiond $BINTP/hyperiond
|
|
|
|
ln -fs $BINSP/bin/hyperion-remote $BINTP/hyperion-remote
|
|
|
|
ln -fs $BINSP/bin/hyperion-v4l2 $BINTP/hyperion-v4l2
|
|
|
|
ln -fs $BINSP/bin/hyperion-framebuffer $BINTP/hyperion-framebuffer 2>/dev/null
|
|
|
|
ln -fs $BINSP/bin/hyperion-dispmanx $BINTP/hyperion-dispmanx 2>/dev/null
|
|
|
|
ln -fs $BINSP/bin/hyperion-x11 $BINTP/hyperion-x11 2>/dev/null
|
|
|
|
ln -fs $BINSP/bin/hyperion-xcb $BINTP/hyperion-xcb 2>/dev/null
|
|
|
|
ln -fs $BINSP/bin/hyperion-aml $BINTP/hyperion-aml 2>/dev/null
|
|
|
|
ln -fs $BINSP/bin/hyperion-qt $BINTP/hyperion-qt 2>/dev/null
|
|
|
|
|
|
|
|
#create symlink for updateHyperionUser.sh script
|
|
|
|
ln -fs $BINSP/scripts/updateHyperionUser.sh $BINTP/updateHyperionUser 2>/dev/null
|
|
|
|
|
|
|
|
# install desktop icons (only on initial installation and not upgrade)
|
|
|
|
if [ "$IS_UPGRADE" = false ]; then
|
|
|
|
if hash desktop-file-install 2>/dev/null; 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
|
2020-11-24 22:28:02 +01:00
|
|
|
fi
|
2019-01-19 18:35:40 +01:00
|
|
|
|
|
|
|
# cleanup desktop icons
|
|
|
|
rm -r /usr/share/hyperion/desktop 2>/dev/null
|
2017-02-08 14:36:28 +01:00
|
|
|
|
|
|
|
#Check, if dtparam=spi=on is in place
|
|
|
|
if [ $CPU_RPI -eq 1 ]; then
|
|
|
|
BOOT_DIR="/boot"
|
|
|
|
if [ $BOOT_BERRYBOOT -eq 1 ]; then
|
|
|
|
BOOT_DIR=$(sed -ne "s#/dev/mmcblk0p1 \([^ ]*\) vfat rw,.*#\1#p" /etc/mtab)
|
|
|
|
fi
|
|
|
|
if [ -z "$BOOT_DIR" -o ! -f "$BOOT_DIR/config.txt" ]; then
|
|
|
|
echo '---> Warning: RPi using BERRYBOOT found but can not locate where config.txt is to enable SPI. (BOOT_DIR='"$BOOT_DIR)"
|
|
|
|
SPIOK=1 # Not sure if OK, but don't ask to reboot
|
|
|
|
else
|
|
|
|
SPIOK=`grep '^\dtparam=spi=on' "$BOOT_DIR/config.txt" | wc -l`
|
|
|
|
if [ $SPIOK -ne 1 ]; then
|
|
|
|
echo '---> Raspberry Pi found, but SPI is not set, we write "dtparam=spi=on" to '"$BOOT_DIR/config.txt"
|
|
|
|
sed -i '$a dtparam=spi=on' "$BOOT_DIR/config.txt"
|
|
|
|
REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to $BOOT_DIR/config.txt"
|
|
|
|
fi
|
|
|
|
fi
|
2016-06-02 19:54:37 +02:00
|
|
|
fi
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
echo ${start_msg}
|
|
|
|
|
2016-06-02 19:54:37 +02:00
|
|
|
echo "-----------------------------------------------------------------------------"
|
2021-10-02 18:02:52 +02:00
|
|
|
if [ "$IS_UPGRADE" = true ]; then
|
|
|
|
echo "---> Hyperion has been upgraded!"
|
|
|
|
else
|
|
|
|
echo "---> Hyperion has been installed!"
|
|
|
|
fi
|
2019-01-07 23:33:27 +01:00
|
|
|
echo "---> "
|
|
|
|
$STARTUP_MSG
|
|
|
|
echo "---> For configuration, visit with your browser: ${NET_IP}:8090"
|
|
|
|
echo "---> or if already used by another service try: ${NET_IP}:8091"
|
2017-02-08 14:36:28 +01:00
|
|
|
$REBOOTMESSAGE
|
|
|
|
echo "-----------------------------------------------------------------------------"
|
|
|
|
echo "Webpage: www.hyperion-project.org"
|
2021-04-24 19:37:29 +02:00
|
|
|
echo "Forum: www.hyperion-project.org"
|
|
|
|
echo "Documenation: docs.hyperion-project.org"
|
2016-06-02 19:54:37 +02:00
|
|
|
echo "-----------------------------------------------------------------------------"
|
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
|
2016-06-02 19:54:37 +02:00
|
|
|
if [ -e /opt/hyperion/ ]
|
|
|
|
then
|
|
|
|
echo
|
|
|
|
echo "---------------------------------------------------------------------------------"
|
2018-12-28 18:12:45 +01:00
|
|
|
echo "- It seemd that you have an older version of hyperion installed in /opt/hyperion -"
|
|
|
|
echo "- please remove it to avoid problems -"
|
2016-06-02 19:54:37 +02:00
|
|
|
echo "---------------------------------------------------------------------------------"
|
2016-05-24 19:56:43 +02:00
|
|
|
fi
|
2019-01-07 23:33:27 +01:00
|
|
|
|
|
|
|
exit 0
|