Skip to content

Commit

Permalink
🐳 update crossbuild image
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 11, 2022
1 parent 2186cac commit d02b214
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[target.armv7-unknown-linux-gnueabihf]
# The tag name from the `docker build -t crossbuild:local -f crossbuild.Dockerfile .` command
#image = "crossbuild:local"
# image = "crossbuild:local"
image = "ghcr.io/chriamue/ornithology-pi/crossbuild:latest"
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# OrnithologyPi

Capture birds in your garden, running on raspberry pi.

![Overview](https://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/chriamue/ornithology-pi/main/docs/overview.puml)
Expand Down Expand Up @@ -41,14 +42,16 @@ Press Escape to exit.

## Build Debian package

```
```sh
cargo install cargo-deb
cargo deb
```

### Build for Raspberry Pi

```
#### Crossbuild

```sh
cargo install cross
cargo install cargo-deb
docker build -t crossbuild:local -f crossbuild.Dockerfile .
Expand All @@ -60,20 +63,20 @@ cargo deb --no-build --target armv7-unknown-linux-gnueabihf

You need some rerequirements:

```
```sh
sudo apt install gstreamer1.0-plugins-good
```

Now download and install.

```
```sh
wget https://github.com/chriamue/ornithology-pi/releases/latest/download/ornithology-pi.deb
sudo apt install ./ornithology-pi.deb
```

#### Iptables

```
```sh
sudo iptables -t nat -A PREROUTING -s 10.42.0.0/24 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:8000
sudo iptables -t nat -A POSTROUTING -s 10.42.0.0/24 -j MASQUERADE
```
Expand Down
10 changes: 7 additions & 3 deletions crossbuild.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM rustembedded/cross:armv7-unknown-linux-gnueabihf-0.2.1
FROM rust:bullseye

RUN rustup target add armv7-unknown-linux-gnueabihf
WORKDIR /build

RUN apt-get update
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install --assume-yes libdbus-1-dev:armhf libgstreamer1.0-dev:armhf libgstreamer-plugins-base1.0-dev:armhf
apt-get install -y libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf libclang-dev
RUN apt-get install --assume-yes crossbuild-essential-armhf libdbus-1-dev:armhf libgstreamer1.0-dev:armhf libgstreamer-plugins-base1.0-dev:armhf

ENV PKG_CONFIG_LIBDIR_armv7_unknown_linux_gnueabihf=/usr/lib/arm-linux-gnueabihf/pkgconfig

0 comments on commit d02b214

Please sign in to comment.