--- cloud-init-0.5.10.orig/cloud-init.py
+++ cloud-init-0.5.10/cloud-init.py
@@ -21,11 +21,24 @@
 
 import cloudinit
 import cloudinit.util as util
+import time
 
 def warn(str):
     sys.stderr.write(str)
 
 def main():
+    now = time.strftime("%a, %d %b %Y %H:%M:%S %z")
+    try:
+       uptimef=open("/proc/uptime")
+       uptime=uptimef.read().split(" ")[0]
+       uptimef.close()
+    except IOError as e:
+       warn("unable to open /proc/uptime\n")
+       uptime = "na"
+
+    sys.stderr.write("cloud-init running: %s. up %s seconds\n" % (now, uptime))
+    sys.stderr.flush()
+
     # cache is not instance specific, so it has to be purged
     cloudinit.purge_cache()
 
@@ -35,7 +48,7 @@
         cloud.get_data_source()
     except Exception as e:
         print e
-        sys.stderr.write("Failed to get instance data")
+        sys.stderr.write("Failed to get instance data\n")
         sys.exit(1)
 
     # store the metadata
--- cloud-init-0.5.10.orig/debian/pycompat
+++ cloud-init-0.5.10/debian/pycompat
@@ -0,0 +1 @@
+2
--- cloud-init-0.5.10.orig/debian/copyright
+++ cloud-init-0.5.10/debian/copyright
@@ -0,0 +1,51 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Name: cloud-init
+Maintainer: Scott Moser <scott.moser@canonical.com>
+Source: https://launchpad.net/cloud-init
+
+This package was debianized by Soren Hansen <soren@ubuntu.com> on
+Thu, 04 Sep 2008 12:49:15 +0200 as ec2-init.  It was later renamed to
+cloud-utils by Scott Moser <scott.moser@canonical.com>
+
+Upstream Author: Scott Moser <smoser@canonical.com>
+    Soren Hansen <soren@canonical.com>
+    Chuck Short <chuck.short@canonical.com>
+
+Copyright: 2010, Canonical Ltd. 
+License: GPL-3
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 3, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+ The complete text of the GPL version 3 can be seen in
+ /usr/share/common-licenses/GPL-3.
+
+Files: cloudinit/boto_utils.py
+Copyright: 2006,2007, Mitch Garnaat http://garnaat.org/
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish, dis-
+ tribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the fol-
+ lowing conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+ SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
--- cloud-init-0.5.10.orig/debian/cloud-init.prerm
+++ cloud-init-0.5.10/debian/cloud-init.prerm
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+rm -f /etc/cron.d/cloudinit-updates
+
+#DEBHELPER#
--- cloud-init-0.5.10.orig/debian/dirs
+++ cloud-init-0.5.10/debian/dirs
@@ -0,0 +1,5 @@
+var/lib/cloud
+usr/bin
+etc/init
+usr/share/doc/cloud
+etc/cloud
--- cloud-init-0.5.10.orig/debian/cloud-init.preinst
+++ cloud-init-0.5.10/debian/cloud-init.preinst
@@ -0,0 +1,61 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+# Remove a no-longer used conffile
+rm_conffile() {
+	local PKGNAME="$1"
+	local CONFFILE="$2"
+
+	[ -e "$CONFFILE" ] || return 0
+
+	local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+	local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+			sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+	if [ "$md5sum" != "$old_md5sum" ]; then
+		echo "Obsolete conffile $CONFFILE has been modified by you."
+		echo "Saving as $CONFFILE.dpkg-bak ..."
+		mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+	else
+		echo "Removing obsolete conffile $CONFFILE ..."
+		rm -f "$CONFFILE"
+	fi
+}
+
+fix_ephemeral0_micro() {
+   # make ephemeral0 entries in /etc/fstab written by cloudconfig
+   # 'nobootwait', so they do not block subsequent boots (LP: #634102)
+   local out="" oldver=$1 dev="" adop="nobootwait"
+   local s="[[:space:]]" ns="[^[:space:]]" # space and "not space"
+   local remain="${s}\+.*" first4=""
+   for dev in /dev/sda2 /dev/sdb; do
+      first4="${dev}$s\+$ns\+$s\+$ns\+$s\+$ns\+"
+      out=$(awk '$1 == dev && $4 ~ /cloudconfig/ &&  $4 !~ op { print $1 ; }' \
+         dev="${dev}" "op=${adop}" /etc/fstab) || return 0
+      [ -n "${out}" ] || continue
+      echo "making ephemeral ${dev} in /etc/fstab ${adop} (LP: #634102)" 1>&2
+      sed -i "s|^\(${first4}\)\(${remain}\)|\1,${adop}\2|" /etc/fstab
+   done
+}
+
+case "$1" in
+	install|upgrade)
+		# removing obsolete conffiles from the 'ec2-init' package
+		if dpkg --compare-versions "$2" le "0.5.1"; then
+			rm_conffile ec2-init "/etc/init/cloud-ssh-keygen.conf"
+		fi
+		if dpkg --compare-versions "$2" lt "0.5.3"; then
+			rm_conffile ec2-init "/etc/init/ec2init.conf"
+		fi
+      if [ "$2" = "0.5.7-0ubuntu1" ]; then
+         bad_d=/etc/update-motd.d/92-ec2-upgrade-available
+         rm_conffile cloud-init "${bad_d}/motd-hook"
+         # the dir for this file is almost certainly empty, but
+         # if the file above was only moved, or other files there
+         # then leave it be
+         rmdir "${bad_d}" 2>/dev/null || true
+      fi
+      if dpkg --compare-versions "$2" le "0.5.10-0ubuntu1.2"; then
+         fix_ephemeral0_micro
+      fi
+esac
--- cloud-init-0.5.10.orig/debian/control
+++ cloud-init-0.5.10/debian/control
@@ -0,0 +1,25 @@
+Source: cloud-init
+Section: admin
+Priority: extra
+Maintainer: Scott Moser <smoser@ubuntu.com>
+Build-Depends: cdbs, debhelper (>= 5.0.38), python, python-central (>= 0.5.6)
+XS-Python-Version: all
+Standards-Version: 3.8.4
+
+Package: cloud-init
+Architecture: all
+Depends: python, procps, python-configobj, python-cheetah, update-motd, python-yaml, python-software-properties, cloud-utils, ${python:Depends}, ${misc:Depends}
+Recommends: ssh-import
+Provides: ec2-init
+Replaces: ec2-init (<<0.5.3)
+Conflicts: ec2-init (<<0.5.3)
+XB-Python-Version: ${python:Versions}
+Description: Init scripts for cloud instances
+ Cloud instances need special scripts to run during initialisation
+ to retrieve and install ssh keys and to let the user run various scripts.
+
+Package: ec2-init
+Depends: ${misc:Depends}, cloud-init
+Architecture: all
+Description: package renamed -> cloud-init
+ This package has been renamed to 'cloud-init'.
--- cloud-init-0.5.10.orig/debian/cloud-init.postinst
+++ cloud-init-0.5.10/debian/cloud-init.postinst
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+   # disable ureadahead (LP: #499520)
+   dpkg-divert --package cloud-init --rename --divert \
+      /etc/init/ureadahead.conf.disabled --add /etc/init/ureadahead.conf
+fi
+
+#DEBHELPER#
--- cloud-init-0.5.10.orig/debian/cloud-init.install
+++ cloud-init-0.5.10/debian/cloud-init.install
@@ -0,0 +1,7 @@
+etc/cloud
+etc/init/*.conf
+etc/update-motd.d/*
+usr/bin
+usr/lib/python*/*-packages/cloudinit
+usr/lib/python*/*-packages/*egg-info
+usr/share/doc/cloud-init
--- cloud-init-0.5.10.orig/debian/changelog
+++ cloud-init-0.5.10/debian/changelog
@@ -0,0 +1,501 @@
+cloud-init (0.5.10-0ubuntu1.3) lucid-proposed; urgency=low
+
+  * fix hang on reboot of ec2's t1.micro (LP: #634102)
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 09 Sep 2010 12:53:32 -0400
+
+cloud-init (0.5.10-0ubuntu1.2) lucid-proposed; urgency=low
+
+  * add support for setting debconf selections (LP: #582667)
+  * force runcmd scripts to run after cloud-init/cloud-config
+    scripts are finished (LP: #613309)
+
+ -- Scott Moser <smoser@ubuntu.com>  Tue, 17 Aug 2010 08:45:39 -0400
+
+cloud-init (0.5.10-0ubuntu1.1) lucid-proposed; urgency=low
+
+  * wait considerably longer (1050 seconds) for metadata service to come up
+    (LP: #571271)
+
+ -- Scott Moser <smoser@ubuntu.com>  Wed, 05 May 2010 10:52:12 -0400
+
+cloud-init (0.5.10-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * ec2-get-info: fix for python traceback
+  * ephemeral mount will show up in /etc/mtab or df on first boot
+    LP: #527825
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 26 Mar 2010 00:57:28 -0400
+
+cloud-init (0.5.9-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * rename apt list files. 'ubuntu-bug' now works without update (LP: #513060)
+  * replace 'cloudconfig' entries in fstab rather than appending (LP: #524562)
+  * fix to fstab writing on ebs-root instances
+
+ -- Scott Moser <smoser@ubuntu.com>  Mon, 08 Mar 2010 13:07:02 -0500
+
+cloud-init (0.5.8-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * cache data from metadata service, LP: #527364
+  * fix format of cron entry in cron.d/cloudinit-updates
+  * package egg-info file
+
+ -- Scott Moser <smoser@ubuntu.com>  Tue, 02 Mar 2010 15:48:04 -0500
+
+cloud-init (0.5.7-0ubuntu4) lucid; urgency=low
+
+  * fix empty package previous package was emptpy for cloud-init
+    due to adding the ec2-init package
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 26 Feb 2010 17:06:05 -0500
+
+cloud-init (0.5.7-0ubuntu3) lucid; urgency=low
+
+  * debian/control:
+    - recommend ssh-import, such that the ssh-import-lp-id
+      utility is available in UEC images for convenient importing of
+      ssh public keys stored in Launchpad, LP: #524101
+    - build a transitional ec2-init package to handle the rename
+      gracefully on upgrades, LP: #527187
+
+ -- Dustin Kirkland <kirkland@ubuntu.com>  Thu, 25 Feb 2010 16:22:10 -0600
+
+cloud-init (0.5.7-0ubuntu2) lucid; urgency=low
+
+  * fix packaging but that put the message-of-the-day hook file
+    into a subdir of etc/update-motd.d, remove old file (LP: #524999)
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 19 Feb 2010 21:02:10 -0500
+
+cloud-init (0.5.7-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * run cloud-init early in boot process (LP: #504883, #524516)
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 19 Feb 2010 18:27:45 -0500
+
+cloud-init (0.5.6-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * supports 'runcmd' in cloud-config
+  * enable the update check code (LP: #524258)
+  * fix retry_url in boto_utils.py when metadata service not around
+    (LP: #523832)
+  * run cloud-config-puppet.conf later (LP: #523625)
+  [ Scott Moser 0.5.5 ]
+  * New upstream release, supports checking for updates
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 19 Feb 2010 03:13:22 -0500
+
+cloud-init (0.5.4-0ubuntu1) lucid; urgency=low
+
+  * New upstream release.
+  * fix broken user-data scripts
+  * merge mathiaz work for cloud-config-puppet
+  * fix bug causing apt update to fail
+  * rename EC2Init class to CloudInit
+  * only set hostname once per instance. (LP: #514492)
+
+ -- Scott Moser <smoser@ubuntu.com>  Wed, 17 Feb 2010 09:40:30 -0500
+
+cloud-init (0.5.3-0ubuntu2) lucid; urgency=low
+
+  * divert ureadahead.conf in postinst (LP: #499520)
+  * lintian cleanups
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 05 Feb 2010 15:48:21 -0500
+
+cloud-init (0.5.3-0ubuntu1) lucid; urgency=low
+
+  * Rename ec2-init to cloud-init.  New upstream release.
+  * set hostname to ip-u.x.y.z if local-hostname provides a ip addr
+    (LP: #475354)
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 04 Feb 2010 03:00:05 -0500
+
+ec2-init (0.5.2-0ubuntu1) lucid; urgency=low
+
+  * new upstream release
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 29 Jan 2010 13:30:52 -0500
+
+ec2-init (0.5.1-0ubuntu1) lucid; urgency=low
+
+  * new upstream release
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 22 Jan 2010 16:19:30 -0500
+
+ec2-init (0.5.0-0ubuntu4) lucid; urgency=low
+
+  * add an upstart job to get ssh keys regenerated and written
+    to console (LP: #506599, LP: #507070)
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 14 Jan 2010 13:10:55 -0500
+
+ec2-init (0.5.0-0ubuntu3) lucid; urgency=low
+
+  * work around difference in uec/ec2 metadata service (LP:506332)
+
+ -- Scott Moser <smoser@ubuntu.com>  Tue, 12 Jan 2010 11:33:11 -0500
+
+ec2-init (0.5.0-0ubuntu2) lucid; urgency=low
+
+  * pull changes from devel branch to get functional on ec2
+
+ -- Scott Moser <smoser@ubuntu.com>  Mon, 11 Jan 2010 12:03:45 -0500
+
+ec2-init (0.5.0-0ubuntu2) lucid; urgency=low
+
+  * new upstream release
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 07 Jan 2010 22:00:38 -0500
+
+ec2-init (0.4.999-0ubuntu8) lucid; urgency=low
+
+  * fix mirror selection for us-west-1 (LP: #494185)
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 11 Dec 2009 15:12:19 -0500
+
+ec2-init (0.4.999-0ubuntu7) karmic; urgency=low
+
+  * work around differences in eucalyptus ephemeral mounts (LP: #458850)
+  * get 'ec2:' prefix on ssh public key fingerprint (LP: #458576)
+
+ -- Scott Moser <smoser@ubuntu.com>  Mon, 26 Oct 2009 16:18:06 -0400
+
+ec2-init (0.4.999-0ubuntu6) karmic; urgency=low
+
+  * make sources.list components for 'karmic-security' the same as
+    'karmic' and 'karmic-updates' (main, restricted) (LP: #457866)
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 22 Oct 2009 08:55:58 -0400
+
+ec2-init (0.4.999-0ubuntu5) karmic; urgency=low
+
+  * write regenerate_ssh_host_keys output directly to /dev/console
+    to ensure that it gets there. (LP: #451881)
+
+ -- Scott Moser <smoser@ubuntu.com>  Wed, 21 Oct 2009 17:23:38 -0400
+
+ec2-init (0.4.999-0ubuntu4) karmic; urgency=low
+
+  * set locale to en_US.UTF-8 if get_location_from_availability_zone 
+    doesn't have a match (LP: #407949)
+
+ -- Scott Moser <smoser@ubuntu.com>  Tue, 20 Oct 2009 09:57:49 -0400
+
+ec2-init (0.4.999-0ubuntu3) karmic; urgency=low
+
+  * split running of user-data out of ec2-init into ec2-init-user-data
+    run this at S99. (LP : #431255)
+
+ -- Scott Moser <smoser@ubuntu.com>  Fri, 25 Sep 2009 14:17:17 -0400
+
+ec2-init (0.4.999-0ubuntu2) karmic; urgency=low
+
+  * remove rightscale-init from package (see LP: #434181, LP: #434693)
+  * fix lintian warning, specify path to GPL-3
+  * replace multiple '| logger' in regenerate_ssh_host_keys single one
+  * add ec2-is-compat-env, and disable init script by default.  it can be
+    enabled by setting 'compat=1' in /etc/ec2-init/is-compat-env
+
+ -- Scott Moser <smoser@ubuntu.com>  Thu, 24 Sep 2009 16:32:42 -0400
+
+ec2-init (0.4.999-0ubuntu1) karmic; urgency=low
+
+  * New upstream release
+
+ -- Soren Hansen <soren@ubuntu.com>  Wed, 26 Aug 2009 01:23:52 +0200
+
+ec2-init (0.4.99-0ubuntu3) karmic; urgency=low
+
+  * Also update /etc/default/locale when setting the locale based on
+    locality.
+
+ -- Soren Hansen <soren@ubuntu.com>  Tue, 11 Aug 2009 21:49:33 +0200
+
+ec2-init (0.4.99-0ubuntu2) karmic; urgency=low
+
+  * Consolidate build-dependencies a bit.
+  * Sync default configuration with code.
+  * Create /var/lib/ec2 in package.
+  * Make ec2-get-info more robust in testing environments.
+  * Handle missing public keys more gracefully.
+  * Set proper ownership of user's authorized_keys.
+
+ -- Soren Hansen <soren@ubuntu.com>  Tue, 11 Aug 2009 09:54:16 +0200
+
+ec2-init (0.4.99-0ubuntu1) karmic; urgency=low
+
+  * Massive rewrite. (LP: #407871, #407919, #308530, #407949, #407950, #407892
+    and probably many others)
+  * First Ubuntu version with the upstream tarball split out.
+  * Switch to arch: all. There is no arch specific code here.
+
+ -- Soren Hansen <soren@ubuntu.com>  Tue, 11 Aug 2009 08:33:33 +0200
+
+ec2-init (0.3.4ubuntu9) karmic; urgency=low
+
+  * Really include the action id in the semaphore filename.
+
+ -- Soren Hansen <soren@ubuntu.com>  Sat, 11 Jul 2009 09:50:31 +0200
+
+ec2-init (0.3.4ubuntu8) karmic; urgency=low
+
+  * Add Vcs-Bzr header to debian/control.
+  * Include the action id in the semaphore filename.
+
+ -- Soren Hansen <soren@ubuntu.com>  Sat, 11 Jul 2009 02:35:43 +0200
+
+ec2-init (0.3.4ubuntu7) karmic; urgency=low
+
+  * Re-add accidentally removed locale template.
+  * Fix indentation in init script.
+
+ -- Soren Hansen <soren@ubuntu.com>  Fri, 10 Jul 2009 23:47:27 +0200
+
+ec2-init (0.3.4ubuntu6) karmic; urgency=low
+
+  * Replace calls to ec2-get-data with calls to ec2-get-info.
+  * Make this package arch: all.
+
+ -- Soren Hansen <soren@ubuntu.com>  Fri, 10 Jul 2009 23:16:35 +0200
+
+ec2-init (0.3.4ubuntu5) karmic; urgency=low
+
+  * debian/init: Move instance reboot detection out of python 
+    scripts and move them to the init script.
+  * debian/ec2-set-defaults.py: 
+    - Point to the right location for locate (LP: #387611)
+    - Default to UTC (LP: #341060)
+  * debian/ec2-set-apt-sources.py: If you cant contact EC2 then use the
+    regular archive (LP: #387027)
+  * debian/ec2-setup-hostname.py: Use the local hostname in /etc/hosts
+    and dont change once rebooted. (LP: #352745)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 08 Jul 2009 09:48:49 -0400
+
+ec2-init (0.3.4ubuntu4) karmic; urgency=low
+
+  * debian/init: Run update-motd regardless whether its a firstboot or not.
+  * debian/init: Fix comments (LP: #373057)
+  * debian/control: Add update-motd as a depends.
+  * ec2-set-defaults.py: Wait for network to become available. (LP: #308530)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 28 May 2009 05:04:31 -0400
+
+ec2-init (0.3.4ubuntu3) karmic; urgency=low
+
+  * debian/init: Move init script to run before ssh and regenerate the ssh
+    host kes in the init script rather than /etc/rc.local (LP: #370628)
+  * ec2-set-apt-sources.py: 
+    - Move sources.list to /var/ec2 so it doesnt get removed after user
+    reboots.
+  * ec2-set-defaults.py:
+    - Move locale to /var/ec2/ so it doesnt get remove after user reboots.
+  * ec2-set-hostname.py
+    - Create an /etc/hostname as well.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 14 May 2009 11:11:49 -0400
+
+ec2-init (0.3.4ubuntu2) karmic; urgency=low
+
+  * Really change the locale when setting up an instance. (LP: #341066) 
+  * Run ec2-run-user-data script last. (LP: #373055)
+  * Minor comment tweaks. (LP: #373057)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 13 May 2009 13:41:35 -0400
+
+ec2-init (0.3.4ubuntu1) karmic; urgency=low
+
+  * Add more smarts to ec2 instance bring up. (LP: #371936)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 05 May 2009 08:59:54 -0400
+
+ec2-init (0.3.3ubuntu12) jaunty; urgency=low
+
+  * ec2-run-user-data.py: Fix error. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 07 Apr 2009 08:14:07 -0400
+
+ec2-init (0.3.3ubuntu11) jaunty; urgency=low
+
+  * debian/control:
+    - Add python-cheetah and python-apt as a dependency.
+  * debian/ec2-config.cfg:
+    - Remove distro due to the change in ec2-set-apt-sources.py
+  * debian/inistall
+    - Install the templates in the right place.
+  * ec2-set-apt-sources.py:
+    - Use python-apt to update the sources.list.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 01 Apr 2009 13:58:43 -0400
+
+ec2-init (0.3.3ubuntu10) jaunty; urgency=low
+
+  * ec2-set-hostname.py:
+    - Use template for /etc/hosts creation.
+    - Dont use public_hostname in /etc/hosts. (LP: #352745) 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 01 Apr 2009 08:48:05 -0400
+
+ec2-init (0.3.3ubuntu9) jaunty; urgency=low
+
+  * ec2-set-apt-sources.py:
+    - Use a template to generate the sources.list and generate it based on the lsb_release. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 31 Mar 2009 15:15:55 -0400
+
+ec2-init (0.3.3ubuntu8) jaunty; urgency=low
+
+  * ec2-set-apt-sources.py:
+    - Add the ubuntu-on-ec2 ppa. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 31 Mar 2009 09:37:13 -0400
+
+ec2-init (0.3.3ubuntu7) jaunty; urgency=low
+
+  * debian/rules: Fix typo. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Sun, 22 Mar 2009 17:14:16 -0400
+
+ec2-init (0.3.3ubuntu6) jaunty; urgency=low
+
+  * Set the configuration file to jaunty.
+  * ec2-fetch-credentials: Fix typo.
+  * ec2-set-defaults.py: 
+    - Remove timezone change when booting the instance.
+    - Redirect output to /dev/null.
+  * ec2-set-apt-sources.py:
+    - Run apt-get update after the /etc/apt/sources.list and
+      redirect the output to /dev/null.
+  * rightscale-init: Updated rightscale-init
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 19 Mar 2009 20:52:59 -0400
+
+ec2-init (0.3.3ubuntu5) jaunty; urgency=low
+
+  * debian/ec2-config.cfg:
+    - Add disable root option.
+  * debian/ec2-init.rightscale-init.init:
+    - Add rightscale detection script.
+  * ec2-get-info.py:
+    - Display the information about an AMI instance.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Mon, 16 Mar 2009 08:54:49 -0400
+
+ec2-init (0.3.3ubuntu4) jaunty; urgency=low
+
+  * ec2-fetch-credentials.py:
+    - Allow user to choose which user they wish to configure for.
+    - Allow user to disable root user if they wish to.
+  * ec2-set-defaults.py:
+    - Set default timezone to UTC.
+    - Set locale depending on zone.
+  * debian/init:
+    - Removed nash plugin.
+    - Add ec2-set-defaults.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 04 Mar 2009 08:33:01 -0500
+
+ec2-init (0.3.3ubuntu3~intrepid4) intrepid; urgency=low
+
+  * set distro to intrepid.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 26 Feb 2009 10:28:06 -0500
+
+ec2-init (0.3.3ubuntu3) jaunty; urgency=low
+
+  * debian/ec2-init: Log results of ec2-run-user-data to syslog.
+  * ec2-run-user-data.py :Dont leave files around and log the 
+    output to syslog. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 26 Feb 2009 10:24:35 -0500
+
+ec2-init (0.3.3ubuntu2) jaunty; urgency=low
+
+  * ec2-set-apt-sources.py:
+    - Use the ec2 mirrors. (LP: #317065, #333897)
+    - Update the /etc/apt/sources.list (LP: #333904)
+  * ec2-fetch-credentials.py:
+    - Better error checking (LP: #325067)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 24 Feb 2009 14:02:37 -0500
+
+ec2-init (0.3.3ubuntu1) jaunty; urgency=low
+
+  * debian/init: Fix init script. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Fri, 20 Feb 2009 09:22:54 -0500
+
+ec2-init (0.3.3) jaunty; urgency=low
+
+  * ec2-set-apt-sources.py
+    - Determine the zone that the user is in and generate
+      a /etc/apt/sources.list.d/ based on that.
+  * debian/init:
+    - Check to see if there is an /var/run/ec2 and create
+      it if it doesnt exist.
+    - Start ec2-set-apt-sources at first bootup.
+  * debian/rules:
+    - Install ec2-set-apt-sources.
+  * debian/control:
+    - Add python-configobj as a dependency.
+  * debian/{install,dirs}
+    - Create an /etc/ec2-init to read the configuration file and install it.
+  
+ -- Chuck Short <zulcss@ubuntu.com>  Mon, 09 Feb 2009 10:35:56 -0500
+
+ec2-init (0.3.2) jaunty; urgency=low
+
+  * debian/init:
+    - Remove already ran detection
+    - Log the running of ec2-run-user-data to /var/log/ec2-user-data.log
+  * ec2-set-hostname.py:
+    - set hostname to the Ec2 local-hostname
+    - Update the /etc/hosts to change the ubuntu hostname to the
+      public hostname.
+  * ec2-fetch-credentials:
+    - Copy the ssh keys to the ubuntu user.
+    - Setup authorized keys for root to tell the user to login as the 
+      ubuntu user when they try to connect.
+  * ec2-run-user-data:
+    - Create an .already-ran file to check to see if ec2-run-user-data
+      already ran.
+    - Save the ec2-run-user-data script in /var/ec2.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Wed, 04 Feb 2009 09:32:08 -0500
+
+ec2-init (0.3.1) jaunty; urgency=low
+
+  * debian/dir: Install /var/ec2 to save user-data scripts.
+  * debian/rules: Start ec2-init after ssh.
+  * ec2-run-user-data.py: Save run-user-data script with ami-id.
+
+ -- Chuck Short <zulcss@ubuntu.com>  Mon, 26 Jan 2009 10:40:52 -0500
+
+ec2-init (0.3) jaunty; urgency=low
+
+  * ec2-run-user-data: Fix python error when writing a file to the disk. 
+
+ -- Chuck Short <zulcss@ubuntu.com>  Thu, 15 Jan 2009 11:49:08 -0500
+
+ec2-init (0.2) jaunty; urgency=low
+
+  * debian/init: Run fetch-credentials before anything else.
+    (LP: #308533)
+  * Add ec2-set-hostname.py: Queries ec2 metdada for public-hostname
+    and then sets it (LP: #316201)
+
+ -- Chuck Short <zulcss@ubuntu.com>  Tue, 13 Jan 2009 15:20:21 -0500
+
+ec2-init (0.1) intrepid; urgency=low
+
+  * Initial release (LP: #269434).
+
+ -- Soren Hansen <soren@ubuntu.com>  Fri, 12 Sep 2008 15:30:32 +0200
+
--- cloud-init-0.5.10.orig/debian/compat
+++ cloud-init-0.5.10/debian/compat
@@ -0,0 +1 @@
+5
--- cloud-init-0.5.10.orig/debian/cloud-init.postrm
+++ cloud-init-0.5.10/debian/cloud-init.postrm
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+dpkg-divert --package cloud-init --remove --rename --divert \
+      /etc/init/ureadahead.conf.disabled /etc/init/ureadahead.conf
+#DEBHELPER#
--- cloud-init-0.5.10.orig/debian/cloud-init.lintian-overrides
+++ cloud-init-0.5.10/debian/cloud-init.lintian-overrides
@@ -0,0 +1,3 @@
+# this explicitly diverts ureadahead.conf in ureadahead package
+# see LP: #499520 for more discussion
+cloud-init binary: diversion-for-unknown-file
--- cloud-init-0.5.10.orig/debian/rules
+++ cloud-init-0.5.10/debian/rules
@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+
+DEB_PYTHON_SYSTEM := pycentral
+export DH_PYCENTRAL=include-links
+
+binary-install/cloud-init::cloud-init-fixups
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+DEB_DH_INSTALL_SOURCEDIR := debian/tmp
+
+cloud-init-fixups:
+	for x in $(DEB_DESTDIR)/usr/bin/*.py; do mv "$$x" "$${x%.py}"; done
+	install -d $(DEB_DESTDIR)/etc/update-motd.d
+	cp tools/motd-hook $(DEB_DESTDIR)/etc/update-motd.d/92-uec-upgrade-available
--- cloud-init-0.5.10.orig/cloudinit/DataSourceEc2.py
+++ cloud-init-0.5.10/cloudinit/DataSourceEc2.py
@@ -20,6 +20,7 @@
 import socket
 import urllib2
 import time
+import sys
 import boto_utils
 
 class DataSourceEc2(DataSource.DataSource):
@@ -100,20 +101,37 @@
         except:
             return 'http://archive.ubuntu.com/ubuntu/'
 
-    def wait_for_metadata_service(self, sleeps = 10):
+
+    def wait_for_metadata_service(self, sleeps = 100):
         sleeptime = 1
+        address = '169.254.169.254'
+        starttime = time.time()
+    
+        url="http://%s/%s/meta-data/instance-id" % (address,self.api_ver)
         for x in range(sleeps):
-            s = socket.socket()
+            # given 100 sleeps, this ends up total sleep time of 1050 sec
+            sleeptime=int(x/5)+1
+
+            reason = ""
             try:
-                address = '169.254.169.254'
-                port = 80
-                s.connect((address,port))
-                s.close()
-                return True
-            except socket.error, e:
-                print "sleeping %s" % sleeptime
-                time.sleep(sleeptime)
-                #timeout = timeout * 2
+                req = urllib2.Request(url)
+                resp = urllib2.urlopen(req, timeout=2)
+                if resp.read() != "": return True
+                reason = "empty data [%s]" % resp.getcode()
+            except urllib2.HTTPError, e:
+                reason = "http error [%s]" % e.code
+            except urllib2.URLError, e:
+                reason = "url error [%s]" % e.reason
+    
+            if x == 0:
+               sys.stderr.write("waiting for metadata service at %s\n" % url)
+
+            sys.stderr.write("  %s [%02s/%s]: %s\n" %
+                             (time.strftime("%H:%M:%S"), x+1, sleeps, reason))
+            time.sleep(sleeptime)
+
+        sys.stderr.write("giving up on md after %i seconds\n" %
+                         int(time.time()-starttime))
         return False
 
     def get_public_ssh_keys(self):
--- cloud-init-0.5.10.orig/cloudinit/CloudConfig.py
+++ cloud-init-0.5.10/cloudinit/CloudConfig.py
@@ -125,6 +125,13 @@
             for e in errors:
                 warn("Source Error: %s\n" % ':'.join(e))
 
+        dconf_sel = util.get_cfg_option_str(self.cfg, 'debconf_selections', False)
+        if dconf_sel:
+            try:
+                util.subp(('debconf-set-selections', '-'), dconf_sel)
+            except:
+                warn("Failed to run debconf-set-selections")
+
         pkglist = []
         if 'packages' in self.cfg:
             if isinstance(self.cfg['packages'],list):
@@ -265,7 +272,7 @@
         # handle 'mounts'
 
         # these are our default set of mounts
-        defmnts = [ [ "ephemeral0", "/mnt", "auto", "defaults", "0", "0" ],
+        defmnts = [ [ "ephemeral0", "/mnt", "auto", "defaults,nobootwait", "0", "0" ],
                     [ "swap", "none", "swap", "sw", "0", "0" ] ]
 
         # fs_spec, fs_file, fs_vfstype, fs_mntops, fs-freq, fs_passno
--- cloud-init-0.5.10.orig/upstart/cloud-run-user-script.conf
+++ cloud-init-0.5.10/upstart/cloud-run-user-script.conf
@@ -1,8 +1,16 @@
 # cloud-run-user-script - runs user scripts found in user-data, that are
 #   stored in /var/lib/cloud/scripts by the initial cloudinit upstart job
+#   we want this to run after all other cloud-init/cloud-config jobs have run
 description "execute cloud user scripts"
 
-start on (stopped rc RUNLEVEL=[2345] and stopped cloud-config-misc)
+start on (stopped rc RUNLEVEL=[2345] \
+   and stopped cloud-apt-update-upgrade \
+   and stopped cloud-config-misc \
+   and stopped cloud-config-mounts \
+   and stopped cloud-config-puppet \
+   and stopped cloud-config-ssh \
+   and stopped cloud-disable-ec2-metadata )
+
 console output
 task
 
--- cloud-init-0.5.10.orig/doc/examples/cloud-config.txt
+++ cloud-init-0.5.10/doc/examples/cloud-config.txt
@@ -175,3 +175,17 @@
  - [ sh, -c, echo "=========hello world'=========" ]
  - ls -l /root
  - [ wget, "http://slashdot.org", -O, /tmp/index.html ]
+
+# Provide debconf answers
+#
+# See debconf-set-selections man page.
+#
+# Default: none
+# 
+debconf_selections: |     # Need to perserve newlines
+        # Force debconf priority to critical.
+        debconf debconf/priority select critical
+
+        # Override default frontend to readline, but allow user to select.
+        debconf debconf/frontend select readline
+        debconf debconf/frontend seen false
--- cloud-init-0.5.10.orig/doc/examples/cloud-config-TODO.txt
+++ cloud-init-0.5.10/doc/examples/cloud-config-TODO.txt
@@ -17,19 +17,3 @@
  #  (run debconf at a critical priority)
  - content: |
     DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt -p critical|| true";
-
-# Provide debconf answers
-#
-# See debconf-set-selections man page.
-#
-# Default: none
-# 
-debconf_selections: |     # Need to perserve newlines
-        # Force debconf priority to critical.
-        debconf debconf/priority select critical
-
-        # Override default frontend to readline, but allow user to select.
-        debconf debconf/frontend select readline
-        debconf debconf/frontend seen false
- 
-
