Skip to content

Instantly share code, notes, and snippets.

@foone
Created June 8, 2017 18:54
Show Gist options
  • Save foone/ab2e860b1c9d029727d096864451a70e to your computer and use it in GitHub Desktop.
Save foone/ab2e860b1c9d029727d096864451a70e to your computer and use it in GitHub Desktop.
Create a floppy image from some files
#!/bin/bash
set -e
set -x
IMGFILE=$1
CONTENTS=$2
TMPIMG=$(mktemp -u -t XXXXXXXXX.img)
mkfs.fat -D 0 -M 0xF0 -C $TMPIMG 1440
mkfs.msdos $TMPIMG
mcopy -i $TMPIMG $CONTENTS ::/
mv $TMPIMG $IMGFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment