forked from chirpstack/chirpstack-concentratord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-devel
137 lines (114 loc) · 6.13 KB
/
Dockerfile-devel
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
FROM rust:1.45-stretch
# required by bingen
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
clang-3.9 \
libclang-3.9-dev \
llvm-3.9-dev \
gcc-arm-linux-gnueabi \
g++-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf \
g++-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
git && \
apt-get clean
RUN rustup target add armv5te-unknown-linux-gnueabi
RUN rustup target add arm-unknown-linux-gnueabihf
RUN rustup target add aarch64-unknown-linux-gnu
RUN echo '[target.armv5te-unknown-linux-gnueabi]\n\
linker = "arm-linux-gnueabi-gcc"\n\
[target.arm-unknown-linux-gnueabihf]\n\
linker = "arm-linux-gnueabihf-gcc"\n\
[target.aarch64-unknown-linux-gnu]\n\
linker = "aarch64-linux-gnu-gcc"\n'\
>> /usr/local/cargo/config
RUN mkdir -p /tmp
RUN cd /tmp && git clone https://github.com/seife/opkg-utils.git && cd /tmp/opkg-utils && PREFIX=/usr make install
RUN mkdir -p /hal/native && \
cd /hal/native && \
git clone https://github.com/brocaar/lora_gateway.git -b v5.0.1r2 && \
git clone https://github.com/brocaar/sx1302_hal.git -b V2.1.0r1 && \
git clone https://github.com/Lora-net/gateway_2g4_hal.git -b V1.1.0
RUN cd /hal/native/lora_gateway && \
make && \
ln -s /hal/native/lora_gateway/libloragw/inc /usr/include/libloragw-sx1301 && \
ln -s /hal/native/lora_gateway/libloragw/libloragw.a /usr/lib/libloragw-sx1301.a
RUN cd /hal/native/sx1302_hal && \
make && \
ln -s /hal/native/sx1302_hal/libloragw/inc /usr/include/libloragw-sx1302 && \
ln -s /hal/native/sx1302_hal/libloragw/libloragw.a /usr/lib/libloragw-sx1302.a && \
cp /hal/native/sx1302_hal/libtools/inc/* /usr/include && \
cp /hal/native/sx1302_hal/libtools/*.a /usr/lib
RUN cd /hal/native/gateway_2g4_hal && \
make && \
ln -s /hal/native/gateway_2g4_hal/libloragw/inc /usr/include/libloragw-2g4 && \
ln -s /hal/native/gateway_2g4_hal/libloragw/libloragw.a /usr/lib/libloragw-2g4.a
RUN mkdir -p /hal/armv5 && \
cd /hal/armv5 && \
git clone https://github.com/brocaar/lora_gateway.git -b v5.0.1r2 && \
git clone https://github.com/brocaar/sx1302_hal.git -b V2.1.0r1 && \
git clone https://github.com/Lora-net/gateway_2g4_hal.git -b V1.1.0
RUN mkdir -p /hal/armv7hf && \
cd /hal/armv7hf && \
git clone https://github.com/brocaar/lora_gateway.git -b v5.0.1r2 && \
git clone https://github.com/brocaar/sx1302_hal.git -b V2.1.0r1 && \
git clone https://github.com/Lora-net/gateway_2g4_hal.git -b V1.1.0
RUN mkdir -p /hal/aarch64 && \
cd /hal/aarch64 && \
git clone https://github.com/brocaar/lora_gateway.git -b v5.0.1r2 && \
git clone https://github.com/brocaar/sx1302_hal.git -b V2.1.0r1 && \
git clone https://github.com/Lora-net/gateway_2g4_hal.git -b V1.1.0
# Needed for RAK shields, works with other shields too
# RUN sed -i 's/define SPI_SPEED.*/define SPI_SPEED 2000000/g' /hal/armv5/lora_gateway/libloragw/src/loragw_spi.native.c
# RUN sed -i 's/define SPI_SPEED.*/define SPI_SPEED 2000000/g' /hal/armv7hf/lora_gateway/libloragw/src/loragw_spi.native.c
RUN cd /hal/armv5/lora_gateway && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make && \
ln -s /hal/armv5/lora_gateway/libloragw/inc /usr/arm-linux-gnueabi/include/libloragw-sx1301 && \
ln -s /hal/armv5/lora_gateway/libloragw/libloragw.a /usr/arm-linux-gnueabi/lib/libloragw-sx1301.a
RUN cd /hal/armv5/sx1302_hal && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make && \
ln -s /hal/armv5/sx1302_hal/libloragw/inc /usr/arm-linux-gnueabi/include/libloragw-sx1302 && \
ln -s /hal/armv5/sx1302_hal/libloragw/libloragw.a /usr/arm-linux-gnueabi/lib/libloragw-sx1302.a && \
cp /hal/armv5/sx1302_hal/libtools/inc/* /usr/arm-linux-gnueabi/include && \
cp /hal/armv5/sx1302_hal/libtools/*.a /usr/arm-linux-gnueabi/lib
RUN cd /hal/armv5/gateway_2g4_hal && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make && \
ln -s /hal/armv5/gateway_2g4_hal/libloragw/inc /usr/arm-linux-gnueabi/include/libloragw-2g4 && \
ln -s /hal/armv5/gateway_2g4_hal/libloragw/libloragw.a /usr/arm-linux-gnueabi/lib/libloragw-2g4.a
RUN cd /hal/armv7hf/lora_gateway && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make && \
ln -s /hal/armv7hf/lora_gateway/libloragw/inc /usr/arm-linux-gnueabihf/include/libloragw-sx1301 && \
ln -s /hal/armv7hf/lora_gateway/libloragw/libloragw.a /usr/arm-linux-gnueabihf/lib/libloragw-sx1301.a
RUN cd /hal/armv7hf/sx1302_hal && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make && \
ln -s /hal/armv7hf/sx1302_hal/libloragw/inc /usr/arm-linux-gnueabihf/include/libloragw-sx1302 && \
ln -s /hal/armv7hf/sx1302_hal/libloragw/libloragw.a /usr/arm-linux-gnueabihf/lib/libloragw-sx1302.a && \
cp /hal/armv7hf/sx1302_hal/libtools/inc/* /usr/arm-linux-gnueabihf/include && \
cp /hal/armv7hf/sx1302_hal/libtools/*.a /usr/arm-linux-gnueabihf/lib
RUN cd /hal/armv7hf/gateway_2g4_hal && \
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make && \
ln -s /hal/armv7hf/gateway_2g4_hal/libloragw/inc /usr/arm-linux-gnueabihf/include/libloragw-2g4 && \
ln -s /hal/armv7hf/gateway_2g4_hal/libloragw/libloragw.a /usr/arm-linux-gnueabihf/lib/libloragw-2g4.a
RUN cd /hal/aarch64/lora_gateway && \
ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- make && \
ln -s /hal/aarch64/lora_gateway/libloragw/inc /usr/aarch64-linux-gnu/include/libloragw-sx1301 && \
ln -s /hal/aarch64/lora_gateway/libloragw/libloragw.a /usr/aarch64-linux-gnu/lib/libloragw-sx1301.a
RUN cd /hal/aarch64/sx1302_hal && \
ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- make && \
ln -s /hal/aarch64/sx1302_hal/libloragw/inc /usr/aarch64-linux-gnu/include/libloragw-sx1302 && \
ln -s /hal/aarch64/sx1302_hal/libloragw/libloragw.a /usr/aarch64-linux-gnu/lib/libloragw-sx1302.a && \
cp /hal/aarch64/sx1302_hal/libtools/inc/* /usr/aarch64-linux-gnu/include && \
cp /hal/aarch64/sx1302_hal/libtools/*.a /usr/aarch64-linux-gnu/lib
RUN cd /hal/aarch64/gateway_2g4_hal && \
ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- make && \
ln -s /hal/aarch64/gateway_2g4_hal/libloragw/inc /usr/aarch64-linux-gnu/include/libloragw-2g4 && \
ln -s /hal/aarch64/gateway_2g4_hal/libloragw/libloragw.a /usr/aarch64-linux-gnu/lib/libloragw-2g4.a
ENV LLVM_CONFIG_PATH=llvm-config-3.9
ENV PROJECT_PATH=/chirpstack-concentratord
RUN mkdir -p $PROJECT_PATH
WORKDIR $PROJECT_PATH
COPY . /chirpstack-concentratord
RUN cargo fetch