2013-10-17 09:43:10 +02:00
|
|
|
ON RASPBERRY
|
|
|
|
--------------
|
2014-12-20 20:51:17 +01:00
|
|
|
sudo apt-get install libQt4-dev libusb-1.0-0-dev python-dev rsync
|
2013-10-17 09:43:10 +02:00
|
|
|
|
|
|
|
ON HOST
|
|
|
|
---------
|
|
|
|
export RASPI=192.168.1.17
|
|
|
|
export RASCROSS_DIR="$HOME/raspberrypi"
|
|
|
|
export HYPERION_DIR="$HOME/hyperion"
|
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# install required packages
|
|
|
|
sudo apt-get install git rsync cmake build-essential libQt4-dev libusb-1.0-0-dev python-dev
|
2013-10-17 09:43:10 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# create the rootfs by copying it from an rpi running for example raspbmc
|
2013-10-17 09:43:10 +02:00
|
|
|
mkdir -p "$RASCROSS_DIR/rootfs"
|
2014-12-20 20:51:17 +01:00
|
|
|
rsync -rl --delete-after --safe-links pi@$RASPI:/{lib,usr} "$RASCROSS_DIR/rootfs"
|
2013-10-17 09:43:10 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# get the raspberry pi firmware and add it to the rootfs
|
2013-10-17 09:43:10 +02:00
|
|
|
git clone https://github.com/raspberrypi/firmware.git "$RASCROSS_DIR/firmware"
|
2014-12-20 20:51:17 +01:00
|
|
|
ln -s "$RASCROSS_DIR/firmware/hardfp/opt" "$RASCROSS_DIR/rootfs/opt"
|
2013-08-01 09:39:23 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# get the compile tools
|
|
|
|
git clone git://github.com/raspberrypi/tools.git "$RASCROSS_DIR/tools"
|
2013-10-17 09:43:10 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# get the Hyperion sources
|
|
|
|
git clone --recursive https://github.com/tvdzwan/hyperion.git "$HYPERION_DIR"
|
2013-10-17 09:43:10 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# do a native build (to build the protobuf compiler for the native platform)
|
|
|
|
mkdir "$HYPERION_DIR/build"
|
|
|
|
cmake -DENABLE_DISPMANX=OFF --build "$HYPERION_DIR/build" "$HYPERION_DIR"
|
2013-10-17 09:43:10 +02:00
|
|
|
|
2014-12-20 20:51:17 +01:00
|
|
|
# do the rpi build
|
|
|
|
# specify the protoc export file to import the protobuf compiler from the native build
|
|
|
|
mkdir "$HYPERION_DIR/build-rpi"
|
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE="$HYPERION_DIR/Toolchain-RaspberryPi.cmake" -DIMPORT_PROTOC=$HYPERION_DIR/build/protoc_export.cmake --build "$HYPERION_DIR/build-rpi" "$HYPERION_DIR"
|
2013-10-17 09:43:10 +02:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
These instructions are based on the guide given by:
|
|
|
|
http://airwiki.ws.dei.polimi.it/index.php/Cross-compiling_for_the_RaspberryPi
|