build: document Pi firmware build/flash + gplan.so cross-build via Stretch Docker
- .pi/BUILD.md: end-to-end macOS dev workflow, deploy paths, dphys-swapfile vs fstab, troubleshooting. - .pi/Dockerfile.gplan + build-gplan.sh: rebuild gplan.so from source on Raspbian Stretch (Bullseye is too new for the toolchain). - Makefile: ensure trailing newline between concatenated pug templates so Pug doesn't glue file boundaries together.
This commit is contained in:
48
.pi/Dockerfile.gplan
Normal file
48
.pi/Dockerfile.gplan
Normal file
@@ -0,0 +1,48 @@
|
||||
# Raspbian Stretch armhf build environment for gplan.so
|
||||
# Matches the Pi exactly: GCC 6.3, Python 3.5, GLIBC 2.24
|
||||
#
|
||||
# Build image: docker build -t onefin-gplan -f .pi/Dockerfile.gplan .pi/
|
||||
# Build gplan: .pi/build-gplan.sh
|
||||
FROM balenalib/raspberry-pi-debian:stretch
|
||||
|
||||
# Fix repos to use archived Raspbian mirrors
|
||||
RUN echo "deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi" \
|
||||
> /etc/apt/sources.list && \
|
||||
rm -f /etc/apt/sources.list.d/*.list
|
||||
|
||||
RUN apt-get -o Acquire::Check-Valid-Until=false \
|
||||
-o Acquire::AllowInsecureRepositories=true update && \
|
||||
apt-get -o Acquire::Check-Valid-Until=false --allow-unauthenticated \
|
||||
install -y --no-install-recommends \
|
||||
build-essential python3-dev scons git ca-certificates \
|
||||
libssl-dev libexpat1-dev libbz2-dev liblz4-dev zlib1g-dev perl file && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Clone and build cbang
|
||||
RUN mkdir -p /opt/cbang && cd /opt/cbang && git init -q && \
|
||||
git remote add origin https://github.com/CauldronDevelopmentLLC/cbang && \
|
||||
git fetch --depth 1 -q origin 18f1e963107ef26abe750c023355a5c40dd07853 && \
|
||||
git reset --hard FETCH_HEAD -q && \
|
||||
scons -j2 disable_local="re2 libevent" && \
|
||||
rm -rf .git build/dep
|
||||
|
||||
# Clone, patch, and build camotics/gplan
|
||||
RUN mkdir -p /opt/camotics && cd /opt/camotics && git init -q && \
|
||||
git remote add origin https://github.com/CauldronDevelopmentLLC/camotics && \
|
||||
git fetch --depth 1 -q origin ec876c80d20fc19837133087cef0c447df5a939d && \
|
||||
git reset --hard FETCH_HEAD -q && \
|
||||
mkdir -p build && touch build/version.txt && \
|
||||
P="src/gcode/plan" && \
|
||||
for F in LineCommand.cpp LinePlanner.cpp; do \
|
||||
for V in maxVel maxJerk maxAccel; do \
|
||||
perl -i -0pe "s/(fabs\((config\.$V\[axis\]) \/ unit\[axis\]\));/std::min(\2, \1);/gm" $P/$F; \
|
||||
done; \
|
||||
done && \
|
||||
rm -rf .git
|
||||
|
||||
ENV CBANG_HOME=/opt/cbang
|
||||
|
||||
# Pre-compile everything including gplan.so
|
||||
RUN cd /opt/camotics && scons -j2 gplan.so with_gui=0 with_tpl=0
|
||||
|
||||
WORKDIR /opt/camotics
|
||||
Reference in New Issue
Block a user