I recently spent a little time adding support for isohybrid images to d-i. isohybrid is a tricksy boot sector hack that allows copying a CD image direct to a USB stick and booting it.

I used it in anger for the first time yesterday, and it worked so well compared with the old method of booting d-i from USB sticks that I feel I need to blog about it so others can enjoy the fun..

The documentation on the web site has not caught up yet, but this is already usable with current d-i daily builds. For now only in the netboot mini.iso. That can be written directly to a USB stick or USB disk to make it boot d-i.

cat mini.iso > /dev/sdX

The netboot mini.iso is so named because it's functionally identical to netbooting d-i. Except without the need to set up a tftp server. Besides being a 16mb download that will fit on even your oldest USB stick, another advantage to using the mini.iso is that you don't even need to use a separate USB stick to boot the installer. You can write the mini.iso directly to the same disk that d-i will be installing to! (Particularly handy for installing debian to USB disks.)

(This is also very handy for d-i development and testing, since a mini.iso can be written out to a USB key about as fast as a test machine will post..)

adding firmware

I also arranged for there to be a second partition on the mini.iso. The firmware partition is most easily accessed by unplugging and replugging the drive after writing the mini.iso to it -- then it will show up as /dev/sdX2 (or "Firmware" in a GUI). If you need to add firmware to d-i, you can just mount it and extract the firmware tarball into it. d-i will then automatically find, use, and install the firmware.

isohybrid with other Debian CD images

All this will also work with other larger Debian CD images, but we're not yet building the larger images with isohybrid, due to issues with jidgo. However, you can just run isohybrid yourself (from the syslinux package) on the CD image you download, and if it's got a recent version of d-i on it, d-i will be able to find and use the hybrid CD image after booting.

That doesn't add the firmware partition to the image. If you need to do that, you could use this script.