Skip to content

Commit

Permalink
Added support for building firmware images using docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
goosenphil committed Sep 1, 2018
1 parent 10ae4b2 commit e109563
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
@@ -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
17 changes: 17 additions & 0 deletions build_binaries.sh
@@ -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

0 comments on commit e109563

Please sign in to comment.