• Stars
    star
    1,668
  • Rank 28,022 (Top 0.6 %)
  • Language
    C
  • License
    Other
  • Created about 5 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.

rpi-imager

Raspberry Pi Imaging Utility

  • Download the latest version for Windows, macOS and Ubuntu from the Raspberry Pi downloads page.
  • To install on Raspberry Pi OS, use sudo apt update && sudo apt install rpi-imager.

License

The main code of the Imaging Utility is made available under the terms of the Apache license. See license.txt and files in "src/dependencies" folder for more information about the various open source licenses that apply to the third-party dependencies used such as Qt, libarchive, drivelist, mountutils and libcurl. For the embedded (netboot) build see also "embedded/legal-info" for more information about the extra system software included in that.

How to rebuild

Debian/Ubuntu Linux

Get dependencies

Install the build dependencies:

sudo apt install --no-install-recommends build-essential devscripts debhelper cmake git libarchive-dev libcurl4-gnutls-dev \
    qtbase5-dev qtbase5-dev-tools qtdeclarative5-dev libqt5svg5-dev qttools5-dev libgnutls28-dev \
    qml-module-qtquick2 qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtgraphicaleffects

Get the source

git clone --depth 1 https://github.com/raspberrypi/rpi-imager

Building on the Pi

If building on a device with limited memory (e.g. 1 GB Pi), disable parallel build or it may run out of memory:

export DEB_BUILD_OPTIONS="parallel=1"

Build the Debian package

cd rpi-imager
debuild -uc -us

debuild will compile everything, create a .deb package and put it in the parent directory. Can install it with apt:

cd ..
sudo apt install ./rpi-imager*.deb

It should create an icon in the start menu under "Utilities" or "Accessories". The imaging utility will normally be run as regular user, and will call udisks2 over DBus to perform privileged operations like opening the disk device for writing. If udisks2 is not functional on your Linux distribution, you can alternatively start it as "root" with sudo and similar tools.

Fedora/RHEL/CentOS Linux

Get dependencies

Install the build dependencies:

sudo yum install git gcc gcc-c++ make cmake libarchive-devel libcurl-devel openssl-devel qt5-qtbase-devel qt5-qtquickcontrols2-devel qt5-qtsvg-devel qt5-linguist

Get the source

git clone --depth 1 https://github.com/raspberrypi/rpi-imager

Build and install the software

cd rpi-imager
mkdir -p build
cd build
cmake ../src
make
sudo make install

Windows

Get dependencies

  • Get the Qt online installer from: https://www.qt.io/download-open-source During installation, choose a Qt 5.x with Mingw32 32-bit toolchain and CMake.

  • If using the official Qt distribution that does NOT have schannel (Windows native SSL library) support, compile OpenSSL libraries ( https://wiki.qt.io/Compiling_OpenSSL_with_MinGW ) and copy the libssl/crypto DLLs to C:\qt\5.x\mingw73_32\bin the include files to C:\qt\5.x\mingw73_32\include and the import library files to C:\qt\5.x\mingw73_32\lib

  • For building installer get Nullsoft scriptable install system: https://nsis.sourceforge.io/Download

  • It is assumed you already have a proper code signing certificate, and signtool.exe from the Windows SDK installed. If NOT and are you only compiling for your own personal use, comment out all lines mentioning signtool from CMakelists.txt and the .nsi installer script.

Building

Building can be done manually using the command-line, using "cmake", "make", etc., but if you are not that familar with setting up a proper Windows build environment (setting paths, etc.), it is easiest to use the Qt creator GUI instead.

  • Download source .zip from github and extract it to a folder on disk
  • Open src/CMakeLists.txt in Qt creator.
  • For builds you distribute to others, make sure you choose "Release" in the toolchain settings and not the debug flavour.
  • Menu "Build" -> "Build all"
  • Result will be in build_rpi-imager_someversion
  • Go to the BUILD folder, right click on the .nsi script "Compile NSIS script", to create installer.

Note: the CMake integration in Qt Creator is a bit flaky at times. If you made any custom changes to the CMakeLists.txt file and it subsequently gets in an endless loop where it never finishes the "configures" stage while re-processing the file, delete "build_rpi-imager_someversion" directory and try again.

Mac OS X

Get dependencies

  • Get the Qt online installer from: https://www.qt.io/download-open-source During installation, choose a Qt 5.x edition and CMake.
  • For creating a .DMG for distribution you can use an utility like: https://github.com/sindresorhus/create-dmg
  • It is assumed you have an Apple developer subscription, and already have a "Developer ID" code signing certificate for distribution outside the Mac Store. (Privileged apps are not allowed in the Mac store)

Building

  • Download source .zip from github and extract it to a folder on disk
  • Start Qt Creator (may need to start "finder" navigate to home folder using the "Go" menu, and find Qt folder to start it manually as it may not have created icon in Applications), and open src/CMakeLists.txt
  • Menu "Build" -> "Build all"
  • Result will be in build_rpi-imager_someversion
  • For distribution to others: code sign the .app, create a DMG, code sign the DMG, submit it for notarization to Apple and staple the notarization ticket to the DMG.

E.g.:

cd build-rpi-imager-Desktop_Qt_5_14_1_clang_64bit-Release/
codesign --deep --force --verify --verbose --sign "YOUR KEYID" --options runtime rpi-imager.app
mv rpi-imager.app "Raspberry Pi Imager.app"
create-dmg Raspberry\ Pi\ Imager.app
mv Raspberry\ Pi\ Imager\ .dmg imager.dmg
xcrun altool --notarize-app -t osx -f imager.dmg --primary-bundle-id="org.raspberrypi.imagingutility" -u YOUR-EMAIL-ADDRESS -p YOUR-APP-SPECIFIC-APPLE-PASSWORD -itc_provider TEAM-ID-IF-APPLICABLE
xcrun stapler staple imager.dmg

Linux embedded (netboot) build

The embedded build runs under a minimalistic Linux distribution compiled by buildroot. To build:

cd rpi-imager/embedded
./build.sh

The result will be in the "output" directory. The files can be copied to a FAT32 formatted SD card, and inserted in a Pi for testing. If you would like to build a (signed) netboot image there are tools for that at: https://github.com/raspberrypi/usbboot/tree/master/tools

Other notes

Debugging

On Linux and Mac the application will print debug messages to console by default if started from console. On Windows start the application with the command-line option --debug to let it open a console window.

Custom repository

If the application is started with "--repo [your own URL]" it will use a custom image repository. So can simply create another 'start menu shortcut' to the application with that parameter to use the application with your own images.

Telemetry

In order to understand usage of the application (e.g. uptake of Raspberry Pi Imager versions and which images and operating systems are most popular) when using the default image repository, the URL, operating system name and category (if present) of a selected image are sent along with the running version of Raspberry Pi Imager, your operating system, CPU architecture, locale and Raspberry Pi revision (if applicable) to https://rpi-imager-stats.raspberrypi.com by downloadstatstelemetry.cpp.

This web service is hosted by Heroku and only stores an incrementing counter using a Redis Sorted Set for each URL, operating system name and category per day in the eu-west-1 region and does not associate any personal data with those counts. This allows us to query the number of downloads over time and nothing else.

The last 1,500 requests to the service are logged for one week before expiring as this is the minimum log retention period for Heroku.

On Windows, you can opt out of telemetry by disabling it in the Registry:

reg add "HKCU\Software\Raspberry Pi\Imager" /v telemetry /t REG_DWORD /d 0

On Linux, run rpi-imager --disable-telemetry or add the following to ~/.config/Raspberry Pi/Imager.conf:

[General]
telemetry=false

On macOS, disable it by editing the property list for the application:

defaults write org.raspberrypi.Imager.plist telemetry -bool NO

Advanced options

When using the app, press CTRL + SHIFT + X to reveal the Advanced options dialog.

In here, you can specify several things you would otherwise set in the boot configuration files. For example, you can enable SSH, set the Wi-Fi login, and specify your locale settings for the system image.

More Repositories

1

linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
C
11,056
star
2

documentation

The official documentation for Raspberry Pi computers and microcontrollers
Python
5,178
star
3

firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5,133
star
4

pico-sdk

C
3,536
star
5

pico-examples

C
2,763
star
6

noobs

NOOBS (New Out Of Box Software) - An easy Operating System install manager for the Raspberry Pi
Makefile
2,210
star
7

userland

Source code for ARM side libraries for interfacing to Raspberry Pi GPU.
C
2,040
star
8

tools

C
1,876
star
9

rpi-eeprom

Installation scripts and binaries for the Raspberry Pi 4 and Raspberry Pi 5 bootloader EEPROMs
Shell
1,257
star
10

pico-micropython-examples

Examples to accompany the "Raspberry Pi Pico Python SDK" book.
Python
948
star
11

usbboot

Raspberry Pi USB booting code, moved from tools repository
C
897
star
12

picamera2

New libcamera based python library
Python
852
star
13

debugprobe

C
730
star
14

hats

C
658
star
15

pico-tflmicro

Pico TensorFlow Lite Port
C++
619
star
16

picotool

C++
549
star
17

Raspberry-Pi-OS-64bit

Repository for containing issues on the 64 bit operating system (as distinct from the 32 bit one)
466
star
18

pico-extras

C
459
star
19

pico-playground

C
434
star
20

quake3

C
390
star
21

rpicam-apps

C++
383
star
22

maynard

Desktop environment for Wayland
C
336
star
23

piserver

Raspberry Pi Server wizard to serve Raspbian to network booting Pis
C++
311
star
24

pico-project-generator

Tool to automatically generate a Pico C SDK Project
Python
294
star
25

pico-bootrom-rp2040

C
271
star
26

raspiraw

Example app directly receiving raw data from CSI2 sensors
C
257
star
27

pico-setup-windows

PowerShell
252
star
28

libcamera

C++
211
star
29

utils

A collection of scripts and simple applications
C
148
star
30

openocd

C
141
star
31

windows-drivers

Windows IOT drivers
C
120
star
32

pico-bootrom-rp2350

C
120
star
33

cmprovision

Provisioning system for CM4 products
PHP
97
star
34

pico-setup

Shell
92
star
35

scratch

Scratch releases
79
star
36

usbbootgui

GUI for booting a Raspberry Pi device like Pi Zero or compute module as a device
M4
77
star
37

rp2350_hacking_challenge

CMake
70
star
38

tinyusb

C
67
star
39

rpi-sense

Sense HAT firmware and driver
Assembly
66
star
40

usb-pid

Raspberry Pi Pico PID allocations
63
star
41

gpioexpander

Buildroot based ethernet gadget which gives a host access to PIGPIO to control GPIO pins
Makefile
62
star
42

pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
TypeScript
62
star
43

target_fs

Shell
39
star
44

weston

The Weston Wayland Compositor
C
37
star
45

scriptexecutor

Simple buildroot based system for executing a remote script for manufacture programming
Shell
36
star
46

pico-host-sdl

C
27
star
47

pico-feedback

24
star
48

raspberrypi.github.io

Raspberry Pi GitHub organisations
HTML
20
star
49

pytrack

Python
17
star
50

Pi-Codec

Tools for the IQaudIO Pi-Codec / CodecZero sound cards
16
star
51

skygate

Python
15
star
52

style-guide

14
star
53

bookworm-feedback

13
star
54

CMSIS-RP2xxx-DFP

C
13
star
55

armulet

C++
8
star
56

pylibcamera

Meson
8
star
57

libpisp

C++
7
star
58

pico-sdk-tools

Shell
5
star
59

rpi-sb-provisioner

A minimal-input automatic secure boot provisioning system for Raspberry Pi devices.
Shell
5
star
60

pykms

Meson
2
star
61

FreeRTOS-Kernel

C
1
star
62

sweet-b

C
1
star