-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.cross-pi
33 lines (31 loc) · 1.13 KB
/
Dockerfile.cross-pi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM cross-stretch
# NOTE: These versions must be the same on the target host
ENV RPI_SHA=f73fca0
ENV WIRINGPI_SHA=6d9ce35
# MMAL/VCOS (https://github.com/raspberrypi/userland)
RUN RPI_DIR=/raspberrypi && \
RPI_BUILD_DIR=$RPI_DIR/build/arm-linux/release && \
git clone --single-branch --branch master https://github.com/raspberrypi/userland.git $RPI_DIR && \
cd $RPI_DIR && \
git checkout $RPI_SHA && \
mkdir -p $RPI_BUILD_DIR && \
cd $RPI_BUILD_DIR && \
cmake -DCMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake \
-DCMAKE_BUILD_TYPE=Release \
../../.. && \
make -j `nproc` && \
make install DESTDIR=$CROSS_INSTALL_PREFIX/ && \
cd / && \
rm -rf $RPI_DIR && \
# WiringPi
# https://github.com/WiringPi/WiringPi
WPI_DIR=/wpi && \
WPI_WIRING_PI_DIR=$WPI_DIR/wiringPi && \
git clone --single-branch --branch master https://github.com/WiringPi/WiringPi.git $WPI_DIR && \
cd $WPI_DIR && \
git checkout $WIRINGPI_SHA && \
cd $WPI_WIRING_PI_DIR && \
CC=$C_COMPILER_ARM_LINUX make -j `nproc` && \
make install DESTDIR=$CROSS_INSTALL_PREFIX PREFIX="" && \
cd / && \
rm -rf $WPI_DIR