Skip to content

Build your own images

Tom Hodder edited this page Nov 10, 2021 · 2 revisions

Building your own image

You will need an sdcard with at least enough space to flash the images. The released images and script were tested with 32GB cards, but you might be able to get away with 8GB for lite images.

  1. clone the repo
git clone https://github.com/limepepper/raspberry-pi-factory-reset.git
  1. Download a source image and save it to the root of the project directory then unzip it

$ wget https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2021-03-25/2021-03-04-raspios-buster-armhf.zip

$ unzip 2021-03-04-raspios-buster-armhf.zip

$ ls
2021-03-04-raspios-buster-armhf.zip
2021-03-04-raspios-buster-armhf-lite.img
create-factory-reset
  1. Make the script executable
$ chmod +x create-factory-reset
  1. Execute the script which modifies the image:
$ sudo ./create-factory-reset -i 2021-03-04-raspios-buster-armhf-lite.img -a
  1. This will produce a new image with restore suffix like so;
2021-03-04-raspios-buster-armhf-lite.restore.img

you can flash this to the rPi

Clone this wiki locally