mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 03:50:58 +00:00
build: unify build-docker.sh and build-docker.gcc_source.sh
This commit is contained in:
parent
fc9bc85ea3
commit
04cdb68ed2
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
_attic/
|
@ -18,14 +18,14 @@ ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/$TOOL
|
|||||||
|
|
||||||
RUN cd /opt && wget $TOOLCHAIN_URL && tar xfj $TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
RUN cd /opt && wget $TOOLCHAIN_URL && tar xfj $TOOLCHAIN_LONGVER-$TOOLCHAIN_FLAVOR.tar.bz2
|
||||||
|
|
||||||
# setup toolchain
|
|
||||||
|
|
||||||
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
|
||||||
|
|
||||||
# install additional tools
|
# install additional tools
|
||||||
|
|
||||||
RUN apt-get install -y protobuf-compiler libprotobuf-dev
|
RUN apt-get install -y protobuf-compiler libprotobuf-dev
|
||||||
|
|
||||||
|
# setup toolchain
|
||||||
|
|
||||||
|
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
||||||
|
|
||||||
# install python tools
|
# install python tools
|
||||||
|
|
||||||
RUN pip3 install click pyblake2 scons protobuf
|
RUN pip3 install click pyblake2 scons protobuf
|
||||||
|
@ -26,13 +26,17 @@ RUN cd /opt/$TOOLCHAIN_LONGVER && ./install-sources.sh --skip_steps=mingw32
|
|||||||
RUN cd /opt/$TOOLCHAIN_LONGVER && ./build-prerequisites.sh --skip_steps=mingw32
|
RUN cd /opt/$TOOLCHAIN_LONGVER && ./build-prerequisites.sh --skip_steps=mingw32
|
||||||
RUN cd /opt/$TOOLCHAIN_LONGVER && ./build-toolchain.sh --skip_steps=mingw32,manual
|
RUN cd /opt/$TOOLCHAIN_LONGVER && ./build-toolchain.sh --skip_steps=mingw32,manual
|
||||||
|
|
||||||
|
# install additional tools
|
||||||
|
|
||||||
|
RUN apt-get install -y protobuf-compiler libprotobuf-dev
|
||||||
|
|
||||||
# setup toolchain
|
# setup toolchain
|
||||||
|
|
||||||
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
ENV PATH=/opt/$TOOLCHAIN_LONGVER/bin:$PATH
|
||||||
|
|
||||||
# install python tools
|
# install python tools
|
||||||
|
|
||||||
RUN pip3 install click pyblake2 scons
|
RUN pip3 install click pyblake2 scons protobuf
|
||||||
RUN pip3 install --no-deps git+https://github.com/trezor/python-trezor.git@master
|
RUN pip3 install --no-deps git+https://github.com/trezor/python-trezor.git@master
|
||||||
|
|
||||||
# workarounds for weird default install
|
# workarounds for weird default install
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
IMAGE=trezor-core-build.gcc_source
|
|
||||||
TAG=${1:-master}
|
|
||||||
|
|
||||||
docker build -t $IMAGE -f Dockerfile.gcc_source .
|
|
||||||
|
|
||||||
docker run -t -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\
|
|
||||||
git clone https://github.com/trezor/trezor-core && \
|
|
||||||
cd trezor-core && \
|
|
||||||
ln -s /build build &&
|
|
||||||
git checkout $TAG && \
|
|
||||||
git submodule update --init --recursive && \
|
|
||||||
make clean vendor build_boardloader build_bootloader build_prodtest build_firmware"
|
|
@ -1,7 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
IMAGE=trezor-core-build
|
if [ "$1" = "--gcc_source" ]; then
|
||||||
|
DOCKERFILE=Dockerfile.gcc_source
|
||||||
|
IMAGE=trezor-core-build.gcc_source
|
||||||
|
shift
|
||||||
|
else
|
||||||
|
DOCKERFILE=Dockerfile
|
||||||
|
IMAGE=trezor-core-build
|
||||||
|
fi
|
||||||
|
|
||||||
TAG=${1:-master}
|
TAG=${1:-master}
|
||||||
REPOSITORY=${2:-trezor}
|
REPOSITORY=${2:-trezor}
|
||||||
|
|
||||||
@ -11,7 +19,7 @@ else
|
|||||||
REPOSITORY=https://github.com/$REPOSITORY/trezor-core.git
|
REPOSITORY=https://github.com/$REPOSITORY/trezor-core.git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker build -t $IMAGE .
|
docker build -t $IMAGE -f $DOCKERFILE .
|
||||||
|
|
||||||
docker run -t -v $(pwd):/local -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\
|
docker run -t -v $(pwd):/local -v $(pwd)/build-docker:/build:z $IMAGE /bin/sh -c "\
|
||||||
git clone $REPOSITORY trezor-core && \
|
git clone $REPOSITORY trezor-core && \
|
||||||
|
Loading…
Reference in New Issue
Block a user