Commit 65fa0cfc authored by Nick Elsmore's avatar Nick Elsmore

Initial commit

FROM debian:stretch
ENV PUID=${PUID:-1000}
ENV PGID=${PGID:-1000}
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y -q \
git-core \
gnupg \
flex \
bison \
build-essential \
libssl-dev \
curl \
wget \
gcc-arm-linux-gnueabihf \
python \
bc \
multistrap \
libc6-dev-armhf-cross \
qemu-user-static \
&& apt-get clean
RUN curl > /usr/local/bin/repo \
&& chmod a+x /usr/local/bin/repo
RUN groupadd -r docker -g ${PGID} \
&& useradd -u ${PUID} -r -g docker -d /home/docker docker \
&& mkdir /home/docker \
&& mkdir /home/docker/pyra-build \
&& chown -R docker.docker /home/docker \
&& echo "docker ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
COPY ./ssh_config /home/docker/.ssh/config
RUN chmod 600 /home/docker/.ssh/config \
&& chown -R docker.docker /home/docker/.ssh
COPY ./ /
RUN chmod a+x /
USER docker
# PyraOS Build System
The PyraOS build system utilizes `` to manage a clean and isolated build environment for building PyraOS images and packages.
## Setting up your host
### Installing dependencies
All you need is a Linux host, preferably x86_64 with 4+ cores and 8GB+ of RAM, with `` running. On Debian based systems, install `` via `apt`. On other systems, Google is your friend :)
sudo apt install
Note, you will probably need to add your user to the `docker` group.
sudo usermod -a -G docker $USER
Also ensure that you have an ssh key created named `id_rsa` in `~/.ssh`.
### Setting up your build environment
Start off by cloning the `pyra-docker` repository to a sensible build location.
git clone /path/to/build/location
cd /path/to/build/location
Next, you'll need to create the directory on your host system where we'll be doing all the work. This directory will be linked into the docker environment when we start up the container.
mkdir -p pyra-build
Now we're ready to build the docker image. This will create and configure a base image of our build environment. If you're curious to see what's going on here or want to modify it, check out `Dockerfile`. Note that as long as you don't modify `Dockerfile` or ``, you only have to do this once.
## Working with the build system
### Building a PyraOS image
Coming soon!
### Building the kernel
Coming soon!
### Building U-Boot
Coming soon!
### Building PyraOS Debian packages
Coming soon!
### Building DBPs
Coming soon!
#! /bin/bash
docker build --build-arg PUID=$UID -t pyra-build .
#! /bin/bash
set -e
[ $# -eq 0 ] && set -- all
env_setup() {
export LANG=en_US.UTF-8
export USER=$(whoami)
export BUILD_ROOT=/home/docker/pyra-build
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
mkdir -p $BUILD_ROOT
pyra_init() {
repo init -u
repo sync
main() {
exec bash
main "$@"
#! /bin/bash
BUILD_DIR=$(realpath pyra-build)
if [ ! -d $BUILD_DIR ]; then
echo "$BUILD_DIR not found."
echo "Please create it before running script."
exit 1
if [ ! -e $GITCONFIG ]; then
echo "$GITCONFIG not found."
echo "Please create it before running script."
exit 1
if [ ! -e $ID_RSA ]; then
echo "$ID_RSA not found."
echo "Please configure it before running script."
exit 1
docker run \
--volume $BUILD_DIR:/home/docker/pyra-build \
--volume $GITCONFIG:/home/docker/.gitconfig \
--volume $ID_RSA:/home/docker/.ssh/id_rsa \
-it pyra-build
Host *
StrictHostKeyChecking no
User git
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment