Amazon EC2: Building a Self-bundling Debian AMI

"Given the regular questions appearing on the forum about using Debian/Ubuntu with EC2 I thought it might be a useful exercise to post a complete HOWTO should people wish to roll their own AMI rather than use my public one. I suspect that these instructions will work for Ubuntu as well although I've not actually tested this.

To start with we need to construct a simple Debian installation on a host machine."