ScatteredRay / pi-bootstrap

A repository that shows how to use Pi-Gen and Github actions to create a ready to use Raspberry Pi image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pi-bootstrap

A repository that shows how to use Pi-Gen and Github Actions to create a ready-to-use Raspberry Pi image that includes connectivity to your home Wi-Fi, custom packages and build steps without opening a terminal or any manual setup. You can do all of this directly within the Github UI, which significantly lowers the barrier of entry for novice users, who don't need to understand a lot of the technical details.

Youtube video explaining the what, why and how.

Bootstrapping the Raspberry Pi using GitHub Actions

⚙️ This repository is intended as a basic template for developers who wish to create ready-to-use bootstrap repositories meant for novice users. See aniongithub/raspotify-appliance for an example of a repository meant for novice end-users to use directly

Github Actions Usage

  1. Click image-20210416222151898and create a new public/private repository in your account based on this template.

    ⚠️ If you plan to use this repository to create a ready-to-use image that includes your Wi-Fi SSID, passphrase or other private information, it is recommended to create a private repository at this stage

  2. Navigate to image-20210416225541954and then image-20210416225617502 (in the sidebar)

  3. Add secrets and values for the following supported arguments as required.

    ⚙️ If you're a developer creating templates for other users, you can skip this step to use safe defaults you can test with

Name Description
IMAGE_NAME This is the name of the generated image. Defaults to the name of the repository you created in step 1
FIRST_USER The username of the first user on the generated image. Defaults to pi
FIRST_USER_PASS The password for the first user on the generated image. Defaults to raspberry
HOSTNAME The name with which your newly booted pi will identify itself to any networks. Defaults to IMAGE_NAME
SSH_ENABLED 1 to enable SSH, 0 to disable SSH. Defaults to 1
WPA_COUNTRY Two-character ISO-3166-1 alpha-2 country code for your country. Not setting this will keep Wi-Fi disabled via rfkill
WPA_SSID SSID of your Wi-Fi network, if you want to enable Wi-Fi connectivity. Not setting this will keep Wi-Fi disabled via rfkill
WPA_PASSPHRASE Passphrase of your Wi-Fi network, if you want to enable Wi-Fi connectivity. Not setting this will keep Wi-Fi disabled via rfkill
  1. Navigate to the image-20210416231117301 tab and then edit bootstrap/00-packages to add or remove any packages your custom image might need

  2. Optionally, you can edit config, bootstrap/01-run.sh and/or bootstrap/02-run.sh to add, remove or re-order custom installation steps and commit your changes :gear: See .github/workflows/manual.yml for an example of how to add custom secrets that are then propagated to config via pi-gen/build-docker.sh to any custom build steps you create

  3. Finally, to build an image for testing, navigate to image-20210416232008223and select the image-20210416232050305workflow. You can then pick the branch want to build image-20210416232231819

  4. Click image-20210416232332897 and wait for the workflow run to finish. This may take 30+ minutes, depending on the packages and custom installation steps you've selected

    ⚠️ Free Github accounts only come with 2000 minutes of (Linux) Actions usage per month, so be careful with your usage minutes!

  5. Once the workflow completes successfully, you will be able to download the image it built for you

    ⚠️ Make sure to delete or hide any artifacts that may contain sensitive information. Your secrets will not be propagated to any repositories created using your template, but artifacts and logs may be visible to anyone who can see the repository

  6. Burn the image from step 8 onto a microSD card using Imager, Etcher or another program of you choice.

  7. Pop the microSD card into your pi, power it up and wait for it to boot (green light stops flickering). Test your custom image and repeat steps 4-9 as needed

  8. Once you're happy with your custom image, you can create a release to lock in that configuration for posterity. Go to the image-20210416231117301tab and click image-20210416233657764on the right. Enter all release details and hit image-20210416233817873

  9. Wait for the release workflow to finish and you should see your new release appear in the image-20210416234024343 section along with your newly-minted image (and the source code packages it was built from)

  10. Burn your custom image onto a microSD card using Imager or Etcher and start using it in your Raspberry pi!

About

A repository that shows how to use Pi-Gen and Github actions to create a ready to use Raspberry Pi image

License:MIT License


Languages

Language:Shell 100.0%