{"id":13732440,"url":"https://github.com/gitbls/sdm","last_synced_at":"2026-04-02T12:05:19.034Z","repository":{"id":45487165,"uuid":"260479550","full_name":"gitbls/sdm","owner":"gitbls","description":"Raspberry Pi SD Card Image Manager","archived":false,"fork":false,"pushed_at":"2026-03-24T19:28:34.000Z","size":2103,"stargazers_count":738,"open_issues_count":14,"forks_count":81,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-03-26T00:49:18.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitbls.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-01T14:31:27.000Z","updated_at":"2026-03-24T20:33:42.000Z","dependencies_parsed_at":"2026-01-30T01:10:32.730Z","dependency_job_id":null,"html_url":"https://github.com/gitbls/sdm","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/gitbls/sdm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitbls%2Fsdm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitbls%2Fsdm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitbls%2Fsdm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitbls%2Fsdm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitbls","download_url":"https://codeload.github.com/gitbls/sdm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitbls%2Fsdm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:56.505Z","updated_at":"2026-04-02T12:05:19.026Z","avatar_url":"https://github.com/gitbls.png","language":"Shell","readme":"# sdm\nRaspberry Pi SSD/SD Card Image Manager\n\n## Description\n\n`sdm` provides a quick and easy way to build consistent, ready-to-go SSDs and/or SD cards for the Raspberry Pi. This command line management tool is especially useful if you:\n\n* have multiple Raspberry Pi systems and you want them all to start from an identical and consistent set of installed software packages, configuration scripts and settings, etc.\n\n* want to rebuild your Pi system in a consistent manner with all your favorite packages and customizations already installed. Every time.\n\n* want to be nice to your future self and make it super-easy to build fresh, customized systems when that next release of RasPiOS comes out.\n\n* want to produce disks or IMGs for others without risk of having ANY of your own bits accidentally distributed\n\n* want to do the above repeatedly and a LOT more quickly and easily.\n\nWhat does *ready-to-go* mean? It means that every one of your systems is fully configured with Keyboard mapping, Locale, Timezone, and WiFi set up as you want, all of your personal customizations and all desired RasPiOS packages and updates installed.\n\nIn other words, all ready to work on your next project.\n\nWith `sdm` you'll spend a lot less time rebuilding SSDs/SD Cards, configuring your system, and installing packages, and more time on the things you really want to do with your Pi.\n\nHave questions about sdm? Please don't hesitate to ask in the Issues section of this github. If you don't have a github account (so can't post an issue/question here), please feel free to email me at: [gitbls@outlook.com](mailto:gitbls@outlook.com).\n\nIf you find sdm useful, please consider starring it to help me understand how many people are using it. Thanks!\n\n## Usage overview\n\n### sdm Quick Start\n\nHere's how to quickly and easily to create and customize an IMG file and burn it to an SD Card. It's assumed that there is an SD Card in /dev/sde.\n\n**Throughout this document read \"SD Card\" as \"SSD or SD Card\".** sdm treats them equivalently.\n\n## Install sdm\n\n```sh\ncurl -L https://raw.githubusercontent.com/gitbls/sdm/master/install-sdm | bash\n```\n`install-sdm` installs the sdm files to /usr/local/sdm, and installs other required RasPiOS packages if they are not installed (binfmt-support coreutils gdisk keyboard-configuration parted qemu-user-static rsync systemd-container uuid)\n\n**Or, download the Installer script to examine it before running:**\n```sh\ncurl -L https://raw.githubusercontent.com/gitbls/sdm/master/install-sdm -o /path/to/install-sdm\nchmod 755 /path/to/install-sdm\n# Inspect the install-sdm script if desired\n/path/to/install-sdm\n```\n## Grab an IMG to customize\n\n* **If needed, download** the desired RasPiOS zipped IMG from the raspberrypi.org website and **unxz** it. (IMGs from older releases were zipped)\n* Direct link to the downloads: [Raspberry Pi Downloads](https://downloads.raspberrypi.org//?C=M;O=D)\n* Pick the latest (Trixie) image in the *images* subfolder of **raspios_armhf** (32-bit), **raspios_lite_armhf** (32-bit), **raspios_arm64** (64-bit), or **raspios_lite_arm64** (64-bit), as appropriate. Bookworm images are in the **raspios_oldstable** folders.\n\n## Customize the image with sdm\n\nThe easiest way to get started with sdm customization is to take a copy of `/usr/local/sdm/ezsdm` into your own directory and edit it as desired.\n\nIf you use the default `ezsdm` without modifying it, sdm will make the following changes to your IMG file:\n* Copy your **Localization settings** (Keymap, Locale, Timezone, and WiFi Country) from the system on which it's running (if running on RasPiOS, Debian, or a Debian derivative such as Mint or Ubuntu)\n* Configure the system in the IMG file to have **SSH enabled**\n* Create the user `myuser` with the given password and enable sudo for that user\n* Do an `apt update` and `apt upgrade`\n* Installs a few example apps\n* Configures WiFi for SSID `myssid` and password `mywifipassword`\n* Prevents piwiz and cloudinit from running (neither are needed when using sdm and could cause unexpected behaviors)\n\n## Burn the image onto the SD Card\n```sh\nsudo sdm --burn /dev/sdX --hostname mypi1 --expand-root 2025-10-01-raspios-trixie-arm64.img --plugin sshhostkey:generate-keys\n```\nModify `/dev/sdX` to refer to the disk you want to burn.\n\nUsing the `sshhostkey` plugin regenerates the SSH host keys as part of burning the disk and ensures that the system has higher entropy than during a system boot.\n\n## Boot and Go\n\nLoad the SD card into a Pi and power it up. The system will come up as it always does:\n\n* **WILL NOT:** Resize the root file system and restarts automatically, thanks to the use of `--expand-root`, which expands the root file system on the SD Card after the burn completes.\n* After the system starts it goes through a complete system startup, just as it always does on a fresh SD Card\n* Toward the end of the boot process the sdm FirstBoot service runs (once). It takes other actions as needed to fulfill the requested configuration.\n* When the system boot is fully complete, the system automatically restarts again\n\nWhen the system comes back up your Pi is all happy, ready to go, and configured with:\n\n* **The latest RasPiOS updates installed** for all installed packages\n* **User created** and password set for username and password of your choice and sudo enabled\n* **Hostname** set to *mypi1*, or whatever you choose to use as the hostname\n* **Keymap**, **Locale**, and **Timezone** configured the same as the system on which you are running sdm (easily changeable, of course)\n* **SSH** enabled\n\nYou can review the output of the sdm first boot script on the newly-booted system with:\n```sh\njournalctl -b -1 | grep FirstBoot\n```\n\nNOTE: Sometime late in Bookworm the default retention of the system journal changed from keeping them all to removing them on shutdown. If you want to retain all system journals, uncomment or add `system:journal=persistent` to your personal `ezsdm` script.\n\n## Next steps\n\nIf you want to adopt sdm into your RasPiOS management tools, a great way to get started is to use the \u003ca href=\"Docs/Example-Commands.md#official-getting-started-with-sdm-script\"\u003eOfficial Getting Started With sdm script\u003c/a\u003e to quickly and easily learn how to customize an IMG.\n\nThe most important new user docs are: \u003ca href=\"Docs/Command-Details.md\"\u003eCommand Details\u003c/a\u003e and \u003ca href=\"Docs/Plugins.md\"\u003ePlugins\u003c/a\u003e.\n\n## What else can sdm do?\n\nHere are a few examples:\n\n* **Install applications**  \u0026mdash; Editors (emacs, vim, zile, etc), and any other packages (browsers, etc) you always install in a new system. Direct sdm to install apps using the `apps` plugin. See \u003ca href=\"Docs/Plugins.md#apps\"\u003ethe apps plugin\u003c/a\u003e for details.\n\n* **Install and configure VNC** \u0026mdash; Have every system or only selected systems come up with VNC installed and configured, using either RealVNC on the console, or TightVNC or TigerVNC virtual desktops. Or a combination of RealVNC on the console AND virtual desktops. See \u003ca href=\"Docs/Plugins.md#vnc\"\u003ethe VNC plugin\u003c/a\u003e.\n\n* **Install and configure a WiFi Access Point (hotspot)** \u0026mdash; Install a customizable, fully operational WiFi hotspot in any of three modes: *local*, *routed*, or *bridged*.\n\n* **Install and configure a USB hotspot** \u0026mdash; Enable the Pi to provide USB-tethered network connections via USB to another computer\n\n* **Install and configure USB gadget mode** \u0026mdash; Enable the Pi to access networking via USB tethering from a host computer\n\n* **Enable Pi-specific devices** \u0026mdash; Easily enable camera, i2c, etc, via raspi-config automation. See \u003ca href=\"Docs/Plugins.md#raspiconfig\"\u003eraspiconfig plugin \u003c/a\u003e.\n\n* **Personal customizations** \u0026mdash; Have every system come up running with your own customizations such as your favorite .bashrc and any other files that you always want on your system. This can be done easily using \u003ca href=\"Docs/Plugins.md#copyfile\"\u003ethe `copyfile` plugin\u003c/a\u003e or with a personal Plugin. See \u003ca href=\"Docs/Example-Plugin.md\"\u003emy personal plugin\u003c/a\u003e for an example.\n\n* **Append Custom fstab file to /etc/fstab** \u0026mdash; Automatically append your site-specific fstab entries to /etc/fstab. See \u003ca href=\"Docs/Plugins.md#system\"\u003esystem plugin for details\u003c/a\u003e.\n\n* **systemd service configuration and management** \u0026mdash; If there are services that you always enable or disable, you can easily configure them with sdm. See the description of the `service-disable` and `service-enable` arguments to \u003ca href=\"Docs/Plugins.md#system\"\u003ethe system plugin\u003c/a\u003e.\n\n* **Other customizations** \u0026mdash; Done through a simple batch script called a \u003ca href=\"Docs/Plugins.md\"\u003ePlugin\u003c/a\u003e. sdm-plugin-example is a skeleton Plugin that you can copy, modify, and use. See \u003ca href=\"Docs/Programming-Plugins-and-Custom-Phase-Scripts.md\"\u003eProgramming Plugins\u003c/a\u003e.\n\n* **Automatic disk encryption** \u0026mdash; Make your system more secure with an encrypted root file system and/or additional data partitions and using only a few commands.\n\n* **Burn SD Card Image for network distribution** \u0026mdash; You can also burn a customized SD Card Image to distribute via a mechanism other than an actual SD Card, such as the Internet.\n\n    The recipient can burn the SD Card using any one of a number of tools on Linux ([Installing Operating System Images](https://www.raspberrypi.org/documentation/installation/installing-images/)), Windows ([Installing Operating System Images Using Windows](https://www.raspberrypi.org/documentation/installation/installing-images/windows.md)), or MacOS ([Installing Operating System Images Using MacOS](https://www.raspberrypi.org/documentation/installation/installing-images/mac.md)).\n\n* **Choose from a wide selection of sdm plugins** \u0026mdash; sdm Plugins are \u003ca href=\"Docs/Plugins.md\"\u003efully documented\u003c/a\u003e and provide a broad set of functionality including: copy files into the IMG, install IPSEC or Wireguard VPNs, configure SSH host and user keys, install PiApps, etc.\n\n* **Update an already-burned RasPiOS SD Card or SSD** \u0026mdash; use the `--explore` command switch to nspawn into the SD Card or SSD. While in the nspawn you can take care of system management activities in a near-online manner, such as changing the password for an account, installing additional packages, etc.\n\n    This can be VERY handy if you forget the password to your user account on your favorite SD Card, for instance. You can boot up a second SD Card, install sdm on it, and then use `sdm --explore` to update the account password on that favorite SD Card.\n\n## Complete sdm Documentation\n\nNeed more details? You'll find complete details about sdm in the \u003ca href=\"Docs/Index.md\"\u003eonline documentation\u003c/a\u003e and plugin-specific documentation \u003ca href=\"Docs/Plugins.md\"\u003ehere.\u003c/a\u003e\n\nYou can watch sdm in action \u003ca href=\"https://youtu.be/f8SXAnBAuJk\"\u003ehere\u003c/a\u003e It will give you a good idea of how sdm works and what you can do with it.\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/gitbls/sdm)\n","funding_links":[],"categories":["Shell","Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbls%2Fsdm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitbls%2Fsdm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitbls%2Fsdm/lists"}