Created
December 15, 2020 16:10
-
-
Save kbingham/f7d08077e8aa5d9f307b7546e2da4e1e to your computer and use it in GitHub Desktop.
SD Card writer (can also write USB sticks)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Usage sd-card-writer image <target> | |
IMAGE=$1 | |
TARGET=${2:-/dev/mmcblk0} | |
if [ ! -b $TARGET ] ; then | |
echo "$TARGET is not a block device" | |
exit | |
fi | |
set -x | |
dd \ | |
if=$IMAGE \ | |
of=$TARGET \ | |
bs=4M \ | |
status=progress \ | |
conv=sparse \ | |
oflag=sync | |
sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment