-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Gomes
authored and
David Gomes
committed
Jun 12, 2023
1 parent
14eaccd
commit 471ec52
Showing
6 changed files
with
146 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,2 @@ | ||
[target.armv7-unknown-linux-gnueabihf] | ||
dockerfile = "docker/cross-compile/armv7.Dockerfile" | ||
|
||
[target.armv7-unknown-linux-gnueabihf.env] | ||
passthrough = ["PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig"] |
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 |
---|---|---|
@@ -1,23 +1,24 @@ | ||
FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:latest AS base | ||
|
||
WORKDIR /home/src | ||
RUN apt-get update && apt-get upgrade && apt-get install multistrap --assume-yes | ||
|
||
RUN dpkg --add-architecture armhf | ||
COPY docker/cross-compile/multistrap.conf / | ||
RUN multistrap -a armhf -f multistrap.conf /sysroot-armhf | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y pkg-config:armhf libssl-dev:armhf libudev-dev:armhf libsystemd-dev:armhf libusb-1.0-0-dev:armhf | ||
ENV SYS_ROOT=/sysroot-armhf | ||
|
||
RUN curl https://sh.rustup.rs -sSf | \ | ||
sh -s -- -t armv7-unknown-linux-gnueabihf stable -y | ||
COPY docker/cross-compile/relink.sh / | ||
RUN cd /sysroot-armhf && chmod +x /relink.sh && /relink.sh | ||
|
||
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-L /usr/lib/arm-linux-gnueabihf -C link-args=-Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf $CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS" | ||
ENV PKG_CONFIG_DIR="" | ||
ENV PKG_CONFIG_PATH="" | ||
ENV PKG_CONFIG_LIBDIR="${SYS_ROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig" | ||
ENV PKG_CONFIG_INCLUDE_DIR="${SYS_ROOT}/usr/include/arm-linux-gnueabihf" | ||
ENV PKG_CONFIG_SYSROOT_DIR=${SYS_ROOT} | ||
ENV PKG_CONFIG_ALLOW_CROSS=1 | ||
|
||
RUN which pkg-config; echo | ||
RUN echo $PATH | ||
ENV PATH="/usr/bin:${PATH}" | ||
RUN pkg-config --libs --cflags libudev | ||
#RUN apt-get update && apt-get install -y --no-install-recommends apt-utils | ||
#RUN dpkg --add-architecture armhf | ||
#RUN apt-get update && apt-get -y install libudev-dev:armhf | ||
|
||
RUN exit 1 | ||
|
||
RUN . "$HOME/.cargo/env" | ||
ENV RUSTFLAGS="-C link-arg=--sysroot=/sysroot-armhf -L /sysroot-armhf/usr/lib/arm-linux-gnueabihf -C link-args=-Wl,-rpath-link,/sysroot-armhf/usr/lib/arm-linux-gnueabihf -lpthread" |
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,13 @@ | ||
[General] | ||
arch=armhf | ||
directory=/sysroot-armhf/ | ||
noauth=true | ||
unpack=true | ||
cleanup=true | ||
bootstrap=Raspbian | ||
aptsources=Raspbian | ||
|
||
[Raspbian] | ||
packages=pkg-config libudev-dev libsystemd-dev libusb-1.0-0-dev build-essential | ||
source=http://raspbian.raspberrypi.org/raspbian/ | ||
suite=buster |
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,9 @@ | ||
# Find all absolute symlinks recursively in the current directory | ||
# (find command) and process them line by line (`while read`) | ||
find . -lname '/*' | while read -r link; do | ||
# Get the (broken) path from the symlink. | ||
abs_target=$(readlink "$link") | ||
# Prepend that with the current working directory and overwrite | ||
# the old link with the prepended version. | ||
ln -fs "$(pwd)$abs_target" "$link" | ||
done |