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.
The script referenced in the last line of the post is no longer where it used to be, due to d-i's svn->git migration. Having chased down the new link, I thought I'd comment it here:
http://git.debian.org/?p=d-i/debian-installer.git;a=blob;f=build/util/geniso_hybrid_plus_firmware_partition
The combination of cat-ing mini.iso to a USB stick, booting it and then installing Debian to the same device is briliiant. Except GRUB refuses to co-operate, complaining it has detected an iso 9660 filesystem and refusing to have anything to do with it.
dd if=/dev/zero of=/dev/sdX bs=512 count=2000
prior to partitoning was my way of getting on GRUB's good side.
I don't know whether d-i should or could handle this but some documentation wouldn't go amiss. Now, would it be debian-boot or debian-doc I should raise this in?