Skip to content

Commit

Permalink
added build script and Docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
heneault committed Feb 11, 2018
1 parent 965497d commit 956f0b0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ build/downloads/
build/sstate-cache/
build/tmp/
build/bitbake-cookerdaemon.log

images
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM debian:jessie

RUN apt-get update && \
apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping locales

RUN useradd -ms /bin/bash -p build build --uid 30000

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
ENV LANG en_US.utf8

USER build
WORKDIR /home/build
24 changes: 24 additions & 0 deletions build-pitrezor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e

IMAGE=pitrezor-build
TAG=${1:-master}
IMGFILE=images/pitrezor-$TAG.img
DOCKER_UID=30000

mkdir -p images
chown $DOCKER_UID:$DOCKER_UID images

docker build -t $IMAGE .

docker run -t -v $(pwd)/images:/images:z $IMAGE /bin/bash -c "\
git clone https://github.com/heneault/yocto-pitrezor.git && \
cd yocto-pitrezor && \
git checkout $TAG && \
git submodule update --init && \
. poky/oe-init-build-env build && \
bitbake pitrezor-image && \
cp tmp/deploy/images/raspberrypi0-wifi/pitrezor-image-raspberrypi0-wifi.rpi-sdimg /$IMGFILE"

zip -m -j -9 ${IMGFILE%.img}.zip $IMGFILE

0 comments on commit 956f0b0

Please sign in to comment.