Use sdm to Fully Configure Your Raspberry Pi OS Earlier than You Set up

Raspberry Pi OS is a Debian-derived working system designed to assist rookies and specialists to get essentially the most out of the Raspberry Pi {hardware}, whereas providing an easy-to-use desktop expertise. Though you are able to do some primary customization earlier than inserting your storage media into the Pi for the primary time, through the use of the official Raspberry Pi Imager device, chances are you’ll want that you might do extra. With sdm, an SD card administration device, you may. This is find out how to do it.

Why Use sdm to Create Custom-made Disk Photos for Your Raspberry Pi?

Raspberry Pis are low-cost (when you will discover them) single-board computer systems with top-notch elements and an emphasis on studying and DIY software program and electronics tasks. They’re excellent for varsity laptop labs and for deploying as standalone servers.

Should you’re deploying a number of Raspberry Pi computer systems in a faculty or different organizations, you will discover that after flashing a Raspberry Pi OS picture to an SD card or SSD, you find yourself putting in the identical set of software program packag over and over. You will arrange the identical providers, mount the identical further drives, and add the identical aliases to the .bashrc file. It will probably turn out to be very tedious, in a short time.

See also  7 Issues That May Make You Select a Raspberry Pi Various

sdm is a device which makes it straightforward to construct constant, ready-to-go storage media for the Raspberry Pi, containing the software program you want and the configuration you select.

How you can Set up and Use sdm

sdm installs on Linux through a script which you curl from its GitHub repository and pip to Bash:

 curl -L https: 

Additionally, you will want a vanilla Raspberry Pi OS picture to work from. Seize essentially the most present ARM 64 Bullseye picture from the official Raspberry Pi downloads listing.

Raspberry Pi disk pictures come compressed as XZ archives. Extract the picture with:

 unxz /path/to/your/picture.img.xz 

Now you are prepared to start out customizing your Raspberry Pi OS picture. Not like the official Raspberry Pi Imager device, sdm does not provide a pleasant GUI possibility, so you will be spending quite a lot of time within the terminal. The very first thing you need to do is ensure sdm is ready to mount the ISO and begin a chroot:

 sudo sdm --explore your_rasperry_pi_image.img 
sdm explore chroot with a gray terminal background, and blue font color

If profitable, sdm will begin a chroot, and alter your terminal background to grey, the terminal font colour to blue, and the cursor to purple. It isn’t very straightforward on the attention, however it’s a reminder that you simply’re exploring the ISO in a chroot, somewhat than in your host system.

As soon as you’ve got had a go searching, exit the chroot with:


Your flotilla of Pis might want to connect with the community. This simplest way to do that is to create a brand new wpa_supplicant.conf file in your working listing.

 nano wpa_supplicant.conf 

In it, paste the next, ensuring to substitute your individual community and nation particulars into the related fields:


Save and exit nano with Ctrl + O then Ctrl + X.

Should you plan to pre-install a number of further packages in your Raspberry Pi ISO, chances are you’ll need to prolong the picture to offer your self more room. You need to use the prolong swap for this.

 sudo sdm --extend --xmb 2048 2022-09-22-raspios-bullseye-arm64.img.xz 

…gives you an additional 2GB to play with. You’ll be able to regulate this determine to your individual necessities.

Having apps already put in and accessible for the tip consumer is actually the purpose of sdm. You’ll be able to handle what apps shall be pre-installed on the ISO with the customise swap, and a textual content file itemizing the apps you need to set up.

 nano applist 

On this file, sort out the names of all of the apps you need to out there on first boot. These can both be house separated names, or one per line. As an example:

 irssi mypaint qmmp conky openvpn 

Should you’re wanting inspiration, take a look at our glorious curated record of nice apps to put in on Raspberry Pi. Whenever you’re completely happy, save and exit nano with Ctrl + O then Ctrl + X.

Committing Your Customization to the Raspberry Pi ISO

The following command will copy your keymap, locale, timezone, and Wi-Fi nation settings from the system on which it is working; copy the wpa_supplicant.conf file you simply configured; allow SSH on the Pi; immediate for a brand new password; and replace and improve the system.

 sudo sdm  

Appending it with:


…will set up the apps you laid out in your applist file.

sdm customize transferring locale and wpa_supplicant ro raspi OS ISO

This course of can take a number of minutes, however will maintain you knowledgeable of progress all through.

Earlier than you run the command, there are further switches you should use to configure the ISO additional. Listed below are among the most helpful:

  • password-pi password units the password for the pi consumer
  • password-root password units the password for root
  • autologin mechanically logs within the consumer
  • cron-d some-cron-file copies a cron file to /and many others/cron.d
  • hostname permits you to set a system hostname
  • motd permits you to copy a specified file to /and many others/motd to set a customized message
  • swap n units the system swap measurement
  • consumer username creates customers

Burn Your Customized Raspberry Pi ISO to SD Card or SSD

sdm makes use of dd to “burn” your customized Raspberry Pi ISO to your storage medium of selection. Use the burn swap to invoke it:

 sudo sdm  

…the place sdx is your SD card or SSD. Should you’re unsure which drive is your storage medium, run:

 sudo fdisk-l 

…to get an inventory of units.

When the method has completed, connect the system to your Pi, and boot your customized ISO!

Making a Custom-made Raspberry Pi ISO Is Straightforward With sdm

Now that you’ve got created a customized Raspberry Pi OS ISO, crafted to your individual specs, putting in your excellent picture on a number of machines is as straightforward as Pi, and the chances are countless. Should you’ve found that OS customization is enjoyable and productive, chances are you’ll need to attempt your hand at creating custom-made spins to your favourite Ubuntu distro too.