Raspberry Pi Details Custom Image Support in Imager 2.0, Fixes a Nasty Storage Corruption Bug

Linux and macOS users should upgrade to 2.0.2 in order to prevent their SD cards and other storage devices getting corrupted during erasure.

Gareth Halfacree
2 days agoHW101

Raspberry Pi has released a guide to adding custom operating system images to its Imager 2.0 software — while also publishing an update for a bug that was causing storage erasure operations to fail on Linux and macOS systems.

"With the release of Raspberry Pi Imager 2.0, a number of improvements have been made to the user interface, the imaging process, and internal configuration handling," Raspberry Pi's Paul Oberosler explains. "One of the more interesting changes is the updated JSON schema used to define available OS images. This update is particularly relevant to the introduction of cloud-init support in Raspberry Pi OS, including a new cc_raspberry_pi module that enables configuration features like enabling SPI automatically."

Raspberry Pi Imager is designed to download and flash, or just flash if you have local copies already, operating system images onto storage devices for use with the Raspberry Pi family of single-board computers and Raspberry Pi Compute Module family of computers-on-modules. Its recent 2.0 release brought with it a wealth of new features and improvements, but also changed how you can add your own custom images to the menu — with Oberosler's guide designed to walk you through how it's now achieved, and how you can even submit images for inclusion in the official repository.

"If you're maintaining a high-quality image and would like it to appear alongside official images in Raspberry Pi Imager (under one of the community categories), you can submit it for review," Oberosler explains. "Our team will review your submission, verify its compatibility, and get in touch if any adjustments are needed. Once approved, your image can be distributed to thousands of Raspberry Pi Imager users worldwide through our main repository infrastructure."

Raspberry Pi Imager itself, meanwhile, has received a quiet update to version 2.0.2 — addressing a bug that was causing storage devices to be "bricked" when an erasure operation was carried out, separate to a flash operation. "I've tracked down a likely cause, where the erase path would ask the OS for the size of the device," Raspberry Pi software engineer Tom Dewey explains of the bug, which presents itself as storage devices either disappearing from the hardware list altogether or appearing with a tiny sub-gigabyte capacity.

"On Windows, there was a robust fall-back path, but on macOS and Linux the mechanism was less robust, and could return an invalid device size — which would then be written to the MBR [Master Boot Record] of the card. This wouldn't have manifested on the more typical download-and-flash path, as the error handling is more involved on that path."

Oberosler's full guide is available on the Raspberry Pi blog, while Raspberry Pi Imager 2.0.2 with the corruption bug fixed is available on GitHub — but, at the time of writing, had not yet replaced the buggy 2.0.0 on the Raspberry Pi downloads page.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles