mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update install/update script
Added build scripts for building different releases (in cross-compile) Added new releases for rpi/imx6/wetek/x32/x64 Former-commit-id: 2025f1e3e8663d733b60a18944c6097da4ee371b
This commit is contained in:
parent
ad876b0d8c
commit
f7bce46f34
@ -55,6 +55,9 @@ cmake -DENABLE_DISPMANX=OFF --build "$NATIVE_BUILD_DIR" "$HYPERION_DIR"
|
||||
mkdir -p "$TARGET_BUILD_DIR"
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" -DIMPORT_PROTOC=$NATIVE_BUILD_DIR/protoc_export.cmake --build "$TARGET_BUILD_DIR" "$HYPERION_DIR"
|
||||
|
||||
# For hummingboard (imx6) the following package is required
|
||||
sudo apt-get install lib32z1
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
These instructions are based on the guide given by:
|
||||
http://airwiki.ws.dei.polimi.it/index.php/Cross-compiling_for_the_RaspberryPi
|
||||
|
22
Toolchain-imx6.cmake
Normal file
22
Toolchain-imx6.cmake
Normal file
@ -0,0 +1,22 @@
|
||||
SET(CUBIXCROSS_DIR $ENV{HOME}/hummingboard)
|
||||
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
# specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${CUBIXCROSS_DIR}/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=softfp")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=vfpv3 -mfloat-abi=softfp")
|
||||
|
||||
# where is the target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH ${CUBIXCROSS_DIR}/rootfs)
|
||||
|
||||
# search for programs in the build host directories
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
|
||||
# for libraries and headers in the target directories
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
include_directories(${CMAKE_FIND_ROOT_PATH}/usr/include)
|
12
Toolchain-x32.cmake
Normal file
12
Toolchain-x32.cmake
Normal file
@ -0,0 +1,12 @@
|
||||
# toolchain file for building a 32bit version on a 64bit host
|
||||
|
||||
# use it like this:
|
||||
# cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-x32.cmake <sourcedir>
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "i686")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||
|
43
bin/create_all_releases.sh
Normal file
43
bin/create_all_releases.sh
Normal file
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Create the x64 build
|
||||
mkdir build-x64
|
||||
cd build-x64
|
||||
cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON ..
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
# Create the x32 build
|
||||
mkdir build-x32
|
||||
cd build-x32
|
||||
cmake -DIMPORT_PROTOC=../build-x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_X11=ON ..
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
# Create the RPI build
|
||||
mkdir build-rpi
|
||||
cd build-rpi
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x64/protoc_export.cmake ..
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
# Create the WETEK build
|
||||
mkdir build-wetek
|
||||
cd build-wetek
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-rpi.cmake" -DIMPORT_PROTOC=../build-x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON -DENABLE_AMLOGIC=ON ..
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
# Create the IMX6 build
|
||||
mkdir build-imx6
|
||||
cd build-imx6
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE="../Toolchain-imx6.cmake" -DIMPORT_PROTOC=../build-x64/protoc_export.cmake -DENABLE_DISPMANX=OFF -DENABLE_FB=ON ..
|
||||
make -j 4
|
||||
cd ..
|
||||
|
||||
bin/create_release.sh . x64
|
||||
bin/create_release.sh . x32
|
||||
bin/create_release.sh . rpi
|
||||
bin/create_release.sh . wetek
|
||||
bin/create_release.sh . imx6
|
||||
|
27
bin/create_oe_depedencies.sh
Normal file
27
bin/create_oe_depedencies.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
RPI_ROOTFS=/home/tvdzwan/hummingboard/rootfs
|
||||
IMX6_ROOTFS=/home/tvdzwan/hummingboard/rootfs
|
||||
outfile=hyperion.deps.openelec-imx6.tar.gz
|
||||
|
||||
tar --create --verbose --gzip --absolute-names --show-transformed-names --dereference \
|
||||
--file "$outfile" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libaudio.so.2" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libffi.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libICE.so.6" \
|
||||
"$IMX6_ROOTFS/lib/arm-linux-gnueabihf/libpcre.so.3" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libpng12.so.0" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libQtCore.so.4" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libQtGui.so.4" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libQtNetwork.so.4" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libSM.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libX11.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXau.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libxcb.so.1" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXdmcp.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXext.so.6" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXrender.so.1" \
|
||||
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXt.so.6" \
|
||||
"./hyperiond.sh" \
|
||||
"./hyperion-remote.sh"
|
||||
|
35
bin/create_release.sh
Normal file
35
bin/create_release.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$#" -ne 2 ] || ! [ -d "$1" ]; then
|
||||
echo "Usage: $0 <REPO-DIR> <BUILD-ID>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
repodir="$1"
|
||||
buildid="$2"
|
||||
builddir=$repodir/build-$buildid
|
||||
echo build directory = $builddir
|
||||
echo repository root dirrectory = $repodir
|
||||
if ! [ -d "$builddir" ]; then
|
||||
echo "Could not find build director"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outfile="$repodir/deploy/hyperion_$buildid.tar.gz"
|
||||
echo create $outfile
|
||||
|
||||
tar --create --verbose --gzip --absolute-names --show-transformed-names --ignore-failed-read\
|
||||
--file "$outfile" \
|
||||
--transform "s:$builddir/bin/:hyperion/bin/:" \
|
||||
--transform "s:$repodir/effects/:hyperion/effects/:" \
|
||||
--transform "s:$repodir/config/:hyperion/config/:" \
|
||||
--transform "s:$repodir/bin/hyperion.init.sh:hyperion/init.d/hyperion.init.sh:" \
|
||||
--transform "s://:/:g" \
|
||||
"$builddir/bin/hyperiond" \
|
||||
"$builddir/bin/hyperion-remote" \
|
||||
"$builddir/bin/hyperion-v4l2" \
|
||||
"$builddir/bin/dispmanx2png" \
|
||||
"$repodir/effects/"* \
|
||||
"$repodir/bin/hyperion.init.sh" \
|
||||
"$repodir/config/hyperion.config.json"
|
||||
|
2
deploy/hyperion-remote.sh
Normal file
2
deploy/hyperion-remote.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-remote "$@"
|
1
deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id
Normal file
1
deploy/hyperion.deps.openelec-imx6.tar.gz.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
198ac3d44bac13ba993069454397ad8c201d37b9
|
@ -1 +1 @@
|
||||
8708dec3801868f8710e06bd9186fc520f7e639f
|
||||
9a4c5499f7191aad3e23e0e3be806861a3ec1c02
|
1
deploy/hyperion_rpi.tar.gz.REMOVED.git-id
Normal file
1
deploy/hyperion_rpi.tar.gz.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
3a346e54f8958f87ae7f4e8804f6afdec33aa9fc
|
1
deploy/hyperion_wetek.tar.gz.REMOVED.git-id
Normal file
1
deploy/hyperion_wetek.tar.gz.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
05227980ea998eeeecda03cefe090b5f55ff8ee0
|
1
deploy/hyperion_x32.tar.gz.REMOVED.git-id
Normal file
1
deploy/hyperion_x32.tar.gz.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
f3e3f4a3a8e52e4bfaf9a0337cb364da841e150b
|
1
deploy/hyperion_x64.tar.gz.REMOVED.git-id
Normal file
1
deploy/hyperion_x64.tar.gz.REMOVED.git-id
Normal file
@ -0,0 +1 @@
|
||||
9342bb64479ea4d5554f301b905a0a830e330635
|
2
deploy/hyperiond.sh
Normal file
2
deploy/hyperiond.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperiond "$@"
|
114
deploy/update_hyperion.sh
Normal file
114
deploy/update_hyperion.sh
Normal file
@ -0,0 +1,114 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script for downloading and installing the latest Hyperion release
|
||||
|
||||
# Make sure /sbin is on the path (for service to find sub scripts)
|
||||
PATH="/sbin:$PATH"
|
||||
|
||||
# Find out if we are on OpenElec
|
||||
OS_OPENELEC=`cat /etc/issue | grep -m 1 OpenELEC | wc -l`
|
||||
|
||||
# Find out if its an imx6 device
|
||||
CPU_RPI=`cat /proc/cpuinfo | grep RPI | wc -l`
|
||||
CPU_IMX6=`cat /proc/cpuinfo | grep i.MX6 | wc -l`
|
||||
CPU_WETEK=`cat /proc/cpyinfo | grep wetek | wc -l`
|
||||
CPU_X64=`uname -m | grep x86_64 | wc -l`
|
||||
CPU_X32=`uname -m | grep x86_32 | wc -l`
|
||||
# Check that we have a known configuration
|
||||
if [ $CPU_RPI -ne 1 ] & [ $CPU_IMX6 -ne 1 ] & [ $CPU_WETEK -ne 1 ] & [ $CPU_X64 -ne 1 ] & [ $CPU_X32 -ne 1 ]; then
|
||||
echo 'CPU information does not match any known releases'
|
||||
exit
|
||||
fi
|
||||
|
||||
# check which init script we should use
|
||||
USE_INITCTL=`which /sbin/initctl | wc -l`
|
||||
USE_SERVICE=`which /usr/sbin/service | wc -l`
|
||||
|
||||
# Make sure that the boblight daemon is no longer running
|
||||
BOBLIGHT_PROCNR=$(pidof boblightd | wc -l)
|
||||
if [ $BOBLIGHT_PROCNR -eq 1 ]; then
|
||||
echo 'Found running instance of boblight. Please stop boblight via XBMC menu before installing hyperion'
|
||||
exit
|
||||
fi
|
||||
|
||||
# Stop hyperion daemon if it is running
|
||||
# Start the hyperion daemon
|
||||
if [ $USE_INITCTL -eq 1 ]; then
|
||||
/sbin/initctl stop hyperion
|
||||
elif [ $USE_SERVICE -eq 1 ]; then
|
||||
/usr/sbin/service hyperion stop
|
||||
fi
|
||||
|
||||
# Select the appropriate release
|
||||
HYPERION_ADDRESS=https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy
|
||||
if [ $CPU_RPI -eq 1 ]; then
|
||||
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_rpi.tar.gz
|
||||
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
|
||||
elif [ $CPU_IMX6 -eq 1 ]; then
|
||||
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_imx6.tar.gz
|
||||
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-imx6.tar.gz
|
||||
elif [ $CPU_WETEK -eq 1 ]; then
|
||||
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_wetek.tar.gz
|
||||
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-rpi.tar.gz
|
||||
elif [ $CPU_X64 -eq 1 ]; then
|
||||
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x64.tar.gz
|
||||
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x64.tar.gz
|
||||
elif [ $CPU_X32 -eq 1 ]; then
|
||||
HYPERION_RELEASE=$HYPERION_ADDRESS/hyperion_x32.tar.gz
|
||||
OE_DEPENDECIES=$HYPERION_ADDRESS/hyperion.deps.openelec-x32.tar.gz
|
||||
else
|
||||
echo "Target platform unknown"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Get and extract the Hyperion binaries and effects
|
||||
echo 'Downloading hyperion'
|
||||
if [ $OS_OPENELEC -eq 1 ]; then
|
||||
# OpenELEC has a readonly file system. Use alternative location
|
||||
curl -L --get $HYPERION_RELEASE | tar -C /storage -xz
|
||||
curl -L --get $OE_DEPENDECIES | tar -C /storage/hyperion/bin -xz
|
||||
|
||||
# modify the default config to have a correct effect path
|
||||
sed -i 's:/opt:/storage:g' /storage/hyperion/config/hyperion.config.json
|
||||
|
||||
# /storage/.config is available as samba share. A symbolic link would not be working
|
||||
false | cp -i /storage/hyperion/config/hyperion.config.json /storage/.config/hyperion.config.json 2>/dev/null
|
||||
else
|
||||
wget $HYPERION_RELEASE -O - | tar -C /opt -xz
|
||||
|
||||
# create links to the binaries
|
||||
ln -fs /opt/hyperion/bin/hyperiond /usr/bin/hyperiond
|
||||
ln -fs /opt/hyperion/bin/hyperion-remote /usr/bin/hyperion-remote
|
||||
ln -fs /opt/hyperion/bin/hyperion-v4l2 /usr/bin/hyperion-v4l2
|
||||
|
||||
# Copy a link to the hyperion configuration file to /etc
|
||||
ln -s /opt/hyperion/config/hyperion.config.json /etc/hyperion.config.json
|
||||
fi
|
||||
|
||||
# Copy the service control configuration to /etc/int
|
||||
if [ $USE_INITCTL -eq 1 ]; then
|
||||
echo 'Installing initctl script'
|
||||
wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.conf -P /etc/init/
|
||||
initctl reload-configuration
|
||||
elif [ $USE_SERVICE -eq 1 ]; then
|
||||
echo 'Installing startup script in init.d'
|
||||
# place startup script in init.d and add it to upstart
|
||||
ln -fs /opt/hyperion/init.d/hyperion.init.sh /etc/init.d/hyperion
|
||||
chmod +x /etc/init.d/hyperion
|
||||
update-rc.d hyperion defaults 98 02
|
||||
elif [ $IS_OPENELEC -eq 1 ]; then
|
||||
# only add to start script if hyperion is not present yet
|
||||
if [ `cat /storage/.config/autostart.sh 2>/dev/null | grep hyperiond | wc -l` -eq 0 ]; then
|
||||
echo 'Adding Hyperion to autostart script'
|
||||
echo "/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /dev/null 2>&1 &" >> /storage/.config/autostart.sh
|
||||
chmod +x /storage/.config/autostart.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start the hyperion daemon
|
||||
if [ $USE_INITCTL -eq 1 ]; then
|
||||
/sbin/initctl start hyperion
|
||||
elif [ $USE_SERVICE -eq 1 ]; then
|
||||
/usr/sbin/service hyperion start
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user