Skip to content

lantern-works/pi-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-maker

Getting Started

make && make run

A new disk image for Raspberry Pi will appear inside this project folder within "share/build". This solution has been tested with Raspberry Pi Zero W and may work for other models, too.

Next: Flash With Desktop App

Download Etcher

Open the desktop application and follow the prompts to select the disk image and the desired SD Card to use.

Or: Flash With Command Line

Install Etcher CLI

Run the commands below and the terminal will prompt you to select the desired drive to install to. Please be careful to select the proper SD Card and not another disk to avoid unwanted data loss.

make && make run
sudo etcher ./share/build/rpi.img

Requirements

A local Docker environment is required in order to build an image.

Customization

The docker entrypoint mainly does two things:

  1. copies all files from share/copy-this to the root filesystem
  2. runs share/setup (as root) * ...which runs share/my-scripts/test-script by default

The easiest way to customize the image build process, is to put scripts in share/my-scripts, and edit share/setup to run whatever scripts you want. Remember the scripts will run as root so if you want to do something as the pi user, prefix it with sudo -u pi dothething.

Customizing the base OS

By exporting OS_IMAGE, and/or OS_URI you can use a different operating system, like so:

# Creating a raspbian image requires merging the boot partition into the root tar
pushd share/build
export LATEST_BUILD='2018-11-15-21:03'
wget http://vx2-downloads.raspberrypi.org/raspbian_lite/archive/${LATEST_BUILD}/boot.tar.xz
wget http://vx2-downloads.raspberrypi.org/raspbian_lite/archive/${LATEST_BUILD}/root.tar.xz
unxz root.tar.xz
mkdir -p boot && tar -xf boot.tar.xz -C boot && sudo chown -R 0 boot && sudo chgrp -R 0 boot
tar -rf root.tar boot && sudo rm -rf boot
export IMAGE_SIZE=4G
export OS_IMAGE=root.tar
popd
make run

Reference

Disclaimer

This repository is under active development and not yet intended for widespread use.

Releases

No releases published

Packages

No packages published