Nice build!
Enough people have asked this that I knocked together a little script in Python that should come in handy for this, it's attached to this post (along with a handful of icon files you can use with it). You'll need Python 3.x to run it - if you're on Mac OS or Linux, it is probably installed already. If you're on Windows, you can download it from
python.org.
Its usage should be straightforward:
python3 makeimg.py <image> <part1> <icon1> [<part2> <icon2> [<part3> <icon3> [<part4> <icon4>]]]
- Replace <image> with the filename of the image file you want to create.
- Replace <part> with one of the following:
- the filename of a disk image (a plain .dsk file such as might be used with miniVMac or Basilisk II - Disk Copy 4.2 images are NOT supported)
- a size (such as 20M, 100M, 1G) to create a blank partition
- Replace <icon> with one of the following:
- the filename of an icon file (native Mac format only - it must be 256 bytes in length, a 32x32 monochrome icon followed by its mask)
-
to use the default icon
You can specify up to four part/icon pairs.
Examples:
python3 makeimg.py sdcard.img mydisk.dsk icons/steve.icon
Make sdcard.img using mydisk.dsk as the first and only partition, and give it an icon of Steve Jobs.
python3 makeimg.py sdcard.img system.dsk icons/steve.icon 20M icons/hobbes.icon
Make sdcard.img using system.dsk for the first partition with an icon of Steve Jobs, and a second blank 20 MB partition with an icon of Hobbes.
python3 makeimg.py sdcard.img system.dsk - 20M -
Same as above, but use the default icon.
Sorry, no tool to convert more familiar graphic file formats to icon files as of yet. You can create these in ResEdit with the Forker extension by creating an ICN# resource, opening it in the hex editor, and copying its contents to the data fork of a new file.
I tested it a bit, but I can't guarantee total lack of bugs - let me know your experiences using it.