Pi-gen Tweaks

A pi4B (or 3B+ in many cases) has quite enough power to make a decent application server for home or small office use. For this application you don't want most of the standard Raspbian/PiOS you just want Raspbian-lite.

But you also probably want to run the thing headless which means you need to have it start up with a known IP address, SSH enabled, maybe WiFi enabled. And if you're thinking of giving them to your friends or selling them to customers then you need an image that works right out of the box with no tweaks.

I've been working for a while on a system to use the Pi-gen project (https://github.com/RPi-Distro/pi-gen ) code to do exactly this. The results are three repos for people to use.

The first repo contains some utilities that allow you to manage your customizations to pi-gen without overwriting the pi-gen files themselves when you aren't building the image.

I learned the hard way that developing in a clone of the pi-gen repo was a total mess. In addition to the difficulty of tracking down which files had changed and where they were (was it stage1/01-sys-tweaks or stage2/02-net-tweaks or ?) there were two cases where I regularly had problems. The first is when the pi-gen people update their repo. Updating your copy when the files have been changed tends to leave you in merge hell as things don't quite build any more - or worse they build but don't actually work when you try to boot the result. The second is when you want to build images for two or more different servers, like say a docker server a DNS/DHCP server and a web/email server. You end up cloning the repo multiple times and as I found out, once you've built a bunch of images (particularly if you use the docker build version) it is amazingly easy to run out of disk space.

You can get this repo at https://github.com/FrancisTurner/pi-gen-utils

Basic usage instructions are in the README.md

The other two use that repo to build a basic lite server that you can give a static IP address in a file in the /boot/ partition and one that builds on that to create a base docker server with docker-compose installed.

Both of these seem like good foundations for others to build their servers of choice on.

These should work on any pi, though I haven't checked it on anything too old yet.

Boot File Generator

The Boot File Generator is a page to generate the netcfg.txt and optional wpa_supplicant.conf that you can use with the above images

SSHFS utilities

The sshfs utilities repo is a few utility scripts that makes it easy to manage mount points that are connected using fusermount and sshfs.

Arm v6 Cloudflared updater

The Arm v6 Cloudflared is about a utility script that keeps the unoffical arm v6 version of cloudflared updated

More

More stull will show up here soon.

© 2020-21 Francis Turner