Skip to content

Creating a new Raspberry Pi release

Roel Broersma edited this page Oct 23, 2023 · 26 revisions

How to create a new Raspberry Pi release to upload to the Github Release page

There are two methods, manual and automatic (via a script): Manual Automatic

Method 1 (manual)

  1. Take a Linux machine or (virtual) DietPi.
  2. Install a Desktop environment like LXDE (dietpi-software and select install software: LXDE: ultra lightweight desktop)
  3. Install gnome-disk-utility using: apt-get install gnome-disk-utility -y
  4. Download the Latest DietPi image for Raspberry Pi systems, using: cd /tmp wget https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz -o /tmp/dietpi.img.7z
  5. Download the latest dietpi.txt from the Tunnel Gui Project: wget https://raw.githubusercontent.com/roelbroersma/tunnel-gui/main/dietpi.txt
  6. Install 7zip: apt-get install 7zip
  7. Extract the downloaded zipfile: cd /tmp 7zr x /tmp/DietPi_RPi-ARMv8-Bookworm.img.xz
  8. Start the Desktop environment on a machine which has a monitor connected (or a Hyper-V console window) using the command: startx
  9. Start the Gnome disk utility, open a Terminal and type: gnome-disks
  10. Click the Hamburger Menu and click 'Attach Disk Image... (.iso, .img)', now select the unpacked .img file at /tmp/DietPi_RPi-ARMv8-Bookworm.img and make sure to unclick Set up read-only loop device!
  11. You will see two partitions, select the first FAT partition and click the Play button, it will now mount as /media/....
  12. Go to the /media/.... folder and drag and drop the /tmp/dietpi.txt file to it that we downloaded in step 5. Overwrite it.
  13. Go back to the gnome-disk-utility and click the STOP button to stop mounting the FAT partition.
  14. Now click the MINUS button in the top bar to DETACH the .img file.
  15. Go to a terminal and zip the .img file using a normal .zip utility (this is more friendly for our Windows users): cd /tmp zip -9 -o dietpi_image_output_file.zip DietPi_RPi-ARMv8-Bookworm.img

Method 2 (automatic)

#!/bin/bash

# Step 1: Download latest DietPi image for Raspberry Pi
cd /tmp
wget https://dietpi.com/downloads/images/DietPi_RPi-ARMv8-Bookworm.img.xz

# Stap 2: Unpack the .xz so we have our .img file
unxz DietPi_RPi-ARMv8-Bookworm.img.xz

# Step 3: Calculate the Offset and mount the .img file
# Use Fdisk to see the START sector of the first image
offset=$(fdisk -lu DietPi_RPi-ARMv8-Bookworm.img | grep 'img1' | awk '{print $3}')
# Multiply this with the sector size of 512 bytes:
offset=$((offset * 512))
# Create the mount folder and mount
mkdir -p /mnt/dietpi_img
mount -o loop,offset=${offset} DietPi_RPi-ARMv8-Bookworm.img /mnt/dietpi_img

# Step 4: Download and replace the dietpi.txt file
wget https://raw.githubusercontent.com/roelbroersma/tunnel-gui/main/dietpi/dietpi.txt
cp dietpi.txt /mnt/dietpi_img

# Step 5: Unmount
umount /mnt/dietpi_img

# Step 6: Zip the .img file using a normal zip (to make it easy for our Windows users) and with maximum compression
zip -9 DietPi_RPi-ARMv8-Bookworm_compressed.zip DietPi_RPi-ARMv8-Bookworm.img```
Clone this wiki locally