treehouses / builder

Treehouses Awesome 👓 Raspberry Pi Image Builder 🏗
http://download.treehouses.io
GNU Affero General Public License v3.0
49 stars 22 forks source link
balena chroot-environment debian docker docker-compose hacktoberfest raspberry-pi rpi-image travis-ci treehouses

Build Status Maintainability Gitter

builder

builder is based on Raspbian and allows the user to develop and tailor their own custom Raspberry Pi images. The script will modify the latest Raspbian image by installing packages, purging packages and executing custom commands, and then finally creates a bootable .img file that can be burned to the microSD card.

Instructions

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

System requirements:

Note:

To install the required packages, run the following command in Debian/Ubuntu:

sudo apt-get install kpartx wget gpg parted qemu-arm-static.

For other operating systems like MacOS or Windows, check out the Vagrantfile inside the repository.

Getting Started

git clone https://github.com/treehouses/builder.git
cd builder
./builder --chroot

You should be in a chrooted environment when it is completed. You can access the RPi images' files and folders or carry on with any extra modifications. To exit the chrooted environment just type exit and then you should be back in your own shell again. The image in this stage is now ready to write to the microSD card.

Add gpg key

sudo bash -c 'wget -O - https://packagecloud.io/gpg.key | apt-key add -'

Customize

Retrieve builds

After exiting from the chroot environment, successful builds are found in the builder/images directory. There should be a few files in that directory. The .zip file is the unmodified base image, which is downloaded by the script when executed. The .img file is the new customized image and is now ready to be burned onto the microSD card.

To remove unwanted modifications otherwise

bash clean.sh

Write to microSD card and try out the image

We will need a few hardware and software:

Open Etcher, select the location of the .img file, the destination drive of the microSD card, then press the flash button to write the image onto the microSD card. Remember that this process will wipe out everything on the selected drive, so make sure to select the right one.

Release

This project uses Github Actions to automatically build and upload a new treehouse image to http://dev.ole.org. The builder.yml configuration file tells Github Actions to run the deployment if a tag is applied to the commit.