Build your custom Debian image for RaspberryPi easily.
This tool runs under linux and needs some system requirements. Because it needs to be run as root (for the chroot purspose) it is highly recommended to run it inside a virtual machine.
The easiest way to run it is to use Vagrant to create a fresh VM, install requirements and then run the image build.
from the project directory
vagrant up
vagrant ssh
sudo su
cd /vagrant
Now you are inside the VM as root in the project directory, ready to run the image build. To do so, you can do it without any customization running the command
./rpi-debian-builder --config config.json --modules basic
It uses the basic
module which perform some elementary configuration. It is recommended to
always use it unless you really know what you are doing.
A module is a directory containing
- static files to deploy to the target filesystem
- templates to generate files to the target filesystem
- provisioning scripts
modules
|-- module1
| |-- initialize
| | |-- files
| | |-- templates
| | |-- scripts
| |
| |-- provision
| | |-- files
| | |-- templates
| | |-- scripts
| |
| |-- finish
| |-- files
| |-- templates
| |-- scripts
|
|-- module2
| |-- ...
Module phases:
initialize
- This phase runs before any other provisioning. It runs outside the chroot contextprovision
- This phase runs after built-in provisioning. It runs in a chroot contextfinish
- This phase runs after theprovision
one. It runs in a chroot context
In any phase, files and templates are always relative to the root of the filesystem of the target operating system.
To use your own module, just copy it in the modules
directory and make reference to it on the command
line when you run the rpi-debian-builder
command. You can reference as many module as you want (comma
separated).
Everything in this repository is published under the MIT license.