Created
June 8, 2017 18:54
-
-
Save foone/ab2e860b1c9d029727d096864451a70e to your computer and use it in GitHub Desktop.
Create a floppy image from some files
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 | |
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