Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for building firmware images using docker.
- Loading branch information
1 parent
10ae4b2
commit e109563
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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,20 @@ | ||
FROM fedora:28 | ||
LABEL Description="OpenDPS firmware, built using GCC 7.1.0" | ||
|
||
RUN dnf update -y && dnf install -y arm-none-eabi-gcc arm-none-eabi-newlib git make python sudo findutils | ||
|
||
ENV user opendps | ||
RUN useradd -d /home/$user -m -s /bin/bash $user | ||
RUN echo "$user ALL=(root) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
USER $user | ||
WORKDIR /home/$user | ||
RUN mkdir -pv code | ||
COPY . ./code/ | ||
RUN sudo chown $user.$user -R /home/$user/code | ||
WORKDIR /home/$user/code/ | ||
RUN git submodule init | ||
RUN git submodule update | ||
RUN make -j -C libopencm3 | ||
RUN make -C opendps elf bin | ||
RUN make -C dpsboot elf bin |
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,17 @@ | ||
#!/bin/bash | ||
|
||
# Builds OpenDPS binaries in docker and then copies it over to host machine | ||
|
||
set -e | ||
git rev-parse --short HEAD | ||
PROJECT=$(git rev-parse --short HEAD) | ||
echo "Building opendps git version: $PROJECT" | ||
docker build -t $PROJECT -f Dockerfile3 . | ||
|
||
CONTAINER_ID=$(docker create $PROJECT bash) | ||
echo "CONTAINER ID: $CONTAINER_ID" | ||
docker cp $CONTAINER_ID:/home/opendps/code/opendps/opendps.elf ./opendps/opendps.elf | ||
docker cp $CONTAINER_ID:/home/opendps/code/opendps/opendps.bin ./opendps/opendps.bin | ||
docker cp $CONTAINER_ID:/home/opendps/code/dpsboot/dpsboot.elf ./dpsboot/dpsboot.elf | ||
docker cp $CONTAINER_ID:/home/opendps/code/dpsboot/dpsboot.bin ./dpsboot/dpsboot.bin | ||
docker rm $CONTAINER_ID |