Skip to content

Commit

Permalink
Add manual (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
icarito authored Aug 3, 2018
1 parent 1fcf19a commit 477d6a7
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Raspberry Pi Image Builder

**PublicLab.Org**

![](publiclab.svg)

This documentation covers the usage of the builder script for operating system images designed to be included with Public Lab Camera Kits.

Any person may use this script and the related infrastructure for building customized operating systems for their own projects.

It is important to highlight that this project was forked from the [Hypriot project](https://github.com/hypriot/image-builder-rpi). Thanks!

## Rationale

Often DIY projects require customizing software. It is an effort to publish these customizations.

This repository could serve to share customizations and develop them *socially*, by means of issuing pull requests and sharing build recipes and resulting images.

This guide serves the purpose of detailing the build process and suggesting a customization workflow.

## Developing

Issuing a PR will build the image. We will merge PRs aligned and suitable to be included in Public Lab's Camera Kits, at the discretion of the maitainers. You are encouraged to fork your own repository and experiment with preparing your own images!

- Repository (GitLab): https://gitlab.com/publiclab/image-builder-rpi

By using Gitlab's automated continuous integration to build images you'll have fresh images built for you every time you push your changes.

For the community's convenience, this repository is also mirrored at Github

- Repository (GitHub): https://github.com/publiclab/image-builder-rpi

## License

Like its upstream project Hypriot, `image-builder-rpi` is licensed with the MIT license.

This guide is licensed with Creative Commons Share-Alike 4.0 Unported license.

## Contributors

This project was initiated by Sebastian Silva by contract of PublicLab.Org, the **Public Laboratory for Open Technology and Science**.
6 changes: 6 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Summary

* [Image Builder](README.md)
* [Customization](customization.md)
* [Workflow](workflow.md)
* [Roadmap](roadmap.md)
3 changes: 3 additions & 0 deletions docs/book.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Raspberry Pi Image Builder"
}
29 changes: 29 additions & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Image Customization

This repository holds the recipe and files for building an operating system image capable of booting on Raspberry Pi (tested on model `Pi Zero W`).

While you may build locally if you have Docker (tested on Linux), it is recommended that you follow the [workflow](workflow.md).

## Files and Directories

`builder/files/`: All files in this directory will be copied over to the Raspberry Pi image's root directory.

`builder/build.sh`: This is the script that does the actual building.

`builder/chroot-script.sh`: This is the script that is run inside an ARM based virtual machine that emulates the raspberry pi. It installs packages and also generates some configuration files.

`builder/files/boot/user-data`: This is the configuration file for cloud-init. It holds important customizations such as username creation and hostname configuration.

## Cloud Init Configuration File (`user-data`)

This is one recommended configuration point as it can be modified *before first boot*.

This is the main configuration file for `cloud-init` which is designed to customize cloud servers and provides many useful configuration hooks. Please refer to the [`cloud-init` documentation](https://cloudinit.readthedocs.io/en/0.7.9/) for details.

## Customization Orientation

If you'd like to start scripts every boot, try to customize `builder/files/etc/rc.local` adding commands which will be ran after the rest of the startup process.

Also the web root is at `/var/www/`. You may place web content or applications here. PHP has been enabled by default.

Once you have modified the scripts or files to be included in the distribution, follow the [workflow](workflow.md) into the next step.
6 changes: 6 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"gitbook-cli": "^2.3.2",
"svgexport": "^0.3.2"
}
}
107 changes: 107 additions & 0 deletions docs/publiclab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Development goals

This is a wishlist of features to include:

* Configure Wifi (client / access point / forwarding)
* Streaming Camera
* Web editor / runner for scripts
* Configure scripts to run at boot
27 changes: 27 additions & 0 deletions docs/workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Development Workflow for Custom Images

We recommend that you follow these steps to build your images.

## Make a Pull Request

Create a named branch with a descriptive name (it will be used in the image filename), and **make a pull request** describing your intentions!

**Intention to merge to master is not required**. You may issue a PR simply for sharing an experiment and for triggering a build to test an image.

## Download the build artifact from GitLab CI

Once you've made a PR, you should see a build triggered that is linked in your PR.

It can take more than 20 minutes to build an image.

You may follow the link on your PR to view the build log and find the links to download the build artifacts, which hold the image for flashing.

These images are referred to as build artifacts and are available for download directly from the [**build jobs page at Gitlab**](https://gitlab.com/publiclab/image-builder-rpi/-/jobs).

## Flash your image

Using your preferred method (or the [Hypriot flash tool](https://github.com/hypriot/flash) which offers some flash-time customization hooks.

## Share your results!

Do comment on your PR!

0 comments on commit 477d6a7

Please sign in to comment.