diff --git a/.gitignore b/.gitignore index 44bd340..a7384c1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ build/downloads/ build/sstate-cache/ build/tmp/ build/bitbake-cookerdaemon.log - +images diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d38b9ae --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/build-pitrezor.sh b/build-pitrezor.sh new file mode 100755 index 0000000..c69a24b --- /dev/null +++ b/build-pitrezor.sh @@ -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 +