Skip to content
  • Facebook
  • YouTube
  • Twitter
  • LinkedIn
  • Inventory Mobile
  • Help
  • Changelog
Jonathan Ryan Grice's Blog

Jonathan Ryan Grice's Blog

  • JTTS
  • PGPC Live Stream
  • Gifts of the Spirit
  • Altar Worker’s Guide
    • Part 1 – Introduction
    • Part 2 – Etiquette
    • Part 3 – Creating an Environment for Healing and Deliverance
    • Part 4 – Submission
    • Part 5 – Empty Vessels Cannot Pour
    • Part 6 – Types of Prayer at the Altar
    • Part 7 – Conclusion
  • About Me
  • Toggle search form

How to Build a Custom Minimal Ubuntu 24.04 Image for Raspberry Pi 3B

Posted on February 12, 2026February 12, 2026 By Jonathan No Comments on How to Build a Custom Minimal Ubuntu 24.04 Image for Raspberry Pi 3B
Listen to this article

How to Build a Minimal Ubuntu 24.04 Image for Raspberry Pi 3B (from Scratch)

In this guide, I’ll share how I created a custom, ultra-minimal Ubuntu 24.04.3 LTS image for the Raspberry Pi 3B. Unlike the standard server images which can be bloated, this build starts from the official Ubuntu Base rootfs and adds only what’s necessary, resulting in a lightweight, high-performance system (~400MB compressed).

Why Build Your Own?

  • Size: The final image is significantly smaller than the official Server image.
  • Performance: Includes optimizations like ZRAM (compressed swap) and Hardware RNG enabled by default.
  • Control: You know exactly what packages are installed.
  • WiFi Ready: Pre-configured WiFi connectivity (Netplan) and fixed firmware for the RPi 3B’s BCM43430 chip.

Prerequisites

You can run this build script on a Linux machine or Windows (via WSL2). You will need:

  • wget, git, parted, dosfstools, xz-utils
  • qemu-user-static (for cross-compiling on x86 machines)
  • sudo privileges (to mount loop devices)

The Build Process

The entire process is automated in a single bash script. Here is a breakdown of what it does:

1. Download and Verify

We start by downloading the official ubuntu-base-24.04.3-base-arm64.tar.gz and the Raspberry Pi firmware repository. We verify the SHA256 checksum to ensure integrity.

2. Disk Image Creation

We create a raw empty file (2GB) and partition it:

parted -s "$IMAGE_NAME" mklabel msdos
parted -s "$IMAGE_NAME" mkpart primary fat32 1MiB 257MiB
parted -s "$IMAGE_NAME" mkpart primary ext4 257MiB 100%

3. Formatting and Mounting

The image is mounted as a loop device. The first partition is formatted as FAT32 (boot), and the second as EXT4 (rootfs).

4. Chroot Environment Setup

This is the magic part. We extract the Ubuntu Base into the mounted root partition and use qemu-aarch64-static to “enter” the ARM64 environment from our PC. This allows us to run apt-get install as if we were on the Pi.

5. Installing the Kernel & Firmware

We copy the bootloader and kernel files from the Raspberry Pi firmware repo. A critical step for the Pi 3B is installing the correct WiFi firmware:

# Download Cypress firmware for BCM43430
wget -O /lib/firmware/brcm/brcmfmac43430-sdio.bin ...
wget -O /lib/firmware/brcm/brcmfmac43430-sdio.clm_blob ...
# Create the specific symlink required by the Pi 3B
ln -sf brcmfmac43430-sdio.txt /lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt

6. Optimizations

To make the Pi 3B snappy despite its 1GB RAM, we enable:

  • ZRAM: Allocates 50% of RAM as compressed swap.
  • Hardware RNG: Speeds up boot time and SSH key generation.
  • Watchdog: Auto-reboots the system if it freezes.

The Result

The script produces a .img.xz file. You can flash this directly to an SD card using tools like Etcher or Raspberry Pi Imager.

Download the Script: [build_manual.zip]

Tutorials Tags:Bash Scripting, Custom Image, Embedded Systems, Headless Setup, Minimal Linux, Raspberry Pi 3B, RPi WiFi Fix, Ubuntu 24.04 LTS, ZRAM

Post navigation

Previous Post: How to Build the Ultimate Portable “Travel Router” with Raspberry Pi & OpenWrt

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts

  • Hell and the Lake of Fire: A Biblical Distinction 132 views
  • Altar Worker’s Guide: Part 2 – Etiquette 40 views
  • TNC Driver Coverage Endorsement 39 views
  • Tutorial Ubuntu Server on Raspberry Pi 3 39 views
  • How to Build the Ultimate Portable “Travel Router” with Raspberry Pi & OpenWrt 37 views

Be Notified Of New Posts

Copyright © 2026 Jonathan Ryan Grice's Blog.

Powered by PressBook WordPress theme