forked from hyperion-project/hyperion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added build scripts for building different releases (in cross-compile) Added new releases for rpi/imx6/wetek/x32/x64
- Loading branch information
Showing
16 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperion-remote "$@" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/storage/hyperion/bin /storage/hyperion/bin/hyperiond "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|