Skip to content

Instantly share code, notes, and snippets.

@kshimo69
Created August 30, 2009 13:36
Show Gist options
  • Save kshimo69/177965 to your computer and use it in GitHub Desktop.
Save kshimo69/177965 to your computer and use it in GitHub Desktop.
#!/bin/sh
FDIMAGE="tool.img"
if [ $# -lt 1 ]; then
echo "usage: `basename $0` FileName [FileName ...]"
echo " ex.) `basename $0` ks.cfg auto.cfg"
exit 1
fi
dd if=/dev/zero of="$FDIMAGE" bs=1440k count=1 >/dev/null 2>&1
if [ ! -d /mnt/fd ]; then
mkdir /mnt/fd
fi
/sbin/mkfs -t ext2 -F "$FDIMAGE"
mount -o loop -t ext2 "$FDIMAGE" /mnt/fd
cp $* /mnt/fd/
rm -rf /mnt/fd/lost+found
umount /mnt/fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment