Index: livecd/creator/livecd-creator
===================================================================
--- livecd.orig/creator/livecd-creator
+++ livecd/creator/livecd-creator
@@ -922,10 +922,100 @@ menu color hotkey 0 #ffffffff #ff000000
         self.createSquashFS()
         self.createIso()
 
+class RawTarget(InstallationTarget):
+    def __init__(self, repos, packages, epackages, groups, fs_label, skip_compression, skip_prelink):
+        InstallationTarget.__init__(self, repos, packages, epackages, groups, fs_label, skip_compression, skip_prelink)
+
+    def base_on(self, base_on):
+        raise InstallationError("--base-on is not supported with --type=raw")
+
+    def write_fstab(self):
+        fstab = open(self.build_dir + "/install_root/etc/fstab", "w")
+        fstab.write("/dev/root    /           ext3    defaults,noatime 0 0\n")
+        fstab.write("devpts       /dev/pts    devpts  gid=5,mode=620   0 0\n")
+        fstab.write("tmpfs        /dev/shm    tmpfs   defaults         0 0\n")
+        fstab.write("proc         /proc       proc    defaults         0 0\n")
+        fstab.write("sysfs        /sys        sysfs   defaults         0 0\n")
+        fstab.close()
+
+    def setup(self, image_size, base_on = None):
+        return InstallationTarget.setup(self, image_size, base_on)
+
+    def createInitramfs(self):
+        conf = open(self.build_dir + "/install_root/etc/sysconfig/mkinitrd", "w")
+        conf.write('PROBE="no"\n')
+        conf.write('MODULES="xenblk xennet ext3"\n')
+        conf.close()
+
+        subprocess.call(["/sbin/mkinitrd", "-f",
+                         "--rootdev", "/dev/xvda",
+                         "--rootopts", "defaults",
+                         "--rootfs", "ext3",
+                          "/boot/livecd-initramfs.img", self.get_kernel_version()],
+                        preexec_fn=self.run_in_root)
+
+        os.mkdir(self.build_dir + "/out/" + self.fs_label)
+
+        shutil.copyfile(self.build_dir + "/install_root/boot/vmlinuz-" + self.get_kernel_version(),
+                        self.build_dir + "/out/" + self.fs_label + "/vmlinuz")
+        shutil.copyfile(self.build_dir + "/install_root/boot/livecd-initramfs.img",
+                        self.build_dir + "/out/" + self.fs_label + "/initrd.img")
+
+    def install(self):
+        InstallationTarget.install(self)
+        self.createInitramfs()
+
+    def writeXML(self):
+        xml = open(self.build_dir + "/out/" + self.fs_label + "/livecd.xml", "w")
+        xml.write("<domain>\n")
+        xml.write("  <name>%s</name>\n" % self.fs_label)
+        xml.write("  <os>\n")
+        xml.write("    <type>linux</type>\n")
+        xml.write("    <kernel>%s/%s/vmlinuz</kernel>\n" % (os.getcwd(), self.fs_label))
+        xml.write("    <initrd>%s/%s/initrd.img</initrd>\n" % (os.getcwd(), self.fs_label))
+        xml.write("    <cmdline>debug console=xvc0</cmdline>\n")
+        xml.write("  </os>\n")
+        xml.write("  <memory>131072</memory>\n")
+        xml.write("  <vcpu>1</vcpu>\n")
+        xml.write("  <devices>\n")
+        xml.write("    <disk type='file'>\n")
+        #
+        # Fantasy land
+        #
+        # if not self.skip_compression:
+        #     xml.write("      <driver name='tap' type='qcow' />\n")
+        #     xml.write("      <source file='%s/%s/os.qcow' />\n" % (os.getcwd(), self.fs_label))
+        xml.write("      <source file='%s/%s/os.img' />\n" % (os.getcwd(), self.fs_label))
+        xml.write("      <target dev='xvda' />\n")
+        xml.write("    </disk>\n")
+        xml.write("    <interface />\n")
+        xml.write("  </devices>\n")
+        xml.write("</domain>\n")
+        xml.close()
+
+    def package(self):
+        InstallationTarget.package(self)
+
+        #
+        # Fantasy land
+        #
+        # if not self.skip_compression:
+        #     subprocess.call(["/usr/sbin/img2qcow",
+        #                      self.build_dir + "/out/" + self.fs_label + "/os.qcow",
+        #                      self.build_dir + "/data/os.img"])
+
+        shutil.move(self.build_dir + "/data/os.img",
+                    self.build_dir + "/out/" + self.fs_label + "/os.img")
+
+        self.writeXML()
+
+        shutil.move(self.build_dir + "/out/" + self.fs_label, self.fs_label)
+
+
 def usage(out):
     print >> out, """
 usage: livecd-creator [--help] 
-                      [--type=<livecd|...>]
+                      [--type=<livecd|raw>]
                       [--config=<path-to-kickstart-file> | --repo=<name>,<url> --package=<p>]
                       [--repo=<name1>,<url1>] [--repo=<name2>,<url2> ...]
                       [--package=<p1>] [--package=<p2> ...]
@@ -997,6 +1087,8 @@ def parse_options(args):
         if o in ("-t", "--type"):
             if a == "livecd":
                 options.target_class = LiveCDTarget
+            elif a == "raw":
+                options.target_class = RawTarget
             else:
                 raise Usage("'%s' is not a known installation target type." % a)
             continue
