- Start with Xenial/Stretch or newer, per the README. Internet access is required.
- Install git
- 'git clone https://github.com/RPi-Distro/pi-gen.git; cd pi-gen'
- Install the missing packages that it reports
- 'CLEAN=1 ./build.sh'
- Get some coffee. Make dinner.
- Your zipped images are in the 'deploy' directory
This runs OK on a Pi with a 32G SD card.
Review the README, and the contents of the stage directories for details on how the build process works, and can be modified. Avoid working with patches until you are more comfortable with the process.