[Fedora-livecd-list] Branch 'rhel6-branch' - API AUTHORS config/livecd-fedora-minimal.ks COPYING dead.repo docs/livecd-creator.pod docs/livecd-iso-to-disk.pod docs/mkbiarch.8 HACKING imgcreate/creator.py imgcreate/debug.py imgcreate/errors.py imgcreate/fs.py imgcreate/imgutils.py imgcreate/__init__.py imgcreate/kickstart.py imgcreate/live.py imgcreate/sysutils.py imgcreate/yuminst.py Makefile README tools/edit-livecd tools/image-creator tools/livecd-creator tools/livecd-iso-to-disk.sh tools/livecd-iso-to-pxeboot.sh tools/liveimage-mount tools/mkbackup.py tools/mkbiarch.py tools/mkefiboot

Brian C. Lane bcl at fedoraproject.org
Thu Jan 29 20:22:25 UTC 2015


 API                             |   78 ---
 AUTHORS                         |    3 
 COPYING                         |  342 -------------
 HACKING                         |   28 -
 Makefile                        |   57 --
 README                          |  166 ------
 config/livecd-fedora-minimal.ks |   23 
 dead.repo                       |    3 
 docs/livecd-creator.pod         |  115 ----
 docs/livecd-iso-to-disk.pod     |   81 ---
 docs/mkbiarch.8                 |   89 ---
 imgcreate/__init__.py           |   68 --
 imgcreate/creator.py            |  951 --------------------------------------
 imgcreate/debug.py              |   86 ---
 imgcreate/errors.py             |   56 --
 imgcreate/fs.py                 |  622 -------------------------
 imgcreate/imgutils.py           |  333 -------------
 imgcreate/kickstart.py          |  568 -----------------------
 imgcreate/live.py               |  918 -------------------------------------
 imgcreate/sysutils.py           |  108 ----
 imgcreate/yuminst.py            |  218 --------
 tools/edit-livecd               |  711 ----------------------------
 tools/image-creator             |   75 ---
 tools/livecd-creator            |  150 ------
 tools/livecd-iso-to-disk.sh     |  987 ----------------------------------------
 tools/livecd-iso-to-pxeboot.sh  |  136 -----
 tools/liveimage-mount           |  101 ----
 tools/mkbackup.py               |   99 ----
 tools/mkbiarch.py               |  303 ------------
 tools/mkefiboot                 |  142 -----
 30 files changed, 3 insertions(+), 7614 deletions(-)

New commits:
commit 41e4a7bda4baa9a26cd1f8af32df2f2f1447731e
Author: Brian C. Lane <bcl at redhat.com>
Date:   Thu Jan 29 12:22:10 2015 -0800

    Moved livecd-tools to github

diff --git a/API b/API
deleted file mode 100644
index 9783c74..0000000
--- a/API
+++ /dev/null
@@ -1,78 +0,0 @@
-In addition to livecd-creator itself, the livecd-creator package
-provides a python API for building your own, other types of images.
-This API could also be used to build on top of the live image
-functionality.
-
-== Image Creation Frontends ==
-
-livecd-creator and image-creator are both frontends for creating
-images.  But really, it's straight-forward to build your own which
-deals with your own specific needs.  To do so, you'll want to do
-the following:
-
-* Create a pykickstart handler object.  All of the image creators are
-driven by data stored in pykickstart handlers.
-* Then, instantiate a creator
-    creator = ImageCreator(ks, name)
-  where ks is your pykickstart object and name is the label/name you
-  want for the image.
-* With the image, you can either do everything in one-shot with
-    creator.create()
-  or call the steps of creator.create() itself.  The latter lets you add
-  an interactive shell step if you want as well as a few other
-  options.  The order, though, is
-    creator.mount()
-    creator.install()
-    creator.configure()
-    creator.unmount()
-    creator.package()
-
-  Other available methods are
-    * creator.launch_shell(): This launches a root shell within the
-      install root
-    * creator.cleanup(): Tear down the image.  Note that this also
-      occurs when the image object is deleted
- 
-
-== Image Creator Backends ==
-
-The basic idea is that there are (presently) 3 main classes used to
-implement different types of images.  No matter which you use, the
-interface should be largely the same.  This means that, eg,
-livecd-creator _could_ generate other types of outputs just by
-switching from the LiveImageCreator to another ImageCreator object.
-
-* ImageCreator: This is the guts of what most image creators will
-  need to use.  It provides all of the bits to handle a kickstart
-  config, install packages into an install root, etc.  It leaves
-  a number of hook methods which maybe be implemented by more specific
-  creators:
-   i) _mount_instroot(self): This method is where your filesystems
-   should get mounted.  The root of your filesystem tree should be
-   located at self._instroot
-   ii) _unmount_instroot(self): This method is called to undo
-   _mount_instroot() basically.
-   iii) _create_bootconfig(self): Set up anything needed for your
-   image to boot.  This could involve creating an initramfs, writing a
-   bootloader configuration, etc.  The filesystem is still mounted at
-   self._instroot at this point.  Note that this could be a no-op.
-   iv) _stage_final_image(self): Do whatever is needed to make your
-   image "consumable" and copy it to self._outdir.  eg, for live CDs,
-   this is where we generate the iso images.  Note that this could be
-   a no-op.
-
-  Other hooks are available to subclasses, as well as a number of
-  helper methods which can be used in implementing the hooks. See
-  the inline docstrings for more details.
-
-  Overriding other methods is not supported or guaranteed to continue
-  to give consistent results over time.
-
-* LoopImageCreator: This generates ext3 images in a loopback file
-  which could then later be booted in a virtual machine environment.
-  NOTE: this does nothing to set up booting
-
-* LiveImageCreator: This builds on top of the LoopImageCreator to
-  build live images which use dm-snapshot, etc.  This is what is used
-  by livecd-creator.
-
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index 6f70bcc..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-David Zeuthen <david at fubar.dk>
-Jeremy Katz <katzj at redhat.com>
-Douglas McClendon
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 9115ee6..0000000
--- a/COPYING
+++ /dev/null
@@ -1,342 +0,0 @@
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    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, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/HACKING b/HACKING
deleted file mode 100644
index e912112..0000000
--- a/HACKING
+++ /dev/null
@@ -1,28 +0,0 @@
-
-SOURCE CONTROL MANAGEMENT
-=========================
-
-This project is stored in git and can be checked out using
-
- git clone git://git.fedorahosted.org/git/livecd
-
-or if you have write access you might want to use
-
- git clone ssh://git.fedorahosted.org/git/livecd
-
-Change history etc. can be obtained from the web interface
-
- http://git.fedoraproject.org/?p=hosted/livecd
-
-PATCHES
-=======
-
-Send patches to the fedora-livecd-list at redhat.com mailing list
-
- http://www.redhat.com/mailman/listinfo/fedora-livecd-list
-
-If you have a number of patches and want to have them pulled from a
-public git repository, please post a pointer to it as well as sending
-each of the patches individually to the list.  Note that the
-combination of git-format-patch and git-send-email works well for
-sending a series of patches which you have in a local repository.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2bb3fcf..0000000
--- a/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-
-VERSION = 13.4.6
-
-INSTALL = /usr/bin/install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_SCRIPT = ${INSTALL_PROGRAM}
-
-INSTALL_PYTHON = ${INSTALL} -m 644
-define COMPILE_PYTHON
-	python -c "import compileall as c; c.compile_dir('$(1)', force=1)"
-	python -O -c "import compileall as c; c.compile_dir('$(1)', force=1)"
-endef
-PYTHONDIR := $(shell python -c "import distutils.sysconfig as d; print d.get_python_lib()")
-
-all: 
-
-man:
-	pod2man --section=8 --release="livecd-tools $(VERSION)" --center "LiveCD Tools" docs/livecd-creator.pod > docs/livecd-creator.8
-	pod2man --section=8 --release="livecd-tools $(VERSION)" --center "LiveCD Tools" docs/livecd-iso-to-disk.pod > docs/livecd-iso-to-disk.8
-
-
-install: man
-	$(INSTALL_PROGRAM) -D tools/livecd-creator $(DESTDIR)/usr/bin/livecd-creator
-	$(INSTALL_PROGRAM) -D tools/liveimage-mount $(DESTDIR)/usr/bin/liveimage-mount
-	$(INSTALL_PROGRAM) -D tools/image-creator $(DESTDIR)/usr/bin/image-creator
-	$(INSTALL_PROGRAM) -D tools/livecd-iso-to-disk.sh $(DESTDIR)/usr/bin/livecd-iso-to-disk
-	$(INSTALL_PROGRAM) -D tools/livecd-iso-to-pxeboot.sh $(DESTDIR)/usr/bin/livecd-iso-to-pxeboot
-	$(INSTALL_PROGRAM) -D tools/mkefiboot $(DESTDIR)/usr/bin/mkefiboot
-	$(INSTALL_PROGRAM) -D tools/mkbiarch.py $(DESTDIR)/usr/bin/mkbiarch
-	$(INSTALL_DATA) -D AUTHORS $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/AUTHORS
-	$(INSTALL_DATA) -D COPYING $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/COPYING
-	$(INSTALL_DATA) -D README $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/README
-	$(INSTALL_DATA) -D HACKING $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)/HACKING
-	mkdir -p $(DESTDIR)/usr/share/livecd-tools/
-	mkdir -p $(DESTDIR)/$(PYTHONDIR)/imgcreate
-	$(INSTALL_PYTHON) -D imgcreate/*.py $(DESTDIR)/$(PYTHONDIR)/imgcreate/
-	$(call COMPILE_PYTHON,$(DESTDIR)/$(PYTHONDIR)/imgcreate)
-	mkdir -p $(DESTDIR)/usr/share/man/man8
-	$(INSTALL_DATA) -D docs/*.8 $(DESTDIR)/usr/share/man/man8
-
-uninstall:
-	rm -f $(DESTDIR)/usr/bin/livecd-creator
-	rm -f $(DESTDIR)/usr/bin/mkefiboot
-	rm -rf $(DESTDIR)/usr/lib/livecd-creator
-	rm -rf $(DESTDIR)/usr/share/doc/livecd-tools-$(VERSION)
-	rm -f $(DESTDIR)/usr/bin/mkbiarch
-
-dist : all
-	git archive --format=tar --prefix=livecd-tools-$(VERSION)/ HEAD | bzip2 -9v > livecd-tools-$(VERSION).tar.bz2
-
-release: dist
-	git tag -s -a -m "Tag as livecd-tools-$(VERSION)" livecd-tools-$(VERSION)
-	scp livecd-tools-$(VERSION).tar.bz2 fedorahosted.org:livecd
-
-clean:
-	rm -f *~ creator/*~ installer/*~ config/*~ docs/*.8
diff --git a/README b/README
deleted file mode 100644
index df0f189..0000000
--- a/README
+++ /dev/null
@@ -1,166 +0,0 @@
-
-                       The Fedora live CD tools
-                    David Zeuthen <davidz at redhat.com>
- 		    Jeremy Katz <katzj at redhat.com>
-
-                    Last updated: October 9 2007 (v0.5)
-
-This project concerns tools to generate live CD's on Fedora based
-systems including derived distributions such as RHEL, CentOS and
-others. See the project Wiki at 
-
- http://fedoraproject.org/wiki/FedoraLiveCD
-
-for more details. Discussion of  this project takes places at the
-fedora-livecd at redhat.com mailing list
-
- http://www.redhat.com/mailman/listinfo/fedora-livecd-list
-
-This project and it's source files is licensed under the GPLv2
-license. See the file COPYING for details.
-
-1. LIVE CD DESIGN GOALS
-
-The live CD is designed in such a way that the when running from a
-live CD, the system should appear as much as possible as a standard
-system with all that entails; e.g. read-write rootfs (achieved using
-dm-snapshot), standard ext3 file system (for extended attributes) and
-so on. 
-
-Another design goal is that the live CD should be ''installable'',
-ie. an user should be able to install the bits from the live CD onto
-his hard disk without this process requiring network access or
-additional media. (NOTE: this feature is not yet implemented)
-
-Finally, another design goal is that the tool set itself should be
-separate from configuration; the same unmodified tool should be usable
-for building various live CD flavors with vastly different
-configurations, e.g. a GNOME live CD, a KDE live CD, a live cd with
-music programs and so on.
-
-2. CREATING A LIVE CD
-
-To create a live cd, the livecd-creator tool is used. Super user
-privileges are needed. The tool is more or less self-documenting, use
-the --help option to see options.
-
-2.1 HOW THE LIVE CD CREATOR WORKS
-
-In a nutshell, the livecd-creator program
-
- o Sets up a file for the ext3 file system that will contain all the
-   data comprising the live CD
-
- o Loopback mounts that file into the file system so there is an
-   installation root
-
- o Bind mounts certain kernel file systems (/dev, /dev/pts, /proc,
-   /sys, /selinux) inside the installation root
-
- o Uses a configuration file to define the requested packages and
-   default configuration options.  The format of this file is the same
-   as is used for installing a system via kickstart.
-
- o Installs, using yum, the requested packages into the installation
-   using the given repositories
-
- o Optionally runs scripts as specified by the live CD configuration file. 
-
- o Relabels the entire installation root (for SELinux)
-
- o Creates a live CD specific initramfs that matches the installed kernel
-
- o Unmounts the kernel file systems mounted inside the installation root
-
- o Unmounts the installation root
-
- o Runs resize2fs to minimize and unminimize the ext3 file to remove data
-   from deleted files
-
- o Runs resize2fs to minimize on a devicemapper snapshot, to generate a
-   small minimized delta image file which can be used by anaconda to
-   reduce installation time by not copying unused data to disk
-
- o Creates a squashfs file system containing only the ext3 file (compression)
-
- o Configures the boot loader
-
- o Creates an iso9660 bootable CD
-
-
-2.2 EXAMPLE: A BAREBONES LIVE CD
-
-The command
-
-# livecd-creator \
-  --config=/usr/share/livecd-tools/livecd-fedora-minimal.ks
-
-will create a live CD that will boot to a login prompt. Not that since
-no configuration is done the user will not be able to login to the
-system as the root password is not set / cleared.
-
-2.3 LIVE CD CONFIGURATION FILES
-
-The configuration of the live CD is defined by a file that uses the
-same format as installing a system via kickstart.  They can include
-some basic system configuration items, the package manifest and a
-script to be run at the end of the build process.
-
-For the Fedora project, there are currently a variety of different
-live CD configuration files.  These include a minimal live image
-(livecd-fedora-minimal.ks), a complete desktop image
-(livecd-fedora-desktop.ks) and others.
-
-2.4 EXAMPLE: SPINNING THE FEDORA DESKTOP LIVE CD
-
-Assuming that you use the livecd-fedora-desktop.ks configuration file,
-then the following command
-
-# livecd-creator \
-  --config=/usr/share/livecd-tools/livecd-fedora-desktop.ks \
-  --fslabel=Fedora-7-LiveCD-1-foo
-
-will create a live CD called "Fedora-7-LiveCD-1-foo". The name
-given by --fslabel is used.
-
- o as a file system label on the ext3 and iso960 file systems
-   (as such it's visible on the desktop as the CD name)
-
- o in the isolinux boot loader
-
-If you have the repositories available locally and don't want to wait
-for the download of packages, just substitute the URLs listed in the
-configuration file to point to your local repositories.
-
-3. LIVE CD INSTALLS
-
-As of Fedora 7, anaconda has support for doing an installation
-from a live CD.  To use this, double click on the "Install to Hard
-Drive" item on the desktop or run /usr/bin/liveinst if you don't have
-such an icon.
-
-4. LIVE CD MEDIA VERIFICATION
-
-The live CD can incorporate functionality to verify itself.  To do so,
-you need to have anaconda-runtime installed both on the system used
-for creating the image and installed into the image.  This is so that
-the implantisomd5 and checkisomd5 utilities can be used.  These
-utilities take advantage of embedding an md5sum into the application
-area of the iso9660 image.  This then gets verified before mounting
-the real root filesystem.
-
-In a future release, the isomd5 utilities will probably be split out
-of anaconda.
-
-5. USING LIVE IMAGES FROM USB MEDIA 
-
-USB sticks are becoming increasingly prevalent and are a nice way to
-use live images.  You can take a live CD iso image and transform it so
-that it can be used on a USB stick.  To do so, use the
-livecd-iso-to-disk script.
-   /usr/bin/livecd-iso-to-disk /path/to/live.iso /dev/sdb1
-
-Replace /dev/sdb1 with the (unmounted) partition where you wish to put
-the live image.  This is not a destructive process; any data you 
-currently have on your USB stick will be preserved.
-
diff --git a/config/livecd-fedora-minimal.ks b/config/livecd-fedora-minimal.ks
deleted file mode 100644
index 147f4ea..0000000
--- a/config/livecd-fedora-minimal.ks
+++ /dev/null
@@ -1,23 +0,0 @@
-lang en_US.UTF-8
-keyboard us
-timezone US/Eastern
-auth --useshadow --enablemd5
-selinux --enforcing
-firewall --disabled
-part / --size 1024
-
-repo --name=development --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=$basearch
-
-
-%packages
- at core
-anaconda-runtime
-bash
-kernel
-passwd
-policycoreutils
-chkconfig
-authconfig
-rootfiles
-
-%end
diff --git a/dead.repo b/dead.repo
new file mode 100644
index 0000000..7dcd0e0
--- /dev/null
+++ b/dead.repo
@@ -0,0 +1,3 @@
+livecd-tools has moved to github:
+
+https://github.com/rhinstaller/livecd-tools
diff --git a/docs/livecd-creator.pod b/docs/livecd-creator.pod
deleted file mode 100644
index 63ea88b..0000000
--- a/docs/livecd-creator.pod
+++ /dev/null
@@ -1,115 +0,0 @@
-=pod
-
-=head1 NAME
-
-livecd-creator - creates live CD or DVD images.
-
-=head1 SYNOPSIS
-
-B<livecd-creator> [OPTIONS]
-
-=head1 DESCRIPTION
-
-B<livecd-creator> creates live CD or DVD images(ISO images) from kickstart files. Kickstart files contain information about packages and configuration settings which are used to build the image.
-
-=head1 OPTIONS
-
-=over 4
-
-=item -h, --help
-
-Shows the help message and exits.
-
-=back
-
-=head1 IMAGE OPTIONS
-
-These options define the created image.
-
-=over 4
-
-=item -c KSCFG, --config=KSCFG
-
-Path to kickstart configuration file.
-
-=item -b BASE_ON, --base-on=BASE_ON
-
-Add packages to an existing live CD iso9660 image.
-
-=item -f FS_LABEL, --fslabel=FS_LABEL
-
-Defines the file system label. The default is based on the configuration name.
-
-=item --compression-type=COMPRESSOR
-
-Specify a compressor recognized by mksquashfs.
-gzip is the default and should work with all kernels.
-lzo works with 2.6.36 and later kernels.
-xz works with 2.6.38 and later kernels. lzma will only work with custom kernels.
-If gzip is used, the -comp option is not passed to mksquashfs to allow the use of older versions of mksquashfs.
-
-=item --releasever=VER
-
-Set the value to substitute for $releasever in kickstart repo urls
-
-=back
-
-=head1 SYSTEM DIRECTORY OPTIONS
-
-These options define directories used on your system for creating the live image.
-
-=over 4
-
-=item -t TMPDIR, --tmpdir=TMPDIR
-
-defines the temporary directory to use. The default directory is /var/tmp.
-
-=item --cache=CACHEDIR
-
-Defines the cache directory to use (default: private cache).
-
-=back
-
-=head1 EXAMPLES
-
-Barebones LiveCD
-
-livecd-creator \
---config=/usr/share/livecd-tools/livecd-fedora-minimal.ks
-
-Fedora Desktop Live CD
-
-livecd-creator \
---config=/usr/share/livecd-tools/livecd-fedora-desktop.ks \
---fslabel=Fedora9-LiveCD-foo
-
-=head1 REPO EXTENSIONS
-
-livecd-creator provides for some extensions to the repo commands similar
-to what yum supports. The strings $arch, $basearch and $releasever
-are replaced with the system arch, basearch and release version respectively.
-When no --releasever is passed it defaults to the current system's version.
-The allows the use of repo commands such as the following:
-
-repo --name=fedora --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
-
-Note that in a chroot environment (like koji) the rpmdb is not available,
-so either don't use $releasever in that case, or pass --releasever=VER
-
-=head1 CONTRIBUTORS
-
-David Zeuthen, Jeremy Katz, Douglas McClendon and a team of many other contributors. See the AUTHORS file in the source distribution for the complete list of credits. 
-
-=head1 BUGS
-
-Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/fedora-livecd-list> or directly to Bugzilla C<http://bugzilla.redhat.com/bugzilla/> against the C<Fedora> product, and the C<livecd-tools> component.
-
-=head1 COPYRIGHT
-
-Copyright (C) Fedora Project 2008,2009, and various contributors. This is free software. You may redistribute copies of it under the terms of the GNU General Public License C<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
-
-=head1 SEE ALSO
-
-C<livecd-iso-to-disk(1)>, project website C<http://fedoraproject.org/wiki/FedoraLiveCD>
-
-=cut
diff --git a/docs/livecd-iso-to-disk.pod b/docs/livecd-iso-to-disk.pod
deleted file mode 100644
index 4ddef23..0000000
--- a/docs/livecd-iso-to-disk.pod
+++ /dev/null
@@ -1,81 +0,0 @@
-=pod
-
-=head1 NAME
-
-livecd-iso-to-disk - installs bootable CD images on a USB storage devices.
-
-=head1 SYNOPSIS
-
-B<livecd-iso-to-disk> [--format] [--reset-mbr] [--noverify] [--efi] [--overlay-size-mb <size>] [\-\-home\-size\-mb <size>] [\-\-unencrypted\-home] [\-\-skipcopy]  <path-to-iso> <usb storage device>
-
-=head1 DESCRIPTION
-
-B<livecd-iso-to-disk> installs a live CD or DVD image(ISO image) onto a USB storage device. The USB storage device can then boot the installed operating system on systems which support booting via USB. B<livecd-iso-to-disk> requires an ISO image and a USB storage device. ISO images can be created with B<livecd-creator>.
-
-B<livecd-iso-to-disk> is not a destructive process; any data you currently have on your USB stick is preserved.
-
-=head1 OPTIONS
-
-=over 4
-
-=item --format
-
-Formats the USB stick and creates an MS-DOS partition table (or GPT partition table if --efi is passed).
-
-=item --reset-mbr
-
-Sets the Master Boot Record(MBR) of the USB storage device to the mbr.bin file from the image's syslinux directory.
-
-=item --noverify
-
-Disables the image validation process which occurs before the image is installed. When this option is enabled the image is not verified before installation on the USB storage device.
-
-=item --overlay-size-mb
-
-This option sets the overlay size in mebibytes (integer values only).  The overlay makes persistent storage available to the live operating system, if the operating system supports it.  The persistent LiveOS overlay holds image-change snapshots (using write-once, difference-tracking  storage) in the /LiveOS/overlay-<device_id> file, which, *one should note*, always grows in size due to the storage mechanism.  (The fraction of allocated space that has been consumed may be displayed by issuing the 'dmsetup status' command in a terminal session of a running LiveOS installation.)  One way to conserve the unrecoverable, overlay file space, is to specify a persistent home folder for user files, see --home-size-mb below.  The target storage device must have enough free space for the image and the overlay.  A maximum <size> of 4095 MiB is permitted for vfat-formatted devices.  If there is insufficient room on your device, you will be given information to help in adjusting your setti
 ngs.
-
-=item --home-size-mb
-
-Sets the home directory size in mebibytes (integer values only).  A persistent home directory will be made in the /LiveOS/home.img filesystem image file.  This file space is encrypted by default, but not compressed (one may bypass encryption with the --unencrypted-home installation option).  Files in this home folder may be erased to recover and reuse their storage space.  The target storage device must have enough free space for the image, any overlay, and the home directory.  Note that the --delete-home option must also be selected to replace an existing persistent home with a new, empty one.  A maximum <size> of 4095 MiB is permitted for vfat-formatted devices.  If there is insufficient room on your device, you will be given information to help in adjusting your settings.
-
-=item --unencrypted-home
-
-Disables the encryption of the home directory.
-
-=item --skipcopy
-
-Skips the copy of the live image to the USB stick and disables the --forma, --home-size-mb, and --swap-size-mb options. The --overlay-size-mb option is changed to only reinitialize the existing overlay area, to recreate it from scratch.
-
-The intended use of this option is to speed up testing of the boot configuration of live images.
-
-=item --efi
-
-Create a GPT partition table when --format is passed, and install an hybrid EFI/MBR bootloader on the disk. This is necessary for most Intel Macs.
-
-=item --timeout
-
-Modify the bootloader's timeout value. This overrides the value set during iso creation. Units are 1/10s
-
-=item --totaltimeout
-
-Add a totaltimeout to the bootloader config. This is used to force and automatic boot. This cannot be canceled by the user. Units are 1/10s
-
-=back
-
-=head1 CONTRIBUTORS
-
-David Zeuthen, Jeremy Katz, Douglas McClendon, Chris Curran and other contributors. See the AUTHORS file in the source distribution for the complete list of credits.
-
-=head1 BUGS
-
-Report bugs to the mailing list C<http://www.redhat.com/mailman/listinfo/fedora-livecd-list> or directly to Bugzilla C<http://bugzilla.redhat.com/bugzilla/> against the C<Fedora> product, and the C<lived-tools> component.
-
-=head1 COPYRIGHT
-
-Copyright (C) Fedora Project 2008,2009, and various contributors. This is free software. You may redistribute copies of it under the terms of the GNU General Public License C<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
-
-=head1 SEE ALSO
-
-C<livecd-creator(1)>, project website C<http://fedoraproject.org/wiki/FedoraLiveCD>
-
-=cut
diff --git a/docs/mkbiarch.8 b/docs/mkbiarch.8
deleted file mode 100644
index 4ec1396..0000000
--- a/docs/mkbiarch.8
+++ /dev/null
@@ -1,89 +0,0 @@
-.\" PROCESS THIS FILE WITH
-.\" groff -man -Tascii mkbiarch.8 
-.\" 
-.TH mkbiarch 8 "2010-8-24" "LiveCD Tools" "User Manuals"
-
-.SH NAME
-mkbiarch.py - make a multiple architecture Live boot disk image
-for USB, CF SSD or any disk from 2 architecturally different 
-LiveCD ISO9660 image files.
-
-.SH SYNOPSIS
-mkbiarch <LiveCDx86ISO>  <LiveCDx64ISO>  <MultipleArch Disk IMG File>
-
-.SH DESCRIPTION
-.B mkbiarch(8)
-create a multiple architecture, bootable Live Disk image file (IMG)
-for use on USB or any disk (CF, SSD) 
-from 2 LiveCD ISO9660 files of different architecture (ISO).
-.BR
-
-.SH USAGE
-.B mkbiarch.py
-Fedora-13-i686-Live.iso
-Fedora-13-x86_64-Live.iso
-Fedora-13-MultiArch.img
-
-Then to write it 
-/bin/dd if=Fedora-13-MultiArch.img of=/dev/sdb bs=4M
-
-In the above example, mkbiarch.py
-creates Fedora-Multi-arch.img
-from the two existing ISO9660 LiveCD image files. 
-The resulting image file, 
-is written to a raw disk device using 
-.B dd(1)
-.BR
-
-
-.SH UNDER THE HOOD
-.B mkbiarch.py(8)
-first checks that the two ISO9660 image files exist. It will create a blank
-file using dd(1) writing data from /dev/zero, the size of the two ISO9660 images files combined.
-The blank file is then bound via loopback using
-.B losetup(8)
-partitioned, and bound at an offset via loopback
-of 512 bytes, this second loopback device is formatted type ext3 using 
-.B mke2fs(8)
-This filesystem is mounted using 
-.B mount(8)
-on a temporary directory. The two ISO9660 files are then mounted via loopback, 
-files are copied using shutil module in Python, from them to the newly formatted 
-filesystem in the image file. Data is gathered from the ISO9660 image files from it's isolinux.cfg,
-after the files are copied the loopbacked ISO9660 image files are released.
-.B extlinux(1)
-is installed to the loopback mounted filesystem on the target image file and an extlinux.conf
-is written. The temporary directories are unmounted using 
-.B umount(8)
-and the looback devices are released. 
-The temporary directories are then removed, and the resulting Multiple Architecture Disk Image
-File is moved using shutil to the specified location on the command line, which is provided as 
-argument 3 to mkbiarch.py
-
-.SH BUGS
-Please report any bugs to 
-http://bugzilla.redhat.com 
-under component livecd-tools 
-
-.SH AVAILABILITY
-To check out the git version of this program
- git clone git://git.fedorahosted.org/livecd
-
-.SH AUTHOR
-Jasper Hartline <autopsy at liveprojects.info>
-
-.SH CONTRIBUTORS
-.B Richard Shaw <email at address.com> 
-pyparted suggestions and feedback
-
-.B Jan Kratochvil <email at address.com>  
-for the original bash script which 
-the python version was derived 
-
-.SH "SEE ALSO"
-.BR livecd-creator(8),
-.BR livecd-iso-to-disk(8),
-.BR mke2fs(8),
-.BR losetup(8),
-.BR dd(1),
-.BR exlinux(1)
diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py
deleted file mode 100644
index bcfb40e..0000000
--- a/imgcreate/__init__.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# imgcreate : Support for creating system images, including Live CDs
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from imgcreate.live import *
-from imgcreate.creator import *
-from imgcreate.yuminst import *
-from imgcreate.kickstart import *
-from imgcreate.fs import *
-from imgcreate.debug import *
-
-"""A set of classes for building Fedora system images.
-
-The following image creators are available:
-  - ImageCreator - installs to a directory
-  - LoopImageCreator - installs to an ext3 image
-  - LiveImageCreator - installs to a bootable ISO
-
-Also exported are:
-  - CreatorError - all exceptions throw are of this type
-  - FSLABEL_MAXLEN - the length to which LoopImageCreator.fslabel is truncated
-  - read_kickstart() - a utility function for kickstart parsing
-  - build_name() - a utility to construct an image name
-
-Each of the creator classes are designed to be subclassable, allowing the user
-to create new creator subclasses in order to support the building other types
-of system images.
-
-The subclassing API consists of:
-
-  1) Attributes available to subclasses, e.g. ImageCreator._instroot
-
-  2) Hooks - methods which may be overridden by subclasses, e.g.
-     ImageCreator._mount_instroot()
-
-  3) Helpers - methods which may be used by subclasses in order to implement
-     hooks, e.g. ImageCreator._chroot()
-
-Overriding public methods (e.g. ImageCreator.package()) or subclassing helpers
-is not supported and is not guaranteed to continue working as expect in the
-future.
-
-"""
-
-__all__ = (
-    'CreatorError',
-    'ImageCreator',
-    'LiveImageCreator',
-    'LoopImageCreator',
-    'FSLABEL_MAXLEN',
-    'read_kickstart',
-    'construct_name',
-    'setup_logging',
-)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
deleted file mode 100644
index b9026f1..0000000
--- a/imgcreate/creator.py
+++ /dev/null
@@ -1,951 +0,0 @@
-#
-# creator.py : ImageCreator and LoopImageCreator base classes
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import os.path
-import stat
-import sys
-import tempfile
-import shutil
-import logging
-import subprocess
-
-import selinux
-import yum
-import rpm
-
-from imgcreate.errors import *
-from imgcreate.fs import *
-from imgcreate.yuminst import *
-from imgcreate import kickstart
-
-FSLABEL_MAXLEN = 32
-"""The maximum string length supported for LoopImageCreator.fslabel."""
-
-class ImageCreator(object):
-    """Installs a system to a chroot directory.
-
-    ImageCreator is the simplest creator class available; it will install and
-    configure a system image according to the supplied kickstart file.
-
-    e.g.
-
-      import imgcreate
-      ks = imgcreate.read_kickstart("foo.ks")
-      imgcreate.ImageCreator(ks, "foo").create()
-
-    """
-
-    def __init__(self, ks, name, releasever=None):
-        """Initialize an ImageCreator instance.
-
-        ks -- a pykickstart.KickstartParser instance; this instance will be
-              used to drive the install by e.g. providing the list of packages
-              to be installed, the system configuration and %post scripts
-
-        name -- a name for the image; used for e.g. image filenames or
-                filesystem labels
-
-        releasever -- Value to substitute for $releasever in repo urls
-        """
-        self.ks = ks
-        """A pykickstart.KickstartParser instance."""
-
-        self.name = name
-        """A name for the image."""
-
-        self.releasever = releasever
-
-        self.tmpdir = "/var/tmp"
-        """The directory in which all temporary files will be created."""
-
-        self.__builddir = None
-        self.__bindmounts = []
-
-        self.__sanity_check()
-
-    def __del__(self):
-        self.cleanup()
-
-    #
-    # Properties
-    #
-    def __get_instroot(self):
-        if self.__builddir is None:
-            raise CreatorError("_instroot is not valid before calling mount()")
-        return self.__builddir + "/install_root"
-    _instroot = property(__get_instroot)
-    """The location of the install root directory.
-
-    This is the directory into which the system is installed. Subclasses may
-    mount a filesystem image here or copy files to/from here.
-
-    Note, this directory does not exist before ImageCreator.mount() is called.
-
-    Note also, this is a read-only attribute.
-
-    """
-
-    def __get_outdir(self):
-        if self.__builddir is None:
-            raise CreatorError("_outdir is not valid before calling mount()")
-        return self.__builddir + "/out"
-    _outdir = property(__get_outdir)
-    """The staging location for the final image.
-
-    This is where subclasses should stage any files that are part of the final
-    image. ImageCreator.package() will copy any files found here into the
-    requested destination directory.
-
-    Note, this directory does not exist before ImageCreator.mount() is called.
-
-    Note also, this is a read-only attribute.
-
-    """
-
-    #
-    # Hooks for subclasses
-    #
-    def _mount_instroot(self, base_on = None):
-        """Mount or prepare the install root directory.
-
-        This is the hook where subclasses may prepare the install root by e.g.
-        mounting creating and loopback mounting a filesystem image to
-        _instroot.
-
-        There is no default implementation.
-
-        base_on -- this is the value passed to mount() and can be interpreted
-                   as the subclass wishes; it might e.g. be the location of
-                   a previously created ISO containing a system image.
-
-        """
-        pass
-
-    def _unmount_instroot(self):
-        """Undo anything performed in _mount_instroot().
-
-        This is the hook where subclasses must undo anything which was done
-        in _mount_instroot(). For example, if a filesystem image was mounted
-        onto _instroot, it should be unmounted here.
-
-        There is no default implementation.
-
-        """
-        pass
-
-    def _create_bootconfig(self):
-        """Configure the image so that it's bootable.
-
-        This is the hook where subclasses may prepare the image for booting by
-        e.g. creating an initramfs and bootloader configuration.
-
-        This hook is called while the install root is still mounted, after the
-        packages have been installed and the kickstart configuration has been
-        applied, but before the %post scripts have been executed.
-
-        There is no default implementation.
-
-        """
-        pass
-
-    def _stage_final_image(self):
-        """Stage the final system image in _outdir.
-
-        This is the hook where subclasses should place the image in _outdir
-        so that package() can copy it to the requested destination directory.
-
-        By default, this moves the install root into _outdir.
-
-        """
-        shutil.move(self._instroot, self._outdir + "/" + self.name)
-
-    def _get_required_packages(self):
-        """Return a list of required packages.
-
-        This is the hook where subclasses may specify a set of packages which
-        it requires to be installed.
-
-        This returns an empty list by default.
-
-        Note, subclasses should usually chain up to the base class
-        implementation of this hook.
-
-        """
-        return []
-
-    def _get_excluded_packages(self):
-        """Return a list of excluded packages.
-
-        This is the hook where subclasses may specify a set of packages which
-        it requires _not_ to be installed.
-
-        This returns an empty list by default.
-
-        Note, subclasses should usually chain up to the base class
-        implementation of this hook.
-
-        """
-        return []
-
-    def _get_fstab(self):
-        """Return the desired contents of /etc/fstab.
-
-        This is the hook where subclasses may specify the contents of
-        /etc/fstab by returning a string containing the desired contents.
-
-        A sensible default implementation is provided.
-
-        """
-        s =  "/dev/root  /         %s    defaults,noatime 0 0\n" %(self._fstype)
-        s += self._get_fstab_special()
-        return s
-
-    def _get_fstab_special(self):
-        s = "devpts     /dev/pts  devpts  gid=5,mode=620   0 0\n"
-        s += "tmpfs      /dev/shm  tmpfs   defaults         0 0\n"
-        s += "proc       /proc     proc    defaults         0 0\n"
-        s += "sysfs      /sys      sysfs   defaults         0 0\n"
-        return s
-
-    def _get_post_scripts_env(self, in_chroot):
-        """Return an environment dict for %post scripts.
-
-        This is the hook where subclasses may specify some environment
-        variables for %post scripts by return a dict containing the desired
-        environment.
-
-        By default, this returns an empty dict.
-
-        in_chroot -- whether this %post script is to be executed chroot()ed
-                     into _instroot.
-
-        """
-        return {}
-
-    def _get_kernel_versions(self):
-        """Return a dict detailing the available kernel types/versions.
-
-        This is the hook where subclasses may override what kernel types and
-        versions should be available for e.g. creating the booloader
-        configuration.
-
-        A dict should be returned mapping the available kernel types to a list
-        of the available versions for those kernels.
-
-        The default implementation uses rpm to iterate over everything
-        providing 'kernel', finds /boot/vmlinuz-* and returns the version
-        obtained from the vmlinuz filename. (This can differ from the kernel
-        RPM's n-v-r in the case of e.g. xen)
-
-        """
-        def get_version(header):
-            version = None
-            for f in header['filenames']:
-                if f.startswith('/boot/vmlinuz-'):
-                    version = f[14:]
-            return version
-
-        ts = rpm.TransactionSet(self._instroot)
-
-        ret = {}
-        for header in ts.dbMatch('provides', 'kernel'):
-            version = get_version(header)
-            if version is None:
-                continue
-
-            name = header['name']
-            if not name in ret:
-                ret[name] = [version]
-            elif not version in ret[name]:
-                ret[name].append(version)
-
-        return ret
-
-    #
-    # Helpers for subclasses
-    #
-    def _do_bindmounts(self):
-        """Mount various system directories onto _instroot.
-
-        This method is called by mount(), but may also be used by subclasses
-        in order to re-mount the bindmounts after modifying the underlying
-        filesystem.
-
-        """
-        for b in self.__bindmounts:
-            b.mount()
-
-    def _undo_bindmounts(self):
-        """Unmount the bind-mounted system directories from _instroot.
-
-        This method is usually only called by unmount(), but may also be used
-        by subclasses in order to gain access to the filesystem obscured by
-        the bindmounts - e.g. in order to create device nodes on the image
-        filesystem.
-
-        """
-        self.__bindmounts.reverse()
-        for b in self.__bindmounts:
-            b.unmount()
-
-    def _chroot(self):
-        """Chroot into the install root.
-
-        This method may be used by subclasses when executing programs inside
-        the install root e.g.
-
-          subprocess.call(["/bin/ls"], preexec_fn = self.chroot)
-
-        """
-        os.chroot(self._instroot)
-        os.chdir("/")
-
-    def _mkdtemp(self, prefix = "tmp-"):
-        """Create a temporary directory.
-
-        This method may be used by subclasses to create a temporary directory
-        for use in building the final image - e.g. a subclass might create
-        a temporary directory in order to bundle a set of files into a package.
-
-        The subclass may delete this directory if it wishes, but it will be
-        automatically deleted by cleanup().
-
-        The absolute path to the temporary directory is returned.
-
-        Note, this method should only be called after mount() has been called.
-
-        prefix -- a prefix which should be used when creating the directory;
-                  defaults to "tmp-".
-
-        """
-        self.__ensure_builddir()
-        return tempfile.mkdtemp(dir = self.__builddir, prefix = prefix)
-
-    def _mkstemp(self, prefix = "tmp-"):
-        """Create a temporary file.
-
-        This method may be used by subclasses to create a temporary file
-        for use in building the final image - e.g. a subclass might need
-        a temporary location to unpack a compressed file.
-
-        The subclass may delete this file if it wishes, but it will be
-        automatically deleted by cleanup().
-
-        A tuple containing a file descriptor (returned from os.open() and the
-        absolute path to the temporary directory is returned.
-
-        Note, this method should only be called after mount() has been called.
-
-        prefix -- a prefix which should be used when creating the file;
-                  defaults to "tmp-".
-
-        """
-        self.__ensure_builddir()
-        return tempfile.mkstemp(dir = self.__builddir, prefix = prefix)
-
-    def _mktemp(self, prefix = "tmp-"):
-        """Create a temporary file.
-
-        This method simply calls _mkstemp() and closes the returned file
-        descriptor.
-
-        The absolute path to the temporary file is returned.
-
-        Note, this method should only be called after mount() has been called.
-
-        prefix -- a prefix which should be used when creating the file;
-                  defaults to "tmp-".
-
-        """
-
-        (f, path) = self._mkstemp(prefix)
-        os.close(f)
-        return path
-
-    #
-    # Actual implementation
-    #
-    def __ensure_builddir(self):
-        if not self.__builddir is None:
-            return
-
-        try:
-            self.__builddir = tempfile.mkdtemp(dir =  os.path.abspath(self.tmpdir),
-                                               prefix = "imgcreate-")
-        except OSError, e:
-            raise CreatorError("Failed create build directory in %s: %s" %
-                               (self.tmpdir, e.strerror))
-
-    def __sanity_check(self):
-        """Ensure that the config we've been given is sane."""
-        if not (kickstart.get_packages(self.ks) or
-                kickstart.get_groups(self.ks)):
-            raise CreatorError("No packages or groups specified")
-
-        kickstart.convert_method_to_repo(self.ks)
-
-        if not kickstart.get_repos(self.ks):
-            raise CreatorError("No repositories specified")
-
-    def __write_fstab(self):
-        fstab = open(self._instroot + "/etc/fstab", "w")
-        fstab.write(self._get_fstab())
-        fstab.close()
-
-    def __create_minimal_dev(self):
-        """Create a minimal /dev so that we don't corrupt the host /dev"""
-        origumask = os.umask(0000)
-        devices = (('null',   1, 3, 0666),
-                   ('urandom',1, 9, 0666),
-                   ('random', 1, 8, 0666),
-                   ('full',   1, 7, 0666),
-                   ('ptmx',   5, 2, 0666),
-                   ('tty',    5, 0, 0666),
-                   ('zero',   1, 5, 0666))
-        links = (("/proc/self/fd", "/dev/fd"),
-                 ("/proc/self/fd/0", "/dev/stdin"),
-                 ("/proc/self/fd/1", "/dev/stdout"),
-                 ("/proc/self/fd/2", "/dev/stderr"))
-
-        for (node, major, minor, perm) in devices:
-            if not os.path.exists(self._instroot + "/dev/" + node):
-                os.mknod(self._instroot + "/dev/" + node, perm | stat.S_IFCHR, os.makedev(major,minor))
-        for (src, dest) in links:
-            if not os.path.exists(self._instroot + dest):
-                os.symlink(src, self._instroot + dest)
-        os.umask(origumask)
-
-    def __getbooleans(self):
-        booleans = []
-        if not kickstart.selinux_enabled(self.ks) or not os.path.exists("/selinux/enforce"):
-            return booleans
-        for i in  selinux.security_get_boolean_names()[1]:
-            on = selinux.security_get_boolean_active(i)
-            booleans.append(("/booleans/%s" % i, "%d %d" % (on, on)))
-        return booleans
-
-    def __create_selinuxfs(self):
-        # if selinux exists on the host we need to lie to the chroot
-        if os.path.exists("/selinux/enforce"):
-            selinux_dir = self._instroot + "/selinux"
-
-            # enforce=0 tells the chroot selinux is not enforcing
-            # policyvers=999 tell the chroot to make the highest version of policy it can
-
-            files = [('/enforce', '0'),
-                     ('/policyvers', '999'),
-                     ('/commit_pending_bools', ''),
-                     ('/mls', str(selinux.is_selinux_mls_enabled()))]
-
-            for (file, value) in files + self.__getbooleans():
-                fd = os.open(selinux_dir + file, os.O_WRONLY | os.O_TRUNC | os.O_CREAT)
-                os.write(fd, value)
-                os.close(fd)
-
-            # we steal mls from the host system for now, might be best to always set it to 1????
-            # make /load -> /dev/null so chroot policy loads don't hurt anything
-            os.mknod(selinux_dir + "/load", 0666 | stat.S_IFCHR, os.makedev(1, 3))
-
-        # selinux is on in the kickstart, so clean up as best we can to start
-        if kickstart.selinux_enabled(self.ks):
-            # label the fs like it is a root before the bind mounting
-            arglist = ["/sbin/setfiles", "-F", "-r", self._instroot, selinux.selinux_file_context_path(), self._instroot]
-            subprocess.call(arglist, close_fds = True)
-
-    def __destroy_selinuxfs(self):
-        # if the system was running selinux clean up our lies
-        if os.path.exists("/selinux/enforce"):
-            for root, dirs, files in os.walk(self._instroot + "/selinux"):
-                for name in files:
-                    try:
-                        os.remove(os.path.join(root, name))
-                    except OSError:
-                        pass
-                for name in dirs:
-                    if os.path.join(root, name) == self._instroot + "/selinux":
-                        continue
-                    try:
-                        os.rmdir(os.path.join(root, name))
-                    except OSError:
-                        pass
-
-    def mount(self, base_on = None, cachedir = None):
-        """Setup the target filesystem in preparation for an install.
-
-        This function sets up the filesystem which the ImageCreator will
-        install into and configure. The ImageCreator class merely creates an
-        install root directory, bind mounts some system directories (e.g. /dev)
-        and writes out /etc/fstab. Other subclasses may also e.g. create a
-        sparse file, format it and loopback mount it to the install root.
-
-        base_on -- a previous install on which to base this install; defaults
-                   to None, causing a new image to be created
-
-        cachedir -- a directory in which to store the Yum cache; defaults to
-                    None, causing a new cache to be created; by setting this
-                    to another directory, the same cache can be reused across
-                    multiple installs.
-
-        """
-        self.__ensure_builddir()
-
-        makedirs(self._instroot)
-        makedirs(self._outdir)
-
-        self._mount_instroot(base_on)
-
-        for d in ("/dev/pts", "/etc", "/boot", "/var/log", "/var/cache/yum", "/sys", "/proc", "/selinux/booleans"):
-            makedirs(self._instroot + d)
-
-        cachesrc = cachedir or (self.__builddir + "/yum-cache")
-        makedirs(cachesrc)
-
-        # bind mount system directories into _instroot
-        for (f, dest) in [("/sys", None), ("/proc", None),
-                          ("/dev/pts", None), ("/dev/shm", None),
-                          (cachesrc, "/var/cache/yum")]:
-            self.__bindmounts.append(BindChrootMount(f, self._instroot, dest))
-
-        self.__create_selinuxfs()
-
-        self._do_bindmounts()
-
-        self.__create_minimal_dev()
-
-        os.symlink("../proc/mounts", self._instroot + "/etc/mtab")
-
-        self.__write_fstab()
-
-    def unmount(self):
-        """Unmounts the target filesystem.
-
-        The ImageCreator class detaches the system from the install root, but
-        other subclasses may also detach the loopback mounted filesystem image
-        from the install root.
-
-        """
-        try:
-            os.unlink(self._instroot + "/etc/mtab")
-        except OSError:
-            pass
-
-        self.__destroy_selinuxfs()
-
-        self._undo_bindmounts()
-
-        self._unmount_instroot()
-
-    def cleanup(self):
-        """Unmounts the target filesystem and deletes temporary files.
-
-        This method calls unmount() and then deletes any temporary files and
-        directories that were created on the host system while building the
-        image.
-
-        Note, make sure to call this method once finished with the creator
-        instance in order to ensure no stale files are left on the host e.g.:
-
-          creator = ImageCreator(ks, name)
-          try:
-              creator.create()
-          finally:
-              creator.cleanup()
-
-        """
-        if not self.__builddir:
-            return
-
-        self.unmount()
-
-        shutil.rmtree(self.__builddir, ignore_errors = True)
-        self.__builddir = None
-
-    def __select_packages(self, ayum):
-        skipped_pkgs = []
-        for pkg in kickstart.get_packages(self.ks,
-                                          self._get_required_packages()):
-            try:
-                ayum.selectPackage(pkg)
-            except yum.Errors.InstallError, e:
-                if kickstart.ignore_missing(self.ks):
-                    skipped_pkgs.append(pkg)
-                else:
-                    raise CreatorError("Failed to find package '%s' : %s" %
-                                       (pkg, e))
-
-        for pkg in skipped_pkgs:
-            logging.warn("Skipping missing package '%s'" % (pkg,))
-
-    def __select_groups(self, ayum):
-        skipped_groups = []
-        for group in kickstart.get_groups(self.ks):
-            try:
-                ayum.selectGroup(group.name, group.include)
-            except (yum.Errors.InstallError, yum.Errors.GroupsError), e:
-                if kickstart.ignore_missing(self.ks):
-                    raise CreatorError("Failed to find group '%s' : %s" %
-                                       (group.name, e))
-                else:
-                    skipped_groups.append(group)
-
-        for group in skipped_groups:
-            logging.warn("Skipping missing group '%s'" % (group.name,))
-
-    def __deselect_packages(self, ayum):
-        for pkg in kickstart.get_excluded(self.ks,
-                                          self._get_excluded_packages()):
-            ayum.deselectPackage(pkg)
-
-    # if the system is running selinux and the kickstart wants it disabled
-    # we need /usr/sbin/lokkit
-    def __can_handle_selinux(self, ayum):
-        file = "/usr/sbin/lokkit"
-        if not kickstart.selinux_enabled(self.ks) and os.path.exists("/selinux/enforce") and not ayum.installHasFile(file):
-            raise CreatorError("Unable to disable SELinux because the installed package set did not include the file %s" % (file))
-
-    def install(self, repo_urls = {}):
-        """Install packages into the install root.
-
-        This function installs the packages listed in the supplied kickstart
-        into the install root. By default, the packages are installed from the
-        repository URLs specified in the kickstart.
-
-        repo_urls -- a dict which maps a repository name to a repository URL;
-                     if supplied, this causes any repository URLs specified in
-                     the kickstart to be overridden.
-
-        """
-        yum_conf = self._mktemp(prefix = "yum.conf-")
-
-        ayum = LiveCDYum(releasever=self.releasever)
-        ayum.setup(yum_conf, self._instroot)
-
-        for repo in kickstart.get_repos(self.ks, repo_urls):
-            (name, baseurl, mirrorlist, proxy, inc, exc) = repo
-
-            yr = ayum.addRepository(name, baseurl, mirrorlist)
-            if inc:
-                yr.includepkgs = inc
-            if exc:
-                yr.exclude = exc
-            if proxy:
-                yr.proxy = proxy
-
-        if kickstart.exclude_docs(self.ks):
-            rpm.addMacro("_excludedocs", "1")
-        if not kickstart.selinux_enabled(self.ks):
-            rpm.addMacro("__file_context_path", "%{nil}")
-        if kickstart.inst_langs(self.ks) != None:
-            rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks))
-
-        try:
-            self.__select_packages(ayum)
-            self.__select_groups(ayum)
-            self.__deselect_packages(ayum)
-
-            self.__can_handle_selinux(ayum)
-
-            ayum.runInstall()
-        except yum.Errors.RepoError, e:
-            raise CreatorError("Unable to download from repo : %s" % (e,))
-        except yum.Errors.YumBaseError, e:
-            raise CreatorError("Unable to install: %s" % (e,))
-        finally:
-            ayum.closeRpmDB()
-            ayum.close()
-            os.unlink(yum_conf)
-
-        # do some clean up to avoid lvm info leakage.  this sucks.
-        for subdir in ("cache", "backup", "archive"):
-            lvmdir = self._instroot + "/etc/lvm/" + subdir
-            try:
-                for f in os.listdir(lvmdir):
-                    os.unlink(lvmdir + "/" + f)
-            except:
-                pass
-
-    def _run_post_scripts(self):
-        for s in kickstart.get_post_scripts(self.ks):
-            (fd, path) = tempfile.mkstemp(prefix = "ks-script-",
-                                          dir = self._instroot + "/tmp")
-
-            os.write(fd, s.script)
-            os.close(fd)
-            os.chmod(path, 0700)
-
-            env = self._get_post_scripts_env(s.inChroot)
-
-            if not s.inChroot:
-                env["INSTALL_ROOT"] = self._instroot
-                preexec = None
-                script = path
-            else:
-                preexec = self._chroot
-                script = "/tmp/" + os.path.basename(path)
-
-            try:
-                subprocess.check_call([s.interp, script],
-                                      preexec_fn = preexec, env = env)
-            except OSError, e:
-                raise CreatorError("Failed to execute %%post script "
-                                   "with '%s' : %s" % (s.interp, e.strerror))
-            except subprocess.CalledProcessError, err:
-                if s.errorOnFail:
-                    raise CreatorError("%%post script failed with code %d "
-                                       % err.returncode)
-                logging.warning("ignoring %%post failure (code %d)"
-                                % err.returncode)
-            finally:
-                os.unlink(path)
-
-    def configure(self):
-        """Configure the system image according to the kickstart.
-
-        This method applies the (e.g. keyboard or network) configuration
-        specified in the kickstart and executes the kickstart %post scripts.
-
-        If neccessary, it also prepares the image to be bootable by e.g.
-        creating an initrd and bootloader configuration.
-
-        """
-        ksh = self.ks.handler
-
-        kickstart.LanguageConfig(self._instroot).apply(ksh.lang)
-        kickstart.KeyboardConfig(self._instroot).apply(ksh.keyboard)
-        kickstart.TimezoneConfig(self._instroot).apply(ksh.timezone)
-        kickstart.AuthConfig(self._instroot).apply(ksh.authconfig)
-        kickstart.FirewallConfig(self._instroot).apply(ksh.firewall)
-        kickstart.RootPasswordConfig(self._instroot).apply(ksh.rootpw)
-        kickstart.ServicesConfig(self._instroot).apply(ksh.services)
-        kickstart.XConfig(self._instroot).apply(ksh.xconfig)
-        kickstart.NetworkConfig(self._instroot).apply(ksh.network)
-        kickstart.RPMMacroConfig(self._instroot).apply(self.ks)
-
-        self._create_bootconfig()
-
-        self._run_post_scripts()
-        kickstart.SelinuxConfig(self._instroot).apply(ksh.selinux)
-
-    def launch_shell(self):
-        """Launch a shell in the install root.
-
-        This method is launches a bash shell chroot()ed in the install root;
-        this can be useful for debugging.
-
-        """
-        subprocess.call(["/bin/bash"], preexec_fn = self._chroot)
-
-    def package(self, destdir = "."):
-        """Prepares the created image for final delivery.
-
-        In its simplest form, this method merely copies the install root to the
-        supplied destination directory; other subclasses may choose to package
-        the image by e.g. creating a bootable ISO containing the image and
-        bootloader configuration.
-
-        destdir -- the directory into which the final image should be moved;
-                   this defaults to the current directory.
-
-        """
-        self._stage_final_image()
-
-        for f in os.listdir(self._outdir):
-            shutil.move(os.path.join(self._outdir, f),
-                        os.path.join(destdir, f))
-
-    def create(self):
-        """Install, configure and package an image.
-
-        This method is a utility method which creates and image by calling some
-        of the other methods in the following order - mount(), install(),
-        configure(), unmount and package().
-
-        """
-        self.mount()
-        self.install()
-        self.configure()
-        self.unmount()
-        self.package()
-
-class LoopImageCreator(ImageCreator):
-    """Installs a system into a loopback-mountable filesystem image.
-
-    LoopImageCreator is a straightforward ImageCreator subclass; the system
-    is installed into an ext3 filesystem on a sparse file which can be
-    subsequently loopback-mounted.
-
-    """
-
-    def __init__(self, ks, name, fslabel=None, releasever=None):
-        """Initialize a LoopImageCreator instance.
-
-        This method takes the same arguments as ImageCreator.__init__() with
-        the addition of:
-
-        fslabel -- A string used as a label for any filesystems created.
-
-        """
-        ImageCreator.__init__(self, ks, name, releasever=releasever)
-
-        self.__fslabel = None
-        self.fslabel = fslabel
-
-        self.__minsize_KB = 0
-        self.__blocksize = 4096
-        self.__fstype = kickstart.get_image_fstype(self.ks, "ext3")
-
-        self.__instloop = None
-        self.__imgdir = None
-
-        self.__image_size = kickstart.get_image_size(self.ks,
-                                                     4096L * 1024 * 1024)
-
-    #
-    # Properties
-    #
-    def __get_fslabel(self):
-        if self.__fslabel is None:
-            return self.name
-        else:
-            return self.__fslabel
-    def __set_fslabel(self, val):
-        if val is None:
-            self.__fslabel = None
-        else:
-            self.__fslabel = val[:FSLABEL_MAXLEN]
-    fslabel = property(__get_fslabel, __set_fslabel)
-    """A string used to label any filesystems created.
-
-    Some filesystems impose a constraint on the maximum allowed size of the
-    filesystem label. In the case of ext3 it's 16 characters, but in the case
-    of ISO9660 it's 32 characters.
-
-    mke2fs silently truncates the label, but mkisofs aborts if the label is too
-    long. So, for convenience sake, any string assigned to this attribute is
-    silently truncated to FSLABEL_MAXLEN (32) characters.
-
-    """
-
-    def __get_image(self):
-        if self.__imgdir is None:
-            raise CreatorError("_image is not valid before calling mount()")
-        return self.__imgdir + "/ext3fs.img"
-    _image = property(__get_image)
-    """The location of the image file.
-
-    This is the path to the filesystem image. Subclasses may use this path
-    in order to package the image in _stage_final_image().
-
-    Note, this directory does not exist before ImageCreator.mount() is called.
-
-    Note also, this is a read-only attribute.
-
-    """
-
-    def __get_blocksize(self):
-        return self.__blocksize
-    def __set_blocksize(self, val):
-        if self.__instloop:
-            raise CreatorError("_blocksize must be set before calling mount()")
-        try:
-            self.__blocksize = int(val)
-        except ValueError:
-            raise CreatorError("'%s' is not a valid integer value "
-                               "for _blocksize" % val)
-    _blocksize = property(__get_blocksize, __set_blocksize)
-    """The block size used by the image's filesystem.
-
-    This is the block size used when creating the filesystem image. Subclasses
-    may change this if they wish to use something other than a 4k block size.
-
-    Note, this attribute may only be set before calling mount().
-
-    """
-
-    def __get_fstype(self):
-        return self.__fstype
-    def __set_fstype(self, val):
-        if val not in ("ext2", "ext3", "ext4"):
-            raise CreatorError("Unknown _fstype '%s' supplied" % val)
-        self.__fstype = val
-    _fstype = property(__get_fstype, __set_fstype)
-    """The type of filesystem used for the image.
-
-    This is the filesystem type used when creating the filesystem image.
-    Subclasses may change this if they wish to use something other ext3.
-
-    Note, only ext2, ext3, ext4 are currently supported.
-
-    Note also, this attribute may only be set before calling mount().
-
-    """
-
-    #
-    # Helpers for subclasses
-    #
-    def _resparse(self, size = None):
-        """Rebuild the filesystem image to be as sparse as possible.
-
-        This method should be used by subclasses when staging the final image
-        in order to reduce the actual space taken up by the sparse image file
-        to be as little as possible.
-
-        This is done by resizing the filesystem to the minimal size (thereby
-        eliminating any space taken up by deleted files) and then resizing it
-        back to the supplied size.
-
-        size -- the size in, in bytes, which the filesystem image should be
-                resized to after it has been minimized; this defaults to None,
-                causing the original size specified by the kickstart file to
-                be used (or 4GiB if not specified in the kickstart).
-
-        """
-        return self.__instloop.resparse(size)
-
-    def _base_on(self, base_on):
-        shutil.copyfile(base_on, self._image)
-        
-    #
-    # Actual implementation
-    #
-    def _mount_instroot(self, base_on = None):
-        self.__imgdir = self._mkdtemp()
-
-        if not base_on is None:
-            self._base_on(base_on)
-
-        self.__instloop = ExtDiskMount(SparseLoopbackDisk(self._image, self.__image_size),
-                                       self._instroot,
-                                       self.__fstype,
-                                       self.__blocksize,
-                                       self.fslabel)
-
-        try:
-            self.__instloop.mount()
-        except MountError, e:
-            raise CreatorError("Failed to loopback mount '%s' : %s" %
-                               (self._image, e))
-
-    def _unmount_instroot(self):
-        if not self.__instloop is None:
-            self.__instloop.cleanup()
-
-    def _stage_final_image(self):
-        self._resparse()
-        shutil.move(self._image, self._outdir + "/" + self.name + ".img")
diff --git a/imgcreate/debug.py b/imgcreate/debug.py
deleted file mode 100644
index 84b8d30..0000000
--- a/imgcreate/debug.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# debug.py: Helper routines for debugging
-#
-# Copyright 2008, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-
-import logging
-import logging.handlers
-import optparse
-import sys
-
-
-def handle_logging(option, opt, val, parser, logger, level):
-    if level < logger.level:
-        logger.setLevel(level)
-
-def handle_logfile(option, opt, val, parser, logger, stream):
-    try:
-        logfile = logging.FileHandler(val,"a")
-    except IOError, e:
-        raise optparse.OptionValueError("Cannot open file '%s' : %s" %
-                                        (val, e.strerror))
-
-
-    logger.removeHandler(stream)
-    logger.addHandler(logfile)
-
-def setup_logging(parser = None):
-    """Set up the root logger and add logging options.
-
-    Set up the root logger so only warning/error messages are logged to stderr
-    by default.
-
-    Also, optionally, add --debug, --verbose and --logfile command line options
-    to the supplied option parser, allowing the root logger configuration to be
-    modified by the user.
-
-    Note, to avoid possible namespace clashes, setup_logging() will only ever
-    add these three options. No new options will be added in the future.
-
-    parser -- an optparse.OptionParser instance, or None
-
-    """
-    logger = logging.getLogger()
-
-    logger.setLevel(logging.WARN)
-
-    stream = logging.StreamHandler(sys.stderr)
-
-    logger.addHandler(stream)
-
-    if parser is None:
-        return
-
-    group = optparse.OptionGroup(parser, "Debugging options",
-                                 "These options control the output of logging information during image creation")
-
-    group.add_option("-d", "--debug",
-                     action = "callback", callback = handle_logging,
-                     callback_args = (logger, logging.DEBUG),
-                     help = "Output debugging information")
-
-    group.add_option("-v", "--verbose",
-                     action = "callback", callback = handle_logging,
-                     callback_args = (logger, logging.INFO),
-                     help = "Output verbose progress information")
-
-    group.add_option("", "--logfile", type="string",
-                     action = "callback", callback = handle_logfile,
-                     callback_args = (logger, stream),
-                     help = "Save debug information to FILE", metavar = "FILE")
-
-    parser.add_option_group(group)
diff --git a/imgcreate/errors.py b/imgcreate/errors.py
deleted file mode 100644
index 800dc3b..0000000
--- a/imgcreate/errors.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# errors.py : exception definitions
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-class CreatorError(Exception):
-    """An exception base class for all imgcreate errors."""
-    def __init__(self, msg):
-        Exception.__init__(self, msg)
-
-    # Some error messages may contain unicode strings (especially if your system
-    # locale is different from 'C', e.g. 'de_DE'). Python's exception class does
-    # not handle this appropriately (at least until 2.5) because str(Exception)
-    # returns just self.message without ensuring that all characters can be
-    # represented using ASCII. So we try to return a str and fall back to repr
-    # if this does not work.
-    #
-    # Please use unicode for your error logging strings so that we can really
-    # print nice error messages, e.g.:
-    #     log.error(u"Internal error: " % e)
-    # instead of
-    #     log.error("Internal error: " % e)
-    # With our custom __str__ and __unicode__ methods both will work but the
-    # first log call print a more readable error message.
-    def __str__(self):
-        try:
-            return str(self.message)
-        except UnicodeEncodeError:
-            return repr(self.message)
-
-    def __unicode__(self):
-        return unicode(self.message)
-
-class KickstartError(CreatorError):
-    pass
-class MountError(CreatorError):
-    pass
-class SnapshotError(CreatorError):
-    pass
-class SquashfsError(CreatorError):
-    pass
-class ResizeError(CreatorError):
-    pass
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
deleted file mode 100644
index 67d4c3d..0000000
--- a/imgcreate/fs.py
+++ /dev/null
@@ -1,622 +0,0 @@
-#
-# fs.py : Filesystem related utilities and classes
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import os.path
-import sys
-import errno
-import stat
-import subprocess
-import random
-import string
-import logging
-import tempfile
-import time
-
-from imgcreate.errors import *
-
-def makedirs(dirname):
-    """A version of os.makedirs() that doesn't throw an
-    exception if the leaf directory already exists.
-    """
-    try:
-        os.makedirs(dirname)
-    except OSError, e:
-        if e.errno != errno.EEXIST:
-            raise
-
-def mksquashfs(in_img, out_img, compress_type):
-# Allow gzip to work for older versions of mksquashfs
-    if not compress_type or compress_type == "gzip":
-        args = ["/sbin/mksquashfs", in_img, out_img]
-    else:
-        args = ["/sbin/mksquashfs", in_img, out_img, "-comp", compress_type]
-
-    if not sys.stdout.isatty():
-        args.append("-no-progress")
-
-    ret = subprocess.call(args)
-    if ret != 0:
-        raise SquashfsError("'%s' exited with error (%d)" %
-                            (string.join(args, " "), ret))
-
-def resize2fs(fs, size = None, minimal = False):
-    if minimal and size is not None:
-        raise ResizeError("Can't specify both minimal and a size for resize!")
-    if not minimal and size is None:
-        raise ResizeError("Must specify either a size or minimal for resize!")
-
-    e2fsck(fs)
-    (fd, saved_image) = tempfile.mkstemp("", "resize-image-", "/tmp")
-    os.close(fd)
-    subprocess.call(["/sbin/e2image", "-r", fs, saved_image])
-
-    args = ["/sbin/resize2fs", fs]
-    if minimal:
-        args.append("-M")
-    else:
-        args.append("%sK" %(size / 1024,))
-    ret = subprocess.call(args)
-    if ret != 0:
-        raise ResizeError("resize2fs returned an error (%d)!  image to debug at %s" %(ret, saved_image))
-
-    if e2fsck(fs) != 0:
-        raise ResizeError("fsck after resize returned an error!  image to debug at %s" %(saved_image,))
-    os.unlink(saved_image)
-    return 0
-
-def e2fsck(fs):
-    logging.debug("Checking filesystem %s" % fs)
-    rc = subprocess.call(["/sbin/e2fsck", "-f", "-y", fs])
-    return rc
-
-class BindChrootMount:
-    """Represents a bind mount of a directory into a chroot."""
-    def __init__(self, src, chroot, dest = None):
-        self.src = src
-        self.root = chroot
-
-        if not dest:
-            dest = src
-        self.dest = self.root + "/" + dest
-
-        self.mounted = False
-
-    def mount(self):
-        if self.mounted:
-            return
-
-        makedirs(self.dest)
-        rc = subprocess.call(["/bin/mount", "--bind", self.src, self.dest])
-        if rc != 0:
-            raise MountError("Bind-mounting '%s' to '%s' failed" %
-                             (self.src, self.dest))
-        self.mounted = True
-
-    def unmount(self):
-        if not self.mounted:
-            return
-
-        rc = subprocess.call(["/bin/umount", self.dest])
-        if rc != 0:
-            logging.debug("Unable to unmount %s normally, using lazy unmount" % self.dest)
-            rc = subprocess.call(["/bin/umount", "-l", self.dest])
-            if rc != 0:
-                raise MountError("Unable to unmount fs at %s" % self.dest)
-            else:
-                logging.debug("lazy umount succeeded on %s" % self.dest)
-                print >> sys.stdout, "lazy umount succeeded on %s" % self.dest
- 
-        self.mounted = False
-
-class LoopbackMount:
-    """LoopbackMount  compatibility layer for old API"""
-    def __init__(self, lofile, mountdir, fstype = None):
-        self.diskmount = DiskMount(LoopbackDisk(lofile,size = 0),mountdir,fstype,rmmountdir = True)
-        self.losetup = False
-        
-    def cleanup(self):
-        self.diskmount.cleanup()
-
-    def unmount(self):
-        self.diskmount.unmount()
-
-    def lounsetup(self):
-        if self.losetup:
-            rc = subprocess.call(["/sbin/losetup", "-d", self.loopdev])
-            self.losetup = False
-            self.loopdev = None
-
-    def loopsetup(self):
-        if self.losetup:
-            return
-
-        losetupProc = subprocess.Popen(["/sbin/losetup", "-f"],
-                                       stdout=subprocess.PIPE)
-        losetupOutput = losetupProc.communicate()[0]
-
-        if losetupProc.returncode:
-            raise MountError("Failed to allocate loop device for '%s'" %
-                             self.lofile)
-
-        self.loopdev = losetupOutput.split()[0]
-
-        rc = subprocess.call(["/sbin/losetup", self.loopdev, self.lofile])
-        if rc != 0:
-            raise MountError("Failed to allocate loop device for '%s'" %
-                             self.lofile)
-
-        self.losetup = True
-
-    def mount(self):
-        self.diskmount.mount()
-
-class SparseLoopbackMount(LoopbackMount):
-    """SparseLoopbackMount  compatibility layer for old API"""
-    def __init__(self, lofile, mountdir, size, fstype = None):
-        self.diskmount = DiskMount(SparseLoopbackDisk(lofile,size),mountdir,fstype,rmmountdir = True)
-
-    def expand(self, create = False, size = None):
-        self.diskmount.disk.expand(create, size)
-
-    def truncate(self, size = None):
-        self.diskmount.disk.truncate(size)
-
-    def create(self):
-        self.diskmount.disk.create()
-
-class SparseExtLoopbackMount(SparseLoopbackMount):
-    """SparseExtLoopbackMount  compatibility layer for old API"""
-    def __init__(self, lofile, mountdir, size, fstype, blocksize, fslabel):
-        self.diskmount = ExtDiskMount(SparseLoopbackDisk(lofile,size), mountdir, fstype, blocksize, fslabel, rmmountdir = True)
-
-
-    def __format_filesystem(self):
-        self.diskmount.__format_filesystem()
-
-    def create(self):
-        self.diskmount.disk.create()
-
-    def resize(self, size = None):
-        return self.diskmount.__resize_filesystem(size)
-
-    def mount(self):
-        self.diskmount.mount()
-        
-    def __fsck(self):
-        self.extdiskmount.__fsck()
-
-    def __get_size_from_filesystem(self):
-        return self.diskmount.__get_size_from_filesystem()
-        
-    def __resize_to_minimal(self):
-        return self.diskmount.__resize_to_minimal()
-        
-    def resparse(self, size = None):
-        return self.diskmount.resparse(size)
-        
-class Disk:
-    """Generic base object for a disk
-
-    The 'create' method must make the disk visible as a block device - eg
-    by calling losetup. For RawDisk, this is obviously a no-op. The 'cleanup'
-    method must undo the 'create' operation.
-    """
-    def __init__(self, size, device = None):
-        self._device = device
-        self._size = size
-
-    def create(self):
-        pass
-
-    def cleanup(self):
-        pass
-
-    def get_device(self):
-        return self._device
-    def set_device(self, path):
-        self._device = path
-    device = property(get_device, set_device)
-
-    def get_size(self):
-        return self._size
-    size = property(get_size)
-
-
-class RawDisk(Disk):
-    """A Disk backed by a block device.
-    Note that create() is a no-op.
-    """  
-    def __init__(self, size, device):
-        Disk.__init__(self, size, device)
-
-    def fixed(self):
-        return True
-
-    def exists(self):
-        return True
-
-class LoopbackDisk(Disk):
-    """A Disk backed by a file via the loop module."""
-    def __init__(self, lofile, size):
-        Disk.__init__(self, size)
-        self.lofile = lofile
-
-    def fixed(self):
-        return False
-
-    def exists(self):
-        return os.path.exists(self.lofile)
-
-    def create(self):
-        if self.device is not None:
-            return
-
-        losetupProc = subprocess.Popen(["/sbin/losetup", "-f"],
-                                       stdout=subprocess.PIPE)
-        losetupOutput = losetupProc.communicate()[0]
-
-        if losetupProc.returncode:
-            raise MountError("Failed to allocate loop device for '%s'" %
-                             self.lofile)
-
-        device = losetupOutput.split()[0]
-
-        logging.debug("Losetup add %s mapping to %s"  % (device, self.lofile))
-        rc = subprocess.call(["/sbin/losetup", device, self.lofile])
-        if rc != 0:
-            raise MountError("Failed to allocate loop device for '%s'" %
-                             self.lofile)
-        self.device = device
-
-    def cleanup(self):
-        if self.device is None:
-            return
-        logging.debug("Losetup remove %s" % self.device)
-        rc = subprocess.call(["/sbin/losetup", "-d", self.device])
-        self.device = None
-
-
-
-class SparseLoopbackDisk(LoopbackDisk):
-    """A Disk backed by a sparse file via the loop module."""
-    def __init__(self, lofile, size):
-        LoopbackDisk.__init__(self, lofile, size)
-
-    def expand(self, create = False, size = None):
-        flags = os.O_WRONLY
-        if create:
-            flags |= os.O_CREAT
-            makedirs(os.path.dirname(self.lofile))
-
-        if size is None:
-            size = self.size
-
-        logging.debug("Extending sparse file %s to %d" % (self.lofile, size))
-        fd = os.open(self.lofile, flags)
-
-        if size <= 0:
-            size = 1
-        os.lseek(fd, size-1, 0)
-        os.write(fd, '\x00')
-        os.close(fd)
-
-    def truncate(self, size = None):
-        if size is None:
-            size = self.size
-
-        logging.debug("Truncating sparse file %s to %d" % (self.lofile, size))
-        fd = os.open(self.lofile, os.O_WRONLY)
-        os.ftruncate(fd, size)
-        os.close(fd)
-
-    def create(self):
-        self.expand(create = True)
-        LoopbackDisk.create(self)
-
-class Mount:
-    """A generic base class to deal with mounting things."""
-    def __init__(self, mountdir):
-        self.mountdir = mountdir
-
-    def cleanup(self):
-        self.unmount()
-
-    def mount(self):
-        pass
-
-    def unmount(self):
-        pass
-
-class DiskMount(Mount):
-    """A Mount object that handles mounting of a Disk."""
-    def __init__(self, disk, mountdir, fstype = None, rmmountdir = True):
-        Mount.__init__(self, mountdir)
-
-        self.disk = disk
-        self.fstype = fstype
-        self.rmmountdir = rmmountdir
-
-        self.mounted = False
-        self.rmdir   = False
-
-    def cleanup(self):
-        Mount.cleanup(self)
-        self.disk.cleanup()
-
-    def unmount(self):
-        if self.mounted:
-            logging.debug("Unmounting directory %s" % self.mountdir)
-            rc = subprocess.call(["/bin/umount", self.mountdir])
-            if rc == 0:
-                self.mounted = False
-            else:
-                logging.debug("Unmounting directory %s failed, using lazy umount" % self.mountdir)
-                print >> sys.stdout, "Unmounting directory %s failed, using lazy umount" %self.mountdir
-                rc = subprocess.call(["/bin/umount", "-l", self.mountdir])
-                if rc != 0:
-                    raise MountError("Unable to unmount filesystem at %s" % self.mountdir)
-                else:
-                    logging.debug("lazy umount succeeded on %s" % self.mountdir)
-                    print >> sys.stdout, "lazy umount succeeded on %s" % self.mountdir
-                    self.mounted = False
-
-        if self.rmdir and not self.mounted:
-            try:
-                os.rmdir(self.mountdir)
-            except OSError, e:
-                pass
-            self.rmdir = False
-
-
-    def __create(self):
-        self.disk.create()
-
-
-    def mount(self):
-        if self.mounted:
-            return
-
-        if not os.path.isdir(self.mountdir):
-            logging.debug("Creating mount point %s" % self.mountdir)
-            os.makedirs(self.mountdir)
-            self.rmdir = self.rmmountdir
-
-        self.__create()
-
-        logging.debug("Mounting %s at %s" % (self.disk.device, self.mountdir))
-        args = [ "/bin/mount", self.disk.device, self.mountdir ]
-        if self.fstype:
-            args.extend(["-t", self.fstype])
-
-        if self.fstype and self.fstype == "squashfs":
-            args.extend(["-o", "ro"])
-
-        rc = subprocess.call(args)
-        if rc != 0:
-            raise MountError("Failed to mount '%s' to '%s'" %
-                             (self.disk.device, self.mountdir))
-
-        self.mounted = True
-
-class ExtDiskMount(DiskMount):
-    """A DiskMount object that is able to format/resize ext[23] filesystems."""
-    def __init__(self, disk, mountdir, fstype, blocksize, fslabel, rmmountdir=True):
-        DiskMount.__init__(self, disk, mountdir, fstype, rmmountdir)
-        self.blocksize = blocksize
-        self.fslabel = "_" + fslabel
-
-    def __format_filesystem(self):
-        logging.debug("Formating %s filesystem on %s" % (self.fstype, self.disk.device))
-        rc = subprocess.call(["/sbin/mkfs." + self.fstype,
-                              "-F", "-L", self.fslabel,
-                              "-m", "1", "-b", str(self.blocksize),
-                              self.disk.device])
-        #                      str(self.disk.size / self.blocksize)])
-        if rc != 0:
-            raise MountError("Error creating %s filesystem" % (self.fstype,))
-        logging.debug("Tuning filesystem on %s" % self.disk.device)
-        subprocess.call(["/sbin/tune2fs", "-c0", "-i0", "-Odir_index",
-                         "-ouser_xattr,acl", self.disk.device])
-
-    def __resize_filesystem(self, size = None):
-        current_size = os.stat(self.disk.lofile)[stat.ST_SIZE]
-
-        if size is None:
-            size = self.disk.size
-
-        if size == current_size:
-            return
-
-        if size > current_size:
-            self.disk.expand(size)
-
-        resize2fs(self.disk.lofile, size)
-        return size
-
-    def __create(self):
-        resize = False
-        if not self.disk.fixed() and self.disk.exists():
-            resize = True
-
-        self.disk.create()
-
-        if resize:
-            self.__resize_filesystem()
-        else:
-            self.__format_filesystem()
-
-    def mount(self):
-        self.__create()
-        DiskMount.mount(self)
-
-    def __fsck(self):
-        return e2fsck(self.disk.lofile)
-        return rc
-
-    def __get_size_from_filesystem(self):
-        def parse_field(output, field):
-            for line in output.split("\n"):
-                if line.startswith(field + ":"):
-                    return line[len(field) + 1:].strip()
-
-            raise KeyError("Failed to find field '%s' in output" % field)
-
-        dev_null = os.open("/dev/null", os.O_WRONLY)
-        try:
-            out = subprocess.Popen(['/sbin/dumpe2fs', '-h', self.disk.lofile],
-                                   stdout = subprocess.PIPE,
-                                   stderr = dev_null).communicate()[0]
-        finally:
-            os.close(dev_null)
-
-        return int(parse_field(out, "Block count")) * self.blocksize
-
-    def __resize_to_minimal(self):
-        resize2fs(self.disk.lofile, minimal = True)
-        return self.__get_size_from_filesystem()
-
-    def resparse(self, size = None):
-        self.cleanup()
-        minsize = self.__resize_to_minimal()
-        self.disk.truncate(minsize)
-        self.__resize_filesystem(size)
-        return minsize
-
-class DeviceMapperSnapshot(object):
-    def __init__(self, imgloop, cowloop):
-        self.imgloop = imgloop
-        self.cowloop = cowloop
-
-        self.__created = False
-        self.__name = None
-
-    def get_path(self):
-        if self.__name is None:
-            return None
-        return os.path.join("/dev/mapper", self.__name)
-    path = property(get_path)
-
-    def create(self):
-        if self.__created:
-            return
-
-        self.imgloop.create()
-        self.cowloop.create()
-
-        self.__name = "imgcreate-%d-%d" % (os.getpid(),
-                                           random.randint(0, 2**16))
-
-        size = os.stat(self.imgloop.lofile)[stat.ST_SIZE]
-
-        table = "0 %d snapshot %s %s p 8" % (size / 512,
-                                             self.imgloop.device,
-                                             self.cowloop.device)
-
-        args = ["/sbin/dmsetup", "create", self.__name,
-                "--uuid", "LIVECD-%s" % self.__name, "--table", table]
-        if subprocess.call(args) != 0:
-            self.cowloop.cleanup()
-            self.imgloop.cleanup()
-            raise SnapshotError("Could not create snapshot device using: " +
-                                string.join(args, " "))
-
-        self.__created = True
-
-    def remove(self, ignore_errors = False):
-        if not self.__created:
-            return
-
-        # sleep to try to avoid any dm shenanigans
-        time.sleep(2)
-        rc = subprocess.call(["/sbin/dmsetup", "remove", self.__name])
-        if not ignore_errors and rc != 0:
-            raise SnapshotError("Could not remove snapshot device")
-
-        self.__name = None
-        self.__created = False
-
-        self.cowloop.cleanup()
-        self.imgloop.cleanup()
-
-    def get_cow_used(self):
-        if not self.__created:
-            return 0
-
-        dev_null = os.open("/dev/null", os.O_WRONLY)
-        try:
-            out = subprocess.Popen(["/sbin/dmsetup", "status", self.__name],
-                                   stdout = subprocess.PIPE,
-                                   stderr = dev_null).communicate()[0]
-        finally:
-            os.close(dev_null)
-
-        #
-        # dmsetup status on a snapshot returns e.g.
-        #   "0 8388608 snapshot 416/1048576"
-        # or, more generally:
-        #   "A B snapshot C/D"
-        # where C is the number of 512 byte sectors in use
-        #
-        try:
-            return int((out.split()[3]).split('/')[0]) * 512
-        except ValueError:
-            raise SnapshotError("Failed to parse dmsetup status: " + out)
-
-def create_image_minimizer(path, image, compress_type, target_size = None):
-    """
-    Builds a copy-on-write image which can be used to
-    create a device-mapper snapshot of an image where
-    the image's filesystem is as small as possible
-
-    The steps taken are:
-      1) Create a sparse COW
-      2) Loopback mount the image and the COW
-      3) Create a device-mapper snapshot of the image
-         using the COW
-      4) Resize the filesystem to the minimal size
-      5) Determine the amount of space used in the COW
-      6) Restroy the device-mapper snapshot
-      7) Truncate the COW, removing unused space
-      8) Create a squashfs of the COW
-    """
-    imgloop = LoopbackDisk(image, None) # Passing bogus size - doesn't matter
-
-    cowloop = SparseLoopbackDisk(os.path.join(os.path.dirname(path), "osmin"),
-                                 64L * 1024L * 1024L)
-
-    snapshot = DeviceMapperSnapshot(imgloop, cowloop)
-
-    try:
-        snapshot.create()
-
-        if target_size is not None:
-            resize2fs(snapshot.path, target_size)
-        else:
-            resize2fs(snapshot.path, minimal = True)
-
-        cow_used = snapshot.get_cow_used()
-    finally:
-        snapshot.remove(ignore_errors = (not sys.exc_info()[0] is None))
-
-    cowloop.truncate(cow_used)
-
-    mksquashfs(cowloop.lofile, path, compress_type)
-
-    os.unlink(cowloop.lofile)
-
diff --git a/imgcreate/imgutils.py b/imgcreate/imgutils.py
deleted file mode 100644
index d481cc8..0000000
--- a/imgcreate/imgutils.py
+++ /dev/null
@@ -1,333 +0,0 @@
-# imgutils.py - utility functions/classes for building disk images
-#
-# Copyright (C) 2011  Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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/>.
-#
-# Author(s):  Will Woods <wwoods at redhat.com>
-
-import logging
-logger = logging.getLogger("pylorax.imgutils")
-
-import os, tempfile
-from os.path import join, dirname
-from imgcreate.sysutils import cpfile
-from subprocess import *
-import sys
-import traceback
-
-# backported from python 2.7
-def check_output(*popenargs, **kwargs):
-    r"""Run command with arguments and return its output as a byte string.
-
-    If the exit code was non-zero it raises a CalledProcessError.  The
-    CalledProcessError object will have the return code in the returncode
-    attribute and output in the output attribute.
-
-    The arguments are the same as for the Popen constructor.  Example:
-
-    >>> check_output(["ls", "-l", "/dev/null"])
-    'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'
-
-    The stdout argument is not allowed as it is used internally.
-    To capture standard error in the result, use stderr=STDOUT.
-
-    >>> check_output(["/bin/sh", "-c",
-    ...               "ls -l non_existent_file ; exit 0"],
-    ...              stderr=STDOUT)
-    'ls: non_existent_file: No such file or directory\n'
-    """
-    if 'stdout' in kwargs:
-        raise ValueError('stdout argument not allowed, it will be overridden.')
-    process = Popen(stdout=PIPE, *popenargs, **kwargs)
-    output, unused_err = process.communicate()
-    retcode = process.poll()
-    if retcode:
-        cmd = kwargs.get("args")
-        if cmd is None:
-            cmd = popenargs[0]
-        raise CalledProcessError(retcode, cmd, output=output)
-    return output
-
-######## Functions for making container images (cpio, squashfs) ##########
-
-def mkcpio(rootdir, outfile, compression="xz", compressargs=["-9"]):
-    '''Make a compressed CPIO archive of the given rootdir.
-    compression should be "xz", "gzip", "lzma", or None.
-    compressargs will be used on the compression commandline.'''
-    if compression not in (None, "xz", "gzip", "lzma"):
-        raise ValueError, "Unknown compression type %s" % compression
-    chdir = lambda: os.chdir(rootdir)
-    if compression == "xz":
-        compressargs.insert(0, "--check=crc32")
-    if compression is None:
-        compression = "cat" # this is a little silly
-        compressargs = []
-    find = Popen(["find", ".", "-print0"], stdout=PIPE, preexec_fn=chdir)
-    cpio = Popen(["cpio", "--null", "--quiet", "-H", "newc", "-o"],
-                 stdin=find.stdout, stdout=PIPE, preexec_fn=chdir)
-    comp = Popen([compression] + compressargs,
-                 stdin=cpio.stdout, stdout=open(outfile, "wb"))
-    comp.wait()
-    return comp.returncode
-
-def mksquashfs(rootdir, outfile, compression="default", compressargs=[]):
-    '''Make a squashfs image containing the given rootdir.'''
-    if compression != "default":
-        compressargs = ["-comp", compression] + compressargs
-    return call(["mksquashfs", rootdir, outfile] + compressargs)
-
-######## Utility functions ###############################################
-
-def mksparse(outfile, size):
-    '''use os.ftruncate to create a sparse file of the given size.'''
-    fobj = open(outfile, "w")
-    os.ftruncate(fobj.fileno(), size)
-
-def loop_attach(outfile):
-    '''Attach a loop device to the given file. Return the loop device name.
-    Raises CalledProcessError if losetup fails.'''
-    dev = check_output(["losetup", "--find", "--show", outfile], stderr=PIPE)
-    return dev.strip()
-
-def loop_detach(loopdev):
-    '''Detach the given loop device. Return False on failure.'''
-    return (call(["losetup", "--detach", loopdev]) == 0)
-
-def dm_attach(dev, size, name=None):
-    '''Attach a devicemapper device to the given device, with the given size.
-    If name is None, a random name will be chosen. Returns the device name.
-    raises CalledProcessError if dmsetup fails.'''
-    if name is None:
-        name = tempfile.mktemp(prefix="lorax.imgutils.", dir="")
-    check_call(["dmsetup", "create", name, "--table",
-                "0 %i linear %s 0" % (size/512, dev)],
-                stdout=PIPE, stderr=PIPE)
-    return name
-
-def dm_detach(dev):
-    '''Detach the named devicemapper device. Returns False if dmsetup fails.'''
-    dev = dev.replace("/dev/mapper/", "") # strip prefix, if it's there
-    return call(["dmsetup", "remove", dev], stdout=PIPE, stderr=PIPE)
-
-def mount(dev, opts="", mnt=None):
-    '''Mount the given device at the given mountpoint, using the given opts.
-    opts should be a comma-separated string of mount options.
-    if mnt is none, a temporary directory will be created and its path will be
-    returned.
-    raises CalledProcessError if mount fails.'''
-    if mnt is None:
-        mnt = tempfile.mkdtemp(prefix="lorax.imgutils.")
-    mount = ["mount"]
-    if opts:
-        mount += ["-o", opts]
-    check_call(mount + [dev, mnt])
-    return mnt
-
-def umount(mnt):
-    '''Unmount the given mountpoint. If the mount was a temporary dir created
-    by mount, it will be deleted. Returns false if the unmount fails.'''
-    rv = call(["umount", mnt])
-    if 'lorax.imgutils' in mnt:
-        os.rmdir(mnt)
-    return (rv == 0)
-
-def copytree(src, dest, preserve=True):
-    '''Copy a tree of files using cp -a, thus preserving modes, timestamps,
-    links, acls, sparse files, xattrs, selinux contexts, etc.
-    If preserve is False, uses cp -R (useful for modeless filesystems)'''
-    chdir = lambda: os.chdir(src)
-    cp = ["cp", "-a"] if preserve else ["cp", "-R", "-L"]
-    check_call(cp + [".", os.path.abspath(dest)], preexec_fn=chdir)
-
-def do_grafts(grafts, dest, preserve=True):
-    '''Copy each of the items listed in grafts into dest.
-    If the key ends with '/' it's assumed to be a directory which should be
-    created, otherwise just the leading directories will be created.'''
-    for imgpath, filename in grafts.items():
-        if imgpath[-1] == '/':
-            targetdir = join(dest, imgpath)
-            imgpath = imgpath[:-1]
-        else:
-            targetdir = join(dest, dirname(imgpath))
-        if not os.path.isdir(targetdir):
-            os.makedirs(targetdir)
-        if os.path.isdir(filename):
-            copytree(filename, join(dest, imgpath), preserve)
-        else:
-            cpfile(filename, join(dest, imgpath))
-
-def round_to_blocks(size, blocksize):
-    '''If size isn't a multiple of blocksize, round up to the next multiple'''
-    diff = size % blocksize
-    if diff or not size:
-        size += blocksize - diff
-    return size
-
-# TODO: move filesystem data outside this function
-def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=128):
-    getsize = lambda f: os.lstat(f).st_size
-    if fstype == "btrfs":
-        overhead = 64*1024 # don't worry, it's all sparse
-    if fstype == "hfsplus":
-        overhead = 200 # hack to deal with two bootloader copies
-    if fstype in ("vfat", "msdos"):
-        blocksize = 2048
-        getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies
-    total = overhead*blocksize
-    dirlist = graft.values()
-    if rootdir:
-        dirlist.append(rootdir)
-    for root in dirlist:
-        for top, dirs, files in os.walk(root):
-            for f in files + dirs:
-                total += round_to_blocks(getsize(join(top,f)), blocksize)
-    if fstype == "btrfs":
-        total = max(256*1024*1024, total) # btrfs minimum size: 256MB
-    return total
-
-######## Execution contexts - use with the 'with' statement ##############
-
-class LoopDev(object):
-    def __init__(self, filename, size=None):
-        self.filename = filename
-        if size:
-            mksparse(self.filename, size)
-    def __enter__(self):
-        self.loopdev = loop_attach(self.filename)
-        return self.loopdev
-    def __exit__(self, exc_type, exc_value, traceback):
-        loop_detach(self.loopdev)
-
-class DMDev(object):
-    def __init__(self, dev, size, name=None):
-        (self.dev, self.size, self.name) = (dev, size, name)
-    def __enter__(self):
-        self.mapperdev = dm_attach(self.dev, self.size, self.name)
-        return self.mapperdev
-    def __exit__(self, exc_type, exc_value, traceback):
-        dm_detach(self.mapperdev)
-
-class Mount(object):
-    def __init__(self, dev, opts="", mnt=None):
-        (self.dev, self.opts, self.mnt) = (dev, opts, mnt)
-    def __enter__(self):
-        self.mnt = mount(self.dev, self.opts, self.mnt)
-        return self.mnt
-    def __exit__(self, exc_type, exc_value, traceback):
-        umount(self.mnt)
-
-class PartitionMount(object):
-    """ Mount a partitioned image file using kpartx """
-    def __init__(self, disk_img, mount_ok=None):
-        """
-        disk_img is the full path to a partitioned disk image
-        mount_ok is a function that is passed the mount point and
-        returns True if it should be mounted.
-        """
-        self.mount_dir = None
-        self.disk_img = disk_img
-        self.mount_ok = mount_ok
-
-        # Default is to mount partition with /etc/passwd
-        if not self.mount_ok:
-            self.mount_ok = lambda mount_dir: os.path.isfile(mount_dir+"/etc/passwd")
-
-        # Example kpartx output
-        # kpartx -p p -v -a /tmp/diskV2DiCW.im
-        # add map loop2p1 (253:2): 0 3481600 linear /dev/loop2 2048
-        # add map loop2p2 (253:3): 0 614400 linear /dev/loop2 3483648
-        cmd = [ "kpartx", "-v", "-p", "p", "-a", self.disk_img ]
-        logger.debug(cmd)
-        kpartx_output = check_output(cmd)
-        logger.debug(kpartx_output)
-
-        # list of (deviceName, sizeInBytes)
-        self.loop_devices = []
-        for line in kpartx_output.splitlines():
-            # add map loop2p3 (253:4): 0 7139328 linear /dev/loop2 528384
-            # 3rd element is size in 512 byte blocks
-            if line.startswith("add map "):
-                fields = line[8:].split()
-                self.loop_devices.append( (fields[0], int(fields[3])*512) )
-
-    def __enter__(self):
-        # Mount the device selected by mount_ok, if possible
-        mount_dir = tempfile.mkdtemp()
-        for dev, size in self.loop_devices:
-            try:
-                mount( "/dev/mapper/"+dev, mnt=mount_dir )
-                if self.mount_ok(mount_dir):
-                    self.mount_dir = mount_dir
-                    self.mount_dev = dev
-                    self.mount_size = size
-                    break
-                umount( mount_dir )
-            except CalledProcessError:
-                logger.debug(traceback.format_exc())
-        if self.mount_dir:
-            logger.info("Partition mounted on {0} size={1}".format(self.mount_dir, self.mount_size))
-        else:
-            logger.debug("Unable to mount anything from {0}".format(self.disk_img))
-            os.rmdir(mount_dir)
-        return self
-
-    def __exit__(self, exc_type, exc_value, traceback):
-        if self.mount_dir:
-            umount( self.mount_dir )
-            os.rmdir(self.mount_dir)
-            self.mount_dir = None
-        call(["kpartx", "-d", self.disk_img])
-
-
-######## Functions for making filesystem images ##########################
-
-def mkfsimage(fstype, rootdir, outfile, size=None, mkfsargs=[], mountargs="", graft={}):
-    '''Generic filesystem image creation function.
-    fstype should be a filesystem type - "mkfs.${fstype}" must exist.
-    graft should be a dict: {"some/path/in/image": "local/file/or/dir"};
-      if the path ends with a '/' it's assumed to be a directory.
-    Will raise CalledProcessError if something goes wrong.'''
-    preserve = (fstype not in ("msdos", "vfat"))
-    if not size:
-        size = estimate_size(rootdir, graft, fstype)
-    with LoopDev(outfile, size) as loopdev:
-        try:
-            check_output(["mkfs.%s" % fstype] + mkfsargs + [loopdev])
-        except CalledProcessError as e:
-            logger.error("mkfs exited with a non-zero return code: %d" % e.returncode)
-            logger.error(e.output)
-            sys.exit(e.returncode)
-
-        with Mount(loopdev, mountargs) as mnt:
-            if rootdir:
-                copytree(rootdir, mnt, preserve)
-            do_grafts(graft, mnt, preserve)
-
-# convenience functions with useful defaults
-def mkdosimg(rootdir, outfile, size=None, label="", mountargs="shortname=winnt,umask=0077", graft={}):
-    mkfsimage("msdos", rootdir, outfile, size, mountargs=mountargs,
-              mkfsargs=["-n", label], graft=graft)
-
-def mkext4img(rootdir, outfile, size=None, label="", mountargs="", graft={}):
-    mkfsimage("ext4", rootdir, outfile, size, mountargs=mountargs,
-              mkfsargs=["-L", label, "-b", "1024", "-m", "0"], graft=graft)
-
-def mkbtrfsimg(rootdir, outfile, size=None, label="", mountargs="", graft={}):
-    mkfsimage("btrfs", rootdir, outfile, size, mountargs=mountargs,
-               mkfsargs=["-L", label], graft=graft)
-
-def mkhfsimg(rootdir, outfile, size=None, label="", mountargs="", graft={}):
-    mkfsimage("hfsplus", rootdir, outfile, size, mountargs=mountargs,
-              mkfsargs=["-v", label], graft=graft)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
deleted file mode 100644
index f50a9b8..0000000
--- a/imgcreate/kickstart.py
+++ /dev/null
@@ -1,568 +0,0 @@
-#
-# kickstart.py : Apply kickstart configuration to a system
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import os.path
-import shutil
-import subprocess
-import time
-import logging
-import selinux
-import urlgrabber
-
-try:
-    import system_config_keyboard.keyboard as keyboard
-except ImportError:
-    import rhpl.keyboard as keyboard
-
-import pykickstart.commands as kscommands
-import pykickstart.constants as ksconstants
-import pykickstart.errors as kserrors
-import pykickstart.parser as ksparser
-import pykickstart.version as ksversion
-
-import imgcreate.errors as errors
-import imgcreate.fs as fs
-
-def read_kickstart(path):
-    """Parse a kickstart file and return a KickstartParser instance.
-
-    This is a simple utility function which takes a path to a kickstart file,
-    parses it and returns a pykickstart KickstartParser instance which can
-    be then passed to an ImageCreator constructor.
-
-    If an error occurs, a CreatorError exception is thrown.
-
-    """
-    version = ksversion.makeVersion()
-    ks = ksparser.KickstartParser(version)
-    try:
-        ksfile = urlgrabber.urlgrab(path)
-        ks.readKickstart(ksfile)
-# Fallback to e.args[0] is a workaround for bugs in urlgragger and pykickstart.
-    except IOError, e:
-        raise errors.KickstartError("Failed to read kickstart file "
-                                    "'%s' : %s" % (path, e.strerror or
-                                    e.args[0]))
-    except kserrors.KickstartError, e:
-        raise errors.KickstartError("Failed to parse kickstart file "
-                                    "'%s' : %s" % (path, e))
-    return ks
-
-def build_name(kscfg, prefix = None, suffix = None, maxlen = None):
-    """Construct and return an image name string.
-
-    This is a utility function to help create sensible name and fslabel
-    strings. The name is constructed using the sans-prefix-and-extension
-    kickstart filename and the supplied prefix and suffix.
-
-    If the name exceeds the maxlen length supplied, the prefix is first dropped
-    and then the kickstart filename portion is reduced until it fits. In other
-    words, the suffix takes precedence over the kickstart portion and the
-    kickstart portion takes precedence over the prefix.
-
-    kscfg -- a path to a kickstart file
-    prefix -- a prefix to prepend to the name; defaults to None, which causes
-              no prefix to be used
-    suffix -- a suffix to append to the name; defaults to None, which causes
-              a YYYYMMDDHHMM suffix to be used
-    maxlen -- the maximum length for the returned string; defaults to None,
-              which means there is no restriction on the name length
-
-    Note, if maxlen is less then the len(suffix), you get to keep both pieces.
-
-    """
-    name = os.path.basename(kscfg)
-    idx = name.rfind('.')
-    if idx >= 0:
-        name = name[:idx]
-
-    if prefix is None:
-        prefix = ""
-    if suffix is None:
-        suffix = time.strftime("%Y%m%d%H%M")
-
-    if name.startswith(prefix):
-        name = name[len(prefix):]
-
-    ret = prefix + name + "-" + suffix
-    if not maxlen is None and len(ret) > maxlen:
-        ret = name[:maxlen - len(suffix) - 1] + "-" + suffix
-
-    return ret
-
-class KickstartConfig(object):
-    """A base class for applying kickstart configurations to a system."""
-    def __init__(self, instroot):
-        self.instroot = instroot
-
-    def path(self, subpath):
-        return self.instroot + subpath
-
-    def chroot(self):
-        os.chroot(self.instroot)
-        os.chdir("/")
-
-    def call(self, args):
-        if not os.path.exists("%s/%s" %(self.instroot, args[0])):
-            raise errors.KickstartError("Unable to run %s!" %(args))
-        subprocess.call(args, preexec_fn = self.chroot)
-
-    def apply(self):
-        pass
-
-class LanguageConfig(KickstartConfig):
-    """A class to apply a kickstart language configuration to a system."""
-    def apply(self, kslang):
-        lang = kslang.lang or "en_US.UTF-8"
-
-        f = open(self.path("/etc/sysconfig/i18n"), "w+")
-        f.write("LANG=\"" + lang + "\"\n")
-        f.close()
-
-class KeyboardConfig(KickstartConfig):
-    """A class to apply a kickstart keyboard configuration to a system."""
-    def apply(self, kskeyboard):
-        k = keyboard.Keyboard()
-        if kskeyboard.keyboard:
-            k.set(kskeyboard.keyboard)
-        k.write(self.instroot)
-
-class TimezoneConfig(KickstartConfig):
-    """A class to apply a kickstart timezone configuration to a system."""
-    def apply(self, kstimezone):
-        tz = kstimezone.timezone or "America/New_York"
-        utc = str(kstimezone.isUtc)
-
-        f = open(self.path("/etc/sysconfig/clock"), "w+")
-        f.write("ZONE=\"" + tz + "\"\n")
-        f.write("UTC=" + utc + "\n")
-        f.close()
-        try:
-            shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)),
-                            self.path("/etc/localtime"))
-        except OSError, e:
-            log.error("Error copying timezone: %s" %(e.strerror,))
-
-
-class AuthConfig(KickstartConfig):
-    """A class to apply a kickstart authconfig configuration to a system."""
-    def apply(self, ksauthconfig):
-        if not os.path.exists(self.path("/usr/sbin/authconfig")):
-            return
-
-        auth = ksauthconfig.authconfig or "--useshadow --enablemd5"
-        args = ["/usr/sbin/authconfig", "--update", "--nostart"]
-        self.call(args + auth.split())
-
-class FirewallConfig(KickstartConfig):
-    """A class to apply a kickstart firewall configuration to a system."""
-    def apply(self, ksfirewall):
-        if not os.path.exists(self.path("/usr/sbin/lokkit")):
-            return
-        args = ["/usr/sbin/lokkit", "--quiet", "--nostart"]
-        if ksfirewall.enabled:
-            args.append("--enabled")
-
-            for port in ksfirewall.ports:
-                args.append("--port=%s" %(port,))
-            for svc in ksfirewall.services:
-                args.append("--service=%s" %(svc,))
-            for dev in ksfirewall.trusts:
-                args.append("--trust=%s" %(dev,))
-        else:
-            args.append("--disabled")
-
-        self.call(args)
-        
-class RootPasswordConfig(KickstartConfig):
-    """A class to apply a kickstart root password configuration to a system."""
-    def lock(self):
-        self.call(["/usr/bin/passwd", "-l", "root"])
-
-    def set_encrypted(self, password):
-        self.call(["/usr/sbin/usermod", "-p", password, "root"])
-
-    def set_unencrypted(self, password):
-        for p in ("/bin/echo", "/usr/bin/passwd"):
-            if not os.path.exists("%s/%s" %(self.instroot, p)):
-                raise errors.KickstartError("Unable to set unencrypted password due to lack of %s" % p)
-
-        p1 = subprocess.Popen(["/bin/echo", password],
-                              stdout = subprocess.PIPE,
-                              preexec_fn = self.chroot)
-        p2 = subprocess.Popen(["/usr/bin/passwd", "--stdin", "root"],
-                              stdin = p1.stdout,
-                              stdout = subprocess.PIPE,
-                              preexec_fn = self.chroot)
-        p2.communicate()
-
-    def apply(self, ksrootpw):
-        if ksrootpw.isCrypted:
-            self.set_encrypted(ksrootpw.password)
-        elif ksrootpw.password != "":
-            self.set_unencrypted(ksrootpw.password)
-
-        if ksrootpw.lock:
-            self.lock()
-
-class ServicesConfig(KickstartConfig):
-    """A class to apply a kickstart services configuration to a system."""
-    def apply(self, ksservices):
-        if not os.path.exists(self.path("/sbin/chkconfig")):
-            return
-        for s in ksservices.enabled:
-            self.call(["/sbin/chkconfig", s, "on"])
-        for s in ksservices.disabled:
-            self.call(["/sbin/chkconfig", s, "off"])
-
-class XConfig(KickstartConfig):
-    """A class to apply a kickstart X configuration to a system."""
-    def apply(self, ksxconfig):
-        if ksxconfig.startX:
-            f = open(self.path("/etc/inittab"), "rw+")
-            buf = f.read()
-            buf = buf.replace("id:3:initdefault", "id:5:initdefault")
-            f.seek(0)
-            f.write(buf)
-            f.close()
-        if ksxconfig.defaultdesktop:
-            f = open(self.path("/etc/sysconfig/desktop"), "w")
-            f.write("DESKTOP="+ksxconfig.defaultdesktop+"\n")
-            f.close()
-
-class RPMMacroConfig(KickstartConfig):
-    """A class to apply the specified rpm macros to the filesystem"""
-    def apply(self, ks):
-        if not ks:
-            return
-        f = open(self.path("/etc/rpm/macros.imgcreate"), "w+")
-        if exclude_docs(ks):
-            f.write("%_excludedocs 1\n")
-        if not selinux_enabled(ks):
-            f.write("%__file_context_path %{nil}\n")
-        if inst_langs(ks) != None:
-            f.write("%_install_langs ")
-            f.write(inst_langs(ks))
-            f.write("\n")
-        f.close()
-
-class NetworkConfig(KickstartConfig):
-    """A class to apply a kickstart network configuration to a system."""
-    def write_ifcfg(self, network):
-        p = self.path("/etc/sysconfig/network-scripts/ifcfg-" + network.device)
-
-        f = file(p, "w+")
-        os.chmod(p, 0644)
-
-        f.write("DEVICE=%s\n" % network.device)
-        f.write("BOOTPROTO=%s\n" % network.bootProto)
-
-        if network.bootProto.lower() == "static":
-            if network.ip:
-                f.write("IPADDR=%s\n" % network.ip)
-            if network.netmask:
-                f.write("NETMASK=%s\n" % network.netmask)
-
-        if network.onboot:
-            f.write("ONBOOT=on\n")
-        else:
-            f.write("ONBOOT=off\n")
-
-        if network.essid:
-            f.write("ESSID=%s\n" % network.essid)
-
-        if network.ethtool:
-            if network.ethtool.find("autoneg") == -1:
-                network.ethtool = "autoneg off " + network.ethtool
-            f.write("ETHTOOL_OPTS=%s\n" % network.ethtool)
-
-        if network.bootProto.lower() == "dhcp":
-            if network.hostname:
-                f.write("DHCP_HOSTNAME=%s\n" % network.hostname)
-            if network.dhcpclass:
-                f.write("DHCP_CLASSID=%s\n" % network.dhcpclass)
-
-        if network.mtu:
-            f.write("MTU=%s\n" % network.mtu)
-
-        f.close()
-
-    def write_wepkey(self, network):
-        if not network.wepkey:
-            return
-
-        p = self.path("/etc/sysconfig/network-scripts/keys-" + network.device)
-        f = file(p, "w+")
-        os.chmod(p, 0600)
-        f.write("KEY=%s\n" % network.wepkey)
-        f.close()
-
-    def write_sysconfig(self, useipv6, hostname, gateway):
-        path = self.path("/etc/sysconfig/network")
-        f = file(path, "w+")
-        os.chmod(path, 0644)
-
-        f.write("NETWORKING=yes\n")
-
-        if useipv6:
-            f.write("NETWORKING_IPV6=yes\n")
-        else:
-            f.write("NETWORKING_IPV6=no\n")
-
-        if hostname:
-            f.write("HOSTNAME=%s\n" % hostname)
-        else:
-            f.write("HOSTNAME=localhost.localdomain\n")
-
-        if gateway:
-            f.write("GATEWAY=%s\n" % gateway)
-
-        f.close()
-
-    def write_hosts(self, hostname):
-        localline = ""
-        if hostname and hostname != "localhost.localdomain":
-            localline += hostname + " "
-            l = hostname.split(".")
-            if len(l) > 1:
-                localline += l[0] + " "
-        localline += "localhost.localdomain localhost"
-
-        path = self.path("/etc/hosts")
-        f = file(path, "w+")
-        os.chmod(path, 0644)
-        f.write("127.0.0.1\t\t%s\n" % localline)
-        f.write("::1\t\tlocalhost6.localdomain6 localhost6\n")
-        f.close()
-
-    def write_resolv(self, nodns, nameservers):
-        if nodns or not nameservers:
-            return
-
-        path = self.path("/etc/resolv.conf")
-        f = file(path, "w+")
-        os.chmod(path, 0644)
-
-        for ns in (nameservers):
-            if ns:
-                f.write("nameserver %s\n" % ns)
-
-        f.close()
-
-    def apply(self, ksnet):
-        fs.makedirs(self.path("/etc/sysconfig/network-scripts"))
-
-        useipv6 = False
-        nodns = False
-        hostname = None
-        gateway = None
-        nameservers = None
-
-        for network in ksnet.network:
-            if not network.device:
-                raise errors.KickstartError("No --device specified with "
-                                            "network kickstart command")
-
-            if (network.onboot and network.bootProto.lower() != "dhcp" and 
-                not (network.ip and network.netmask)):
-                raise errors.KickstartError("No IP address and/or netmask "
-                                            "specified with static "
-                                            "configuration for '%s'" %
-                                            network.device)
-
-            self.write_ifcfg(network)
-            self.write_wepkey(network)
-
-            if network.ipv6:
-                useipv6 = True
-            if network.nodns:
-                nodns = True
-
-            if network.hostname:
-                hostname = network.hostname
-            if network.gateway:
-                gateway = network.gateway
-
-            if network.nameserver:
-                nameservers = network.nameserver.split(",")
-
-        self.write_sysconfig(useipv6, hostname, gateway)
-        self.write_hosts(hostname)
-        self.write_resolv(nodns, nameservers)
-
-class SelinuxConfig(KickstartConfig):
-    """A class to apply a kickstart selinux configuration to a system."""
-    def relabel(self, ksselinux):
-        # touch some files which get unhappy if they're not labeled correctly
-        for fn in ("/etc/resolv.conf",):
-            path = self.path(fn)
-            f = file(path, "w+")
-            os.chmod(path, 0644)
-            f.close()
-
-        if ksselinux.selinux == ksconstants.SELINUX_DISABLED:
-            return
-
-        if not os.path.exists(self.path("/sbin/setfiles")):
-            return
-
-        self.call(["/sbin/setfiles", selinux.selinux_file_context_path(), "/"])
-
-    def apply(self, ksselinux):
-        if os.path.exists(self.path("/usr/sbin/lokkit")):
-            args = ["/usr/sbin/lokkit", "-f", "--quiet", "--nostart"]
-
-            if ksselinux.selinux == ksconstants.SELINUX_ENFORCING:
-                args.append("--selinux=enforcing")
-            if ksselinux.selinux == ksconstants.SELINUX_PERMISSIVE:
-                args.append("--selinux=permissive")
-            if ksselinux.selinux == ksconstants.SELINUX_DISABLED:
-                args.append("--selinux=disabled")
-
-            self.call(args)
-
-        self.relabel(ksselinux)
-
-def get_image_size(ks, default = None):
-    __size = 0
-    for p in ks.handler.partition.partitions:
-        if p.mountpoint == "/" and p.size:
-            __size = p.size
-    if __size > 0:
-        return int(__size) * 1024L * 1024L
-    else:
-        return default
-
-def get_image_fstype(ks, default = None):
-    for p in ks.handler.partition.partitions:
-        if p.mountpoint == "/" and p.fstype:
-            return p.fstype
-    return default
-
-def get_modules(ks):
-    devices = []
-    if not hasattr(ks.handler.device, "deviceList"):
-        devices.append(ks.handler.device)
-    else:
-        devices.extend(ks.handler.device.deviceList)
-
-    modules = []
-    for device in devices:
-        if not device.moduleName:
-            continue
-        modules.extend(device.moduleName.split(":"))
-
-    return modules
-
-def get_timeout(ks, default = None):
-    if not hasattr(ks.handler.bootloader, "timeout"):
-        return default
-    if ks.handler.bootloader.timeout is None:
-        return default
-    return int(ks.handler.bootloader.timeout)
-
-def get_kernel_args(ks, default = "ro liveimg quiet"):
-    if not hasattr(ks.handler.bootloader, "appendLine"):
-        return default
-    if ks.handler.bootloader.appendLine is None:
-        return default
-    return "%s %s" %(default, ks.handler.bootloader.appendLine)
-
-def get_default_kernel(ks, default = None):
-    if not hasattr(ks.handler.bootloader, "default"):
-        return default
-    if not ks.handler.bootloader.default:
-        return default
-    return ks.handler.bootloader.default
-
-def get_repos(ks, repo_urls = {}):
-    repos = {}
-    for repo in ks.handler.repo.repoList:
-        inc = []
-        if hasattr(repo, "includepkgs"):
-            inc.extend(repo.includepkgs)
-
-        exc = []
-        if hasattr(repo, "excludepkgs"):
-            exc.extend(repo.excludepkgs)
-
-        baseurl = repo.baseurl
-        mirrorlist = repo.mirrorlist
-        proxy = repo.proxy
-
-        if repo.name in repo_urls:
-            baseurl = repo_urls[repo.name]
-            mirrorlist = None
-
-        if repos.has_key(repo.name):
-            logging.warn("Overriding already specified repo %s" %(repo.name,))
-        repos[repo.name] = (repo.name, baseurl, mirrorlist, proxy, inc, exc)
-
-    return repos.values()
-
-def convert_method_to_repo(ks):
-    try:
-        ks.handler.repo.methodToRepo()
-    except (AttributeError, kserrors.KickstartError):
-        pass
-
-def get_packages(ks, required = []):
-    return ks.handler.packages.packageList + required
-
-def get_groups(ks, required = []):
-    return ks.handler.packages.groupList + required
-
-def get_excluded(ks, required = []):
-    return ks.handler.packages.excludedList + required
-
-def get_partitions(ks, required = []):
-    return ks.handler.partition.partitions
-
-def ignore_missing(ks):
-    return ks.handler.packages.handleMissing == ksconstants.KS_MISSING_IGNORE
-
-def exclude_docs(ks):
-    return ks.handler.packages.excludeDocs
-
-def inst_langs(ks):
-    if hasattr(ks.handler.packages, "instLange"):
-        return ks.handler.packages.instLange
-    elif hasattr(ks.handler.packages, "instLangs"):
-        return ks.handler.packages.instLangs
-    return ""
-
-def get_pre_scripts(ks):
-    scripts = []
-    for s in ks.handler.scripts:
-        if s.type != ksparser.KS_SCRIPT_PRE:
-            continue
-        scripts.append(s)
-    return scripts
-
-def get_post_scripts(ks):
-    scripts = []
-    for s in ks.handler.scripts:
-        if s.type != ksparser.KS_SCRIPT_POST:
-            continue
-        scripts.append(s)
-    return scripts
-
-def selinux_enabled(ks):
-    return ks.handler.selinux.selinux in (ksconstants.SELINUX_ENFORCING,
-                                          ksconstants.SELINUX_PERMISSIVE)
diff --git a/imgcreate/live.py b/imgcreate/live.py
deleted file mode 100644
index 8dc79ad..0000000
--- a/imgcreate/live.py
+++ /dev/null
@@ -1,918 +0,0 @@
-#
-# live.py : LiveImageCreator class for creating Live CD images
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import os.path
-import glob
-import shutil
-import subprocess
-import logging
-
-from imgcreate.errors import *
-from imgcreate.fs import *
-from imgcreate.creator import *
-
-class LiveImageCreatorBase(LoopImageCreator):
-    """A base class for LiveCD image creators.
-
-    This class serves as a base class for the architecture-specific LiveCD
-    image creator subclass, LiveImageCreator.
-
-    LiveImageCreator creates a bootable ISO containing the system image,
-    bootloader, bootloader configuration, kernel and initramfs.
-
-    """
-
-    def __init__(self, ks, name, fslabel=None, releasever=None):
-        """Initialise a LiveImageCreator instance.
-
-        This method takes the same arguments as LoopImageCreator.__init__().
-
-        """
-        LoopImageCreator.__init__(self, ks, name, fslabel=fslabel, releasever=releasever)
-
-        self.compress_type = "gzip"
-        """mksquashfs compressor to use."""
-
-        self.skip_compression = False
-        """Controls whether to use squashfs to compress the image."""
-
-        self.skip_minimize = False
-        """Controls whether an image minimizing snapshot should be created.
-
-        This snapshot can be used when copying the system image from the ISO in
-        order to minimize the amount of data that needs to be copied; simply,
-        it makes it possible to create a version of the image's filesystem with
-        no spare space.
-
-        """
-
-        self._timeout = kickstart.get_timeout(self.ks, 10)
-        """The bootloader timeout from kickstart."""
-
-        self._default_kernel = kickstart.get_default_kernel(self.ks, "kernel")
-        """The default kernel type from kickstart."""
-
-        self.__isodir = None
-
-        self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire",
-                          "=mmc", "=pcmcia", "mptsas", "udf", "virtio_blk",
-                          "virtio_pci"]
-        self.__modules.extend(kickstart.get_modules(self.ks))
-
-        self._isofstype = "iso9660"
-
-    #
-    # Hooks for subclasses
-    #
-    def _configure_bootloader(self, isodir):
-        """Create the architecture specific booloader configuration.
-
-        This is the hook where subclasses must create the booloader
-        configuration in order to allow a bootable ISO to be built.
-
-        isodir -- the directory where the contents of the ISO are to be staged
-
-        """
-        raise CreatorError("Bootloader configuration is arch-specific, "
-                           "but not implemented for this arch!")
-
-    def _get_kernel_options(self):
-        """Return a kernel options string for bootloader configuration.
-
-        This is the hook where subclasses may specify a set of kernel options
-        which should be included in the images bootloader configuration.
-
-        A sensible default implementation is provided.
-
-        """
-        r = kickstart.get_kernel_args(self.ks)
-        if os.path.exists(self._instroot + "/usr/bin/rhgb"):
-            r += " rhgb"
-        if os.path.exists(self._instroot + "/usr/bin/plymouth"):
-            r += " rhgb"
-        return r
-        
-    def _get_mkisofs_options(self, isodir):
-        """Return the architecture specific mkisosfs options.
-
-        This is the hook where subclasses may specify additional arguments to
-        mkisofs, e.g. to enable a bootable ISO to be built.
-
-        By default, an empty list is returned.
-
-        """
-        return []
-
-    #
-    # Helpers for subclasses
-    #
-    def _has_checkisomd5(self):
-        """Check whether checkisomd5 is available in the install root."""
-        def exists(instroot, path):
-            return os.path.exists(instroot + path)
-
-        if (exists(self._instroot, "/usr/lib/anaconda-runtime/checkisomd5") or
-            exists(self._instroot, "/usr/bin/checkisomd5")):
-            return True
-
-        return False
-
-    #
-    # Actual implementation
-    #
-    def _base_on(self, base_on):
-        """helper function to extract ext3 file system from a live CD ISO"""
-        isoloop = DiskMount(LoopbackDisk(base_on, 0), self._mkdtemp())
-
-        try:
-            isoloop.mount()
-        except MountError, e:
-            raise CreatorError("Failed to loopback mount '%s' : %s" %
-                               (base_on, e))
-
-        # legacy LiveOS filesystem layout support, remove for F9 or F10
-        if os.path.exists(isoloop.mountdir + "/squashfs.img"):
-            squashimg = isoloop.mountdir + "/squashfs.img"
-        else:
-            squashimg = isoloop.mountdir + "/LiveOS/squashfs.img"
-            
-        squashloop = DiskMount(LoopbackDisk(squashimg, 0), self._mkdtemp(), "squashfs")
-
-        try:
-            if not squashloop.disk.exists():
-                raise CreatorError("'%s' is not a valid live CD ISO : "
-                                   "squashfs.img doesn't exist" % base_on)
-
-            try:
-                squashloop.mount()
-            except MountError, e:
-                raise CreatorError("Failed to loopback mount squashfs.img "
-                                   "from '%s' : %s" % (base_on, e))
-
-            # legacy LiveOS filesystem layout support, remove for F9 or F10
-            if os.path.exists(squashloop.mountdir + "/os.img"):
-                os_image = squashloop.mountdir + "/os.img"
-            else:
-                os_image = squashloop.mountdir + "/LiveOS/ext3fs.img"
-
-            if not os.path.exists(os_image):
-                raise CreatorError("'%s' is not a valid live CD ISO : neither "
-                                   "LiveOS/ext3fs.img nor os.img exist" %
-                                   base_on)
-
-            try:
-                shutil.copyfile(os_image, self._image)
-            except IOError, e:
-                raise CreatorError("Failed to copy base live image to %s for modification: %s" %(self._image, e))
-        finally:
-            squashloop.cleanup()
-            isoloop.cleanup()
-
-    def _mount_instroot(self, base_on = None):
-        LoopImageCreator._mount_instroot(self, base_on)
-        self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
-        self.__write_dracut_conf(self._instroot + "/etc/dracut.conf")
-
-    def _unmount_instroot(self):
-        self.__restore_file(self._instroot + "/etc/sysconfig/mkinitrd")
-        self.__restore_file(self._instroot + "/etc/dracut.conf")
-        LoopImageCreator._unmount_instroot(self)
-
-    def __ensure_isodir(self):
-        if self.__isodir is None:
-            self.__isodir = self._mkdtemp("iso-")
-        return self.__isodir
-
-    def _generate_efiboot(self, isodir):
-        """Generate EFI boot images."""
-        if not os.path.exists(self._instroot + "/boot/efi/EFI/redhat/grub.efi"):
-            return False
-        logging.info("Creating efiboot.img")
-        subprocess.call(["mkefiboot", isodir + "/EFI/BOOT",
-                         isodir + "/isolinux/efiboot.img"])
-#        logging.info("Creating macboot.img")
-#        subprocess.call(["mkefiboot", "-a", isodir + "/EFI/BOOT",
-#                         isodir + "/isolinux/macboot.img"])
-
-    def _create_bootconfig(self):
-        """Configure the image so that it's bootable."""
-        self._configure_bootloader(self.__ensure_isodir())
-        self._generate_efiboot(self.__ensure_isodir())
-
-    def _get_post_scripts_env(self, in_chroot):
-        env = LoopImageCreator._get_post_scripts_env(self, in_chroot)
-
-        if not in_chroot:
-            env["LIVE_ROOT"] = self.__ensure_isodir()
-
-        return env
-
-    def __extra_filesystems(self):
-        return "squashfs ext4 ext3 ext2 vfat msdos ";
-
-    def __extra_drivers(self):
-        retval = "sr_mod sd_mod ide-cd cdrom "
-        for module in self.__modules:
-            if module == "=usb":
-                retval = retval + "ehci_hcd uhci_hcd ohci_hcd "
-                retval = retval + "usb_storage usbhid "
-            elif module == "=firewire":
-                retval = retval + "firewire-sbp2 firewire-ohci "
-                retval = retval + "sbp2 ohci1394 ieee1394 "
-            elif module == "=mmc":
-                retval = retval + "mmc_block sdhci sdhci-pci "
-            elif module == "=pcmcia":
-                retval = retval + "pata_pcmcia "
-            else:
-                retval = retval + module + " "
-        return retval
-
-    def __restore_file(self,path):
-        try:
-            os.unlink(path)
-        except:
-            pass
-        if os.path.exists(path + '.rpmnew'):
-            os.rename(path + '.rpmnew', path)
-
-    def __write_initrd_conf(self, path):
-        if not os.path.exists(os.path.dirname(path)):
-            makedirs(os.path.dirname(path))
-        f = open(path, "a")
-        f.write('LIVEOS="yes"\n')
-        f.write('PROBE="no"\n')
-        f.write('MODULES+="' + self.__extra_filesystems() + '"\n')
-        f.write('MODULES+="' + self.__extra_drivers() + '"\n')
-        f.close()
-
-    def __write_dracut_conf(self, path):
-        if not os.path.exists(os.path.dirname(path)):
-            makedirs(os.path.dirname(path))
-        f = open(path, "a")
-        f.write('filesystems+="' + self.__extra_filesystems() + ' "\n')
-        f.write('drivers+="' + self.__extra_drivers() + ' "\n')
-        f.write('add_dracutmodules+=" dmsquash-live "')
-        f.close()
-
-    def __create_iso(self, isodir):
-        iso = self._outdir + "/" + self.name + ".iso"
-
-        args = ["/usr/bin/mkisofs",
-                "-J", "-r",
-                "-hide-rr-moved", "-hide-joliet-trans-tbl",
-                "-V", self.fslabel,
-                "-o", iso]
-
-        args.extend(self._get_mkisofs_options(isodir))
-        if self._isofstype == "udf":
-            args.append("-allow-limited-size")
-
-        args.append(isodir)
-
-        if subprocess.call(args) != 0:
-            raise CreatorError("ISO creation failed!")
-
-        if os.path.exists("/usr/bin/isohybrid"):
-            args = ["/usr/bin/isohybrid"]
-            if os.path.exists(isodir + "/isolinux/efiboot.img"):
-                args.append("-u")
-#            if os.path.exists(isodir + "/isolinux/macboot.img"):
-#                args.append("-m")
-            args.append(iso)
-            if subprocess.call(args) != 0:
-                logging.warn("isohybrid failed")
-
-        self.__implant_md5sum(iso)
-
-    def __implant_md5sum(self, iso):
-        """Implant an isomd5sum."""
-        if os.path.exists("/usr/bin/implantisomd5"):
-            implantisomd5 = "/usr/bin/implantisomd5"
-        elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"):
-            implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5"
-        else:
-            logging.warn("isomd5sum not installed; not setting up mediacheck")
-            return
-
-        subprocess.call([implantisomd5, iso])
-
-    def _stage_final_image(self):
-        try:
-            makedirs(self.__ensure_isodir() + "/LiveOS")
-
-            self._resparse()
-
-            if not self.skip_minimize:
-                create_image_minimizer(self.__isodir + "/LiveOS/osmin.img", self._image, self.compress_type)
-
-            if self.skip_compression:
-                shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
-                if os.stat(self.__isodir + "/LiveOS/ext3fs.img").st_size >= 4*1024*1024*1024:
-                    self._isofstype = "udf"
-                    logging.warn("Switching to UDF due to size of LiveOS/ext3fs.img")
-            else:
-                makedirs(os.path.join(os.path.dirname(self._image), "LiveOS"))
-                shutil.move(self._image,
-                            os.path.join(os.path.dirname(self._image),
-                                         "LiveOS", "ext3fs.img"))
-                mksquashfs(os.path.dirname(self._image),
-                           self.__isodir + "/LiveOS/squashfs.img",
-                           self.compress_type)
-                if os.stat(self.__isodir + "/LiveOS/squashfs.img").st_size >= 4*1024*1024*1024:
-                    self._isofstype = "udf"
-                    logging.warn("Switching to UDF due to size of LiveOS/squashfs.img")
-
-
-            self.__create_iso(self.__isodir)
-        finally:
-            shutil.rmtree(self.__isodir, ignore_errors = True)
-            self.__isodir = None
-
-class x86LiveImageCreator(LiveImageCreatorBase):
-    """ImageCreator for x86 machines"""
-    def _get_mkisofs_options(self, isodir):
-        options = [ "-b", "isolinux/isolinux.bin",
-                    "-c", "isolinux/boot.cat",
-                    "-no-emul-boot", "-boot-info-table",
-                    "-boot-load-size", "4" ]
-        if os.path.exists(isodir + "/isolinux/efiboot.img"):
-            options.extend([ "-eltorito-alt-boot",
-                             "-e", "isolinux/efiboot.img",
-                             "-no-emul-boot"])
-        if os.path.exists(isodir + "/isolinux/macboot.img"):
-            options.extend([ "-eltorito-alt-boot",
-                             "-e", "isolinux/macboot.img",
-                             "-no-emul-boot"])
-        return options
-
-    def _get_required_packages(self):
-        return ["syslinux"] + LiveImageCreatorBase._get_required_packages(self)
-
-    def _get_isolinux_stanzas(self, isodir):
-        return ""
-
-    def __find_syslinux_menu(self):
-        for menu in ("vesamenu.c32", "menu.c32"):
-            for dir in ("/usr/lib/syslinux/", "/usr/share/syslinux/"):
-                if os.path.isfile(self._instroot + dir + menu):
-                    return menu
-
-        raise CreatorError("syslinux not installed : "
-                           "no suitable *menu.c32 found")
-
-    def __find_syslinux_mboot(self):
-        #
-        # We only need the mboot module if we have any xen hypervisors
-        #
-        if not glob.glob(self._instroot + "/boot/xen.gz*"):
-            return None
-
-        return "mboot.c32"
-
-    def __copy_syslinux_files(self, isodir, menu, mboot = None):
-        files = ["isolinux.bin", menu]
-        if mboot:
-            files += [mboot]
-
-        for f in files:
-            if os.path.exists(self._instroot + "/usr/lib/syslinux/" + f):
-                path = self._instroot + "/usr/lib/syslinux/" + f
-            elif os.path.exists(self._instroot + "/usr/share/syslinux/" + f):
-                path = self._instroot + "/usr/share/syslinux/" + f
-            if not os.path.isfile(path):
-                raise CreatorError("syslinux not installed : "
-                                   "%s not found" % path)
-
-            shutil.copy(path, isodir + "/isolinux/")
-
-    def __copy_syslinux_background(self, isodest):
-        background_path = self._instroot + \
-                          "/usr/share/anaconda/boot/syslinux-vesa-splash.jpg"
-
-        if not os.path.exists(background_path):
-            # fallback to F13 location
-            background_path = self._instroot + \
-                              "/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg"
-
-            if not os.path.exists(background_path):
-                return False
-
-        shutil.copyfile(background_path, isodest)
-
-        return True
-
-    def __copy_kernel_and_initramfs(self, isodir, version, index):
-        bootdir = self._instroot + "/boot"
-
-        shutil.copyfile(bootdir + "/vmlinuz-" + version,
-                        isodir + "/isolinux/vmlinuz" + index)
-
-        isDracut = False
-        if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
-            shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
-                            isodir + "/isolinux/initrd" + index + ".img")
-            isDracut = True
-        else:
-            shutil.copyfile(bootdir + "/initrd-" + version + ".img",
-                            isodir + "/isolinux/initrd" + index + ".img")
-
-        is_xen = False
-        if os.path.exists(bootdir + "/xen.gz-" + version[:-3]):
-            shutil.copyfile(bootdir + "/xen.gz-" + version[:-3],
-                            isodir + "/isolinux/xen" + index + ".gz")
-            is_xen = True
-
-        return (is_xen, isDracut)
-
-    def __is_default_kernel(self, kernel, kernels):
-        if len(kernels) == 1:
-            return True
-
-        if kernel == self._default_kernel:
-            return True
-
-        if kernel.startswith("kernel-") and kernel[7:] == self._default_kernel:
-            return True
-
-        return False
-
-    def __get_basic_syslinux_config(self, **args):
-        return """
-default %(menu)s
-timeout %(timeout)d
-
-%(background)s
-menu title Welcome to %(name)s!
-menu color border 0 #ffffffff #00000000
-menu color sel 7 #ffffffff #ff000000
-menu color title 0 #ffffffff #00000000
-menu color tabmsg 0 #ffffffff #00000000
-menu color unsel 0 #ffffffff #00000000
-menu color hotsel 0 #ff000000 #ffffffff
-menu color hotkey 7 #ffffffff #ff000000
-menu color timeout_msg 0 #ffffffff #00000000
-menu color timeout 0 #ffffffff #00000000
-menu color cmdline 0 #ffffffff #00000000
-menu hidden
-menu hiddenrow 5
-""" % args
-
-    def __get_image_stanza(self, is_xen, isDracut, **args):
-        if isDracut:
-            args["rootlabel"] = "live:CDLABEL=%(fslabel)s" % args
-        else:
-            args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
-
-        if not is_xen:
-            template = """label %(short)s
-  menu label %(long)s
-  kernel vmlinuz%(index)s
-  append initrd=initrd%(index)s.img root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s
-"""
-        else:
-            template = """label %(short)s
-  menu label %(long)s
-  kernel mboot.c32
-  append xen%(index)s.gz --- vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(xdriver)s %(extra)s --- initrd%(index)s.img
-"""
-        return template % args
-
-    def __get_image_stanzas(self, isodir):
-        versions = []
-        kernels = self._get_kernel_versions()
-        for kernel in kernels:
-            for version in kernels[kernel]:
-                versions.append(version)
-
-        kernel_options = self._get_kernel_options()
-
-        checkisomd5 = self._has_checkisomd5()
-
-        cfg = ""
-
-        index = "0"
-        for version in versions:
-            (is_xen, isDracut) = self.__copy_kernel_and_initramfs(isodir, version, index)
-            if index == "0":
-                self._isDracut = isDracut
-
-            default = self.__is_default_kernel(kernel, kernels)
-
-            if default:
-                long = "Boot"
-            elif kernel.startswith("kernel-"):
-                long = "Boot %s(%s)" % (self.name, kernel[7:])
-            else:
-                long = "Boot %s(%s)" % (self.name, kernel)
-
-            # Basic video driver
-            basic = "system with basic video driver"
-            xdriver = "xdriver=vesa nomodeset"
-
-
-            # tell dracut not to ask for LUKS passwords or activate mdraid sets
-            if isDracut:
-                kern_opts = kernel_options + " rd_NO_LUKS rd_NO_MD rd_NO_DM"
-            else:
-                kern_opts = kernel_options
-
-            cfg += self.__get_image_stanza(is_xen, isDracut,
-                                           fslabel = self.fslabel,
-                                           isofstype = "auto",
-                                           liveargs = kern_opts,
-                                           long = long,
-                                           short = "linux" + index,
-                                           basicvideo = "",
-                                           xdriver = "",
-                                           extra = "",
-                                           index = index)
-
-            if default:
-                cfg += "menu default\n"
-
-            cfg += self.__get_image_stanza(is_xen, isDracut,
-                                           fslabel = self.fslabel,
-                                           isofstype = "auto",
-                                           liveargs = kern_opts,
-                                           long = long + " (Basic Video)",
-                                           short = "linux" + index,
-                                           basicvideo = basic,
-                                           xdriver = xdriver,
-                                           extra = "",
-                                           index = index)
-
-            if checkisomd5:
-                cfg += self.__get_image_stanza(is_xen, isDracut,
-                                               fslabel = self.fslabel,
-                                               isofstype = "auto",
-                                               liveargs = kern_opts,
-                                               long = "Verify and " + long,
-                                               short = "check" + index,
-                                               basicvideo = "",
-                                               xdriver = "",
-                                               extra = "check",
-                                               index = index)
-
-            index = str(int(index) + 1)
-
-        return cfg
-
-    def __get_memtest_stanza(self, isodir):
-        memtest = glob.glob(self._instroot + "/boot/memtest86*")
-        if not memtest:
-            return ""
-
-        shutil.copyfile(memtest[0], isodir + "/isolinux/memtest")
-
-        return """label memtest
-  menu label Memory Test
-  kernel memtest
-"""
-
-    def __get_local_stanza(self, isodir):
-        return """label local
-  menu label Boot from local drive
-  localboot 0xffff
-"""
-
-    def _configure_syslinux_bootloader(self, isodir):
-        """configure the boot loader"""
-        makedirs(isodir + "/isolinux")
-
-        menu = self.__find_syslinux_menu()
-
-        self.__copy_syslinux_files(isodir, menu,
-                                   self.__find_syslinux_mboot())
-
-        background = ""
-        if self.__copy_syslinux_background(isodir + "/isolinux/splash.jpg"):
-            background = "menu background splash.jpg"
-
-        cfg = self.__get_basic_syslinux_config(menu = menu,
-                                               background = background,
-                                               name = self.name,
-                                               timeout = self._timeout * 10)
-
-        cfg += self.__get_image_stanzas(isodir)
-        cfg += self.__get_memtest_stanza(isodir)
-        cfg += self.__get_local_stanza(isodir)
-        cfg += self._get_isolinux_stanzas(isodir)
-
-        cfgf = open(isodir + "/isolinux/isolinux.cfg", "w")
-        cfgf.write(cfg)
-        cfgf.close()
-
-    def __copy_efi_files(self, isodir):
-        if not os.path.exists(self._instroot + "/boot/efi/EFI/redhat/grub.efi"):
-            return False
-        shutil.copy(self._instroot + "/boot/efi/EFI/redhat/grub.efi",
-                    isodir + "/EFI/BOOT/grub.efi")
-        shutil.copy(self._instroot + "/boot/grub/splash.xpm.gz",
-                    isodir + "/EFI/BOOT/splash.xpm.gz")
-
-        return True
-
-    def __get_basic_efi_config(self, **args):
-        return """
-default=0
-splashimage=/EFI/BOOT/splash.xpm.gz
-timeout %(timeout)d
-hiddenmenu
-
-""" %args
-
-    def __get_efi_image_stanza(self, **args):
-        if self._isDracut:
-            args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
-        else:
-            args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
-        return """title %(long)s
-  kernel /EFI/boot/vmlinuz%(index)s root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s
-  initrd /EFI/boot/initrd%(index)s.img
-""" %args
-
-    def __get_efi_image_stanzas(self, isodir, name):
-        # FIXME: this only supports one kernel right now...
-
-        kernel_options = self._get_kernel_options()
-        checkisomd5 = self._has_checkisomd5()
-
-        cfg = ""
-
-        for index in range(0, 9):
-            # we don't support xen kernels
-            if os.path.exists("%s/EFI/BOOT/xen%d.gz" %(isodir, index)):
-                continue
-            cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
-                                               isofstype = "auto",
-                                               liveargs = kernel_options,
-                                               long = name,
-                                               extra = "", index = index)
-            if checkisomd5:
-                cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
-                                                   isofstype = "auto",
-                                                   liveargs = kernel_options,
-                                                   long = "Verify and Boot " + name,
-                                                   extra = "check",
-                                                   index = index)
-            break
-
-        return cfg
-
-    def _configure_efi_bootloader(self, isodir):
-        """Set up the configuration for an EFI bootloader"""
-        makedirs(isodir + "/EFI/BOOT")
-
-        if not self.__copy_efi_files(isodir):
-            shutil.rmtree(isodir + "/EFI")
-            return
-
-        for f in os.listdir(isodir + "/isolinux"):
-            os.link("%s/isolinux/%s" %(isodir, f),
-                    "%s/EFI/BOOT/%s" %(isodir, f))
-
-
-        cfg = self.__get_basic_efi_config(name = self.name,
-                                          timeout = self._timeout)
-        cfg += self.__get_efi_image_stanzas(isodir, self.name)
-
-        cfgf = open(isodir + "/EFI/BOOT/grub.conf", "w")
-        cfgf.write(cfg)
-        cfgf.close()
-
-        # first gen mactel machines get the bootloader name wrong apparently
-        if rpmUtils.arch.getBaseArch() == "i386":
-            os.link(isodir + "/EFI/BOOT/grub.efi", isodir + "/EFI/BOOT/BOOT.efi")
-            os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT.conf")
-
-        # for most things, we want them named boot$efiarch
-        efiarch = {"i386": "IA32", "x86_64": "X64"}
-        efiname = efiarch[rpmUtils.arch.getBaseArch()]
-        os.rename(isodir + "/EFI/BOOT/grub.efi", isodir + "/EFI/BOOT/BOOT%s.efi" %(efiname,))
-        os.link(isodir + "/EFI/BOOT/grub.conf", isodir + "/EFI/BOOT/BOOT%s.conf" %(efiname,))
-
-
-    def _configure_bootloader(self, isodir):
-        self._configure_syslinux_bootloader(isodir)
-        self._configure_efi_bootloader(isodir)
-
-class ppcLiveImageCreator(LiveImageCreatorBase):
-    def _get_mkisofs_options(self, isodir):
-        return [ "-hfs", "-no-desktop", "-part",
-                 "-map", isodir + "/ppc/mapping",
-                 "-hfs-bless", isodir + "/ppc/mac",
-                 "-hfs-volid", self.fslabel ]
-
-    def _get_required_packages(self):
-        return ["yaboot"] + \
-               LiveImageCreatorBase._get_required_packages(self)
-
-    def _get_excluded_packages(self):
-        # kind of hacky, but exclude memtest86+ on ppc so it can stay in cfg
-        return ["memtest86+"] + \
-               LiveImageCreatorBase._get_excluded_packages(self)
-
-    def __copy_boot_file(self, destdir, file):
-        for dir in ["/usr/share/ppc64-utils",
-                    "/usr/lib/anaconda-runtime/boot"]:
-            path = self._instroot + dir + "/" + file
-            if not os.path.exists(path):
-                continue
-            
-            makedirs(destdir)
-            shutil.copy(path, destdir)
-            return
-
-        raise CreatorError("Unable to find boot file " + file)
-
-    def __kernel_bits(self, kernel):
-        testpath = (self._instroot + "/lib/modules/" +
-                    kernel + "/kernel/arch/powerpc/platforms")
-
-        if not os.path.exists(testpath):
-            return { "32" : True, "64" : False }
-        else:
-            return { "32" : False, "64" : True }
-
-    def __copy_kernel_and_initramfs(self, destdir, version):
-        isDracut = False
-        bootdir = self._instroot + "/boot"
-
-        makedirs(destdir)
-
-        shutil.copyfile(bootdir + "/vmlinuz-" + version,
-                        destdir + "/vmlinuz")
-
-        if os.path.exists(bootdir + "/initramfs-" + version + ".img"):
-            shutil.copyfile(bootdir + "/initramfs-" + version + ".img",
-                            destdir + "/initrd.img")
-            isDracut = True
-        else:
-            shutil.copyfile(bootdir + "/initrd-" + version + ".img",
-                            destdir + "/initrd.img")
-
-        return isDracut
-
-    def __get_basic_yaboot_config(self, **args):
-        return """
-init-message = "Welcome to %(name)s"
-timeout=%(timeout)d
-""" % args
-
-    def __get_image_stanza(self, **args):
-        if args["isDracut"]:
-            args["rootlabel"] = "live:LABEL=%(fslabel)s" % args
-        else:
-            args["rootlabel"] = "CDLABEL=%(fslabel)s" % args
-        return """
-
-image=/ppc/ppc%(bit)s/vmlinuz
-  label=%(short)s
-  initrd=/ppc/ppc%(bit)s/initrd.img
-  read-only
-  append="root=%(rootlabel)s rootfstype=%(isofstype)s %(liveargs)s %(extra)s"
-""" % args
-
-
-    def __write_yaboot_config(self, isodir, bit, isDracut = False):
-        cfg = self.__get_basic_yaboot_config(name = self.name,
-                                             timeout = self._timeout * 100)
-
-        kernel_options = self._get_kernel_options()
-
-        cfg += self.__get_image_stanza(fslabel = self.fslabel,
-                                       isofstype = "auto",
-                                       short = "linux",
-                                       long = "Run from image",
-                                       extra = "",
-                                       bit = bit,
-                                       liveargs = kernel_options,
-                                       isDracut = isDracut)
-
-        if self._has_checkisomd5():
-            cfg += self.__get_image_stanza(fslabel = self.fslabel,
-                                           isofstype = "auto",
-                                           short = "check",
-                                           long = "Verify and run from image",
-                                           extra = "check",
-                                           bit = bit,
-                                           liveargs = kernel_options,
-                                           isDracut = isDracut)
-
-        f = open(isodir + "/ppc/ppc" + bit + "/yaboot.conf", "w")
-        f.write(cfg)
-        f.close()
-
-    def __write_not_supported(self, isodir, bit):
-        makedirs(isodir + "/ppc/ppc" + bit)
-
-        message = "Sorry, this LiveCD does not support your hardware"
-
-        f = open(isodir + "/ppc/ppc" + bit + "/yaboot.conf", "w")
-        f.write('init-message = "' + message + '"')
-        f.close()
-
-
-    def __write_dualbits_yaboot_config(isodir, **args):
-        cfg = """
-init-message = "\nWelcome to %(name)s!\nUse 'linux32' for 32-bit kernel.\n\n"
-timeout=%(timeout)d
-default=linux
-
-image=/ppc/ppc64/vmlinuz
-	label=linux64
-	alias=linux
-	initrd=/ppc/ppc64/initrd.img
-	read-only
-
-image=/ppc/ppc32/vmlinuz
-	label=linux32
-	initrd=/ppc/ppc32/initrd.img
-	read-only
-""" % args
-
-        f = open(isodir + "/etc/yaboot.conf", "w")
-        f.write(cfg)
-        f.close()
-
-    def _configure_bootloader(self, isodir):
-        """configure the boot loader"""
-        havekernel = { 32: False, 64: False }
-
-        self.__copy_boot_file(isodir + "/ppc", "mapping")
-        self.__copy_boot_file(isodir + "/ppc", "bootinfo.txt")
-        self.__copy_boot_file(isodir + "/ppc/mac", "ofboot.b")
-
-        shutil.copyfile(self._instroot + "/usr/lib/yaboot/yaboot",
-                        isodir + "/ppc/mac/yaboot")
-
-        makedirs(isodir + "/ppc/chrp")
-        shutil.copyfile(self._instroot + "/usr/lib/yaboot/yaboot",
-                        isodir + "/ppc/chrp/yaboot")
-
-        subprocess.call(["/usr/sbin/addnote", isodir + "/ppc/chrp/yaboot"])
-
-        #
-        # FIXME: ppc should support multiple kernels too...
-        #
-        kernel = self._get_kernel_versions().values()[0][0]
-
-        kernel_bits = self.__kernel_bits(kernel)
-
-        for (bit, present) in kernel_bits.items():
-            if not present:
-                self.__write_not_supported(isodir, bit)
-                continue
-
-            isDracut = self.__copy_kernel_and_initramfs(isodir + "/ppc/ppc" + bit, kernel)
-            self.__write_yaboot_config(isodir, bit, isDracut)
-
-        makedirs(isodir + "/etc")
-        if kernel_bits["32"] and not kernel_bits["64"]:
-            shutil.copyfile(isodir + "/ppc/ppc32/yaboot.conf",
-                            isodir + "/etc/yaboot.conf")
-        elif kernel_bits["64"] and not kernel_bits["32"]:
-            shutil.copyfile(isodir + "/ppc/ppc64/yaboot.conf",
-                            isodir + "/etc/yaboot.conf")
-        else:
-            self.__write_dualbits_yaboot_config(isodir,
-                                                name = self.name,
-                                                timeout = self._timeout * 100)
-
-        #
-        # FIXME: build 'netboot' images with kernel+initrd, like mk-images.ppc
-        #
-
-class ppc64LiveImageCreator(ppcLiveImageCreator):
-    def _get_excluded_packages(self):
-        # FIXME:
-        #   while kernel.ppc and kernel.ppc64 co-exist,
-        #   we can't have both
-        return ["kernel.ppc"] + \
-               ppcLiveImageCreator._get_excluded_packages(self)
-
-arch = rpmUtils.arch.getBaseArch()
-if arch in ("i386", "x86_64"):
-    LiveImageCreator = x86LiveImageCreator
-elif arch in ("ppc",):
-    LiveImageCreator = ppcLiveImageCreator
-elif arch in ("ppc64",):
-    LiveImageCreator = ppc64LiveImageCreator
-else:
-    raise CreatorError("Architecture not supported!")
diff --git a/imgcreate/sysutils.py b/imgcreate/sysutils.py
deleted file mode 100644
index d35906c..0000000
--- a/imgcreate/sysutils.py
+++ /dev/null
@@ -1,108 +0,0 @@
-#
-# sysutils.py
-#
-# Copyright (C) 2009  Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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/>.
-#
-# Red Hat Author(s):  Martin Gracik <mgracik at redhat.com>
-#
-
-__all__ = ["joinpaths", "touch", "replace", "chown_", "chmod_", "remove",
-           "linktree"]
-
-import sys
-import os
-import re
-import fileinput
-import pwd
-import grp
-import glob
-import shutil
-import subprocess
-
-
-def joinpaths(*args, **kwargs):
-    path = os.path.sep.join(args)
-
-    if kwargs.get("follow_symlinks"):
-        return os.path.realpath(path)
-    else:
-        return path
-
-
-def touch(fname):
-    with open(fname, "w") as _:
-        pass
-
-
-def replace(fname, find, replace):
-    fin = fileinput.input(fname, inplace=1)
-    pattern = re.compile(find)
-
-    for line in fin:
-        line = pattern.sub(replace, line)
-        sys.stdout.write(line)
-
-    fin.close()
-
-
-def chown_(path, user=None, group=None, recursive=False):
-    uid = gid = -1
-
-    if user is not None:
-        uid = pwd.getpwnam(user)[2]
-    if group is not None:
-        gid = grp.getgrnam(group)[2]
-
-    for fname in glob.iglob(path):
-        os.chown(fname, uid, gid)
-
-        if recursive and os.path.isdir(fname):
-            for nested in os.listdir(fname):
-                nested = joinpaths(fname, nested)
-                chown_(nested, user, group, recursive)
-
-
-def chmod_(path, mode, recursive=False):
-    for fname in glob.iglob(path):
-        os.chmod(fname, mode)
-
-        if recursive and os.path.isdir(fname):
-            for nested in os.listdir(fname):
-                nested = joinpaths(fname, nested)
-                chmod_(nested, mode, recursive)
-
-
-def cpfile(src, dst):
-    shutil.copy2(src, dst)
-    if os.path.isdir(dst):
-        dst = joinpaths(dst, os.path.basename(src))
-
-    return dst
-
-def mvfile(src, dst):
-    if os.path.isdir(dst):
-        dst = joinpaths(dst, os.path.basename(src))
-    os.rename(src, dst)
-    return dst
-
-def remove(target):
-    if os.path.isdir(target) and not os.path.islink(target):
-        shutil.rmtree(target)
-    else:
-        os.unlink(target)
-
-def linktree(src, dst):
-    subprocess.check_call(["/bin/cp", "-al", src, dst])
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
deleted file mode 100644
index 721a2d0..0000000
--- a/imgcreate/yuminst.py
+++ /dev/null
@@ -1,218 +0,0 @@
-#
-# yum.py : yum utilities
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import glob
-import os
-import sys
-import logging
-
-import yum
-import rpmUtils
-import pykickstart.parser
-
-from imgcreate.errors import *
-
-class TextProgress(object):
-    def start(self, filename, url, *args, **kwargs):
-        sys.stdout.write("Retrieving %s " % (url,))
-        self.url = url
-    def update(self, *args):
-        pass
-    def end(self, *args):
-        sys.stdout.write("...OK\n")
-
-class LiveCDYum(yum.YumBase):
-    def __init__(self, releasever=None):
-        """
-        releasever = optional value to use in replacing $releasever in repos
-        """
-        yum.YumBase.__init__(self)
-        self.releasever = releasever
-
-    def doFileLogSetup(self, uid, logfile):
-        # don't do the file log for the livecd as it can lead to open fds
-        # being left and an inability to clean up after ourself
-        pass
-
-    def close(self):
-        try:
-            os.unlink(self.conf.installroot + "/yum.conf")
-        except:
-            pass
-        yum.YumBase.close(self)
-
-    def __del__(self):
-        pass
-
-    def _writeConf(self, confpath, installroot):
-        conf  = "[main]\n"
-        conf += "installroot=%s\n" % installroot
-        conf += "cachedir=/var/cache/yum\n"
-        conf += "plugins=0\n"
-        conf += "reposdir=\n"
-        conf += "failovermethod=priority\n"
-        conf += "keepcache=1\n"
-
-        f = file(confpath, "w+")
-        f.write(conf)
-        f.close()
-
-        os.chmod(confpath, 0644)
-
-    def _cleanupRpmdbLocks(self, installroot):
-        # cleans up temporary files left by bdb so that differing
-        # versions of rpm don't cause problems
-        for f in glob.glob(installroot + "/var/lib/rpm/__db*"):
-            os.unlink(f)
-
-    def setup(self, confpath, installroot):
-        self._writeConf(confpath, installroot)
-        self._cleanupRpmdbLocks(installroot)
-        self.doConfigSetup(fn = confpath, root = installroot)
-        self.conf.cache = 0
-        self.doTsSetup()
-        self.doRpmDBSetup()
-        self.doRepoSetup()
-        self.doSackSetup()
-
-    def selectPackage(self, pkg):
-        """Select a given package.  Can be specified with name.arch or name*"""
-        return self.install(pattern = pkg)
-        
-    def deselectPackage(self, pkg):
-        """Deselect package.  Can be specified as name.arch or name*"""
-        sp = pkg.rsplit(".", 2)
-        txmbrs = []
-        if len(sp) == 2:
-            txmbrs = self.tsInfo.matchNaevr(name=sp[0], arch=sp[1])
-
-        if len(txmbrs) == 0:
-            exact, match, unmatch = yum.packages.parsePackages(self.pkgSack.returnPackages(), [pkg], casematch=1)
-            for p in exact + match:
-                txmbrs.append(p)
-
-        if len(txmbrs) > 0:
-            for x in txmbrs:
-                self.tsInfo.remove(x.pkgtup)
-                # we also need to remove from the conditionals
-                # dict so that things don't get pulled back in as a result
-                # of them.  yes, this is ugly.  conditionals should die.
-                for req, pkgs in self.tsInfo.conditionals.iteritems():
-                    if x in pkgs:
-                        pkgs.remove(x)
-                        self.tsInfo.conditionals[req] = pkgs
-        else:
-            logging.warn("No such package %s to remove" %(pkg,))
-
-    def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT):
-        # default to getting mandatory and default packages from a group
-        # unless we have specific options from kickstart
-        package_types = ['mandatory', 'default']
-        if include == pykickstart.parser.GROUP_REQUIRED:
-            package_types.remove('default')
-        elif include == pykickstart.parser.GROUP_ALL:
-            package_types.append('optional')
-        yum.YumBase.selectGroup(self, grp, group_package_types=package_types)
-
-    def addRepository(self, name, url = None, mirrorlist = None):
-        def _varSubstitute(option):
-            # takes a variable and substitutes like yum configs do
-            option = option.replace("$basearch", rpmUtils.arch.getBaseArch())
-            option = option.replace("$arch", rpmUtils.arch.getCanonArch())
-            # If the url includes $releasever substitute user's value or
-            # current system's version.
-            if option.find("$releasever") > -1:
-                if self.releasever:
-                    option = option.replace("$releasever", self.releasever)
-                else:
-                    try:
-                        option = option.replace("$releasever", yum.config._getsysver("/", "redhat-release"))
-                    except yum.Errors.YumBaseError:
-                        raise CreatorError("$releasever in repo url, but no releasever set")
-            return option
-
-        repo = yum.yumRepo.YumRepository(name)
-        if url:
-            repo.baseurl.append(_varSubstitute(url))
-        if mirrorlist:
-            repo.mirrorlist = _varSubstitute(mirrorlist)
-        conf = yum.config.RepoConf()
-        for k, v in conf.iteritems():
-            if v or not hasattr(repo, k):
-                repo.setAttribute(k, v)
-        repo.basecachedir = self.conf.cachedir
-        repo.failovermethod = "priority"
-        repo.metadata_expire = 0
-        repo.mirrorlist_expire = 0
-        repo.timestamp_check = 0
-        # disable gpg check???
-        repo.gpgcheck = 0
-        repo.enable()
-        repo.setup(0)
-        repo.setCallback(TextProgress())
-        self.repos.add(repo)
-        return repo
-
-    def installHasFile(self, file):
-        provides_pkg = self.whatProvides(file, None, None)
-        dlpkgs = map(lambda x: x.po, filter(lambda txmbr: txmbr.ts_state in ("i", "u"), self.tsInfo.getMembers()))
-        for p in dlpkgs:
-            for q in provides_pkg:
-                if (p == q):
-                    return True
-        return False
-
-            
-    def runInstall(self):
-        os.environ["HOME"] = "/"
-        try:
-            (res, resmsg) = self.buildTransaction()
-        except yum.Errors.RepoError, e:
-            raise CreatorError("Unable to download from repo : %s" %(e,))
-        # Empty transactions are generally fine, we might be rebuilding an
-        # existing image with no packages added
-        if resmsg and resmsg[0].endswith(" - empty transaction"):
-            return res
-        if res != 2:
-            raise CreatorError("Failed to build transaction : %s" % str.join("\n", resmsg))
-        
-        dlpkgs = map(lambda x: x.po, filter(lambda txmbr: txmbr.ts_state in ("i", "u"), self.tsInfo.getMembers()))
-        self.downloadPkgs(dlpkgs)
-        # FIXME: sigcheck?
-        
-        self.initActionTs()
-        self.populateTs(keepold=0)
-        deps = self.ts.check()
-        if len(deps) != 0:
-            raise CreatorError("Dependency check failed!")
-        rc = self.ts.order()
-        if rc != 0:
-            raise CreatorError("ordering packages for installation failed!")
-
-        # FIXME: callback should be refactored a little in yum 
-        sys.path.append('/usr/share/yum-cli')
-        import yum.misc
-        yum.misc.setup_locale()
-        import callback
-        cb = callback.RPMInstallCallback()
-        cb.tsInfo = self.tsInfo
-        cb.filelog = False
-        ret = self.runTransaction(cb)
-        print ""
-        self._cleanupRpmdbLocks(self.conf.installroot)
-        return ret
diff --git a/tools/edit-livecd b/tools/edit-livecd
deleted file mode 100755
index 673da89..0000000
--- a/tools/edit-livecd
+++ /dev/null
@@ -1,711 +0,0 @@
-#!/usr/bin/python -tt
-#
-# edit-liveos: Edit a LiveOS to insert files or to clone an instance onto a new
-#                   iso image file.
-#
-# Copyright 2009, Red Hat  Inc.
-# Written by Perry Myers <pmyers at redhat.com> & David Huff <dhuff at redhat.com>
-#   Cloning code added by Frederick Grose <fgrose at sugarlabs.org>
-#
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import stat
-import tempfile
-import shutil
-import subprocess
-import optparse
-import logging
-import rpm
-import glob
-
-from imgcreate.debug import *
-from imgcreate.errors import *
-from imgcreate.fs import *
-from imgcreate.live import *
-from imgcreate.creator import *
-import imgcreate.kickstart as kickstart
-from imgcreate import read_kickstart
-
-class ExistingSparseLoopbackDisk(SparseLoopbackDisk):
-    """don't want to expand the disk"""
-    def __init__(self, lofile, size):
-        SparseLoopbackDisk.__init__(self, lofile, size)
-
-    def create(self):
-        #self.expand(create = True)
-        LoopbackDisk.create(self)
-
-class LiveImageEditor(LiveImageCreator):
-    """class for editing LiveOS images.
-
-    We need an instance of LiveImageCreator, however, we do not have a kickstart
-    file and we may not need to create a new image.  We just want to reuse some
-    of LiveImageCreators methods on an existing LiveOS image.
-
-    """
-
-    def __init__(self, name):
-        """Initialize a LiveImageEditor instance.
-
-        creates a dummy instance of LiveImageCreator
-        We do not initialize any sub classes b/c we have no ks file.
-
-        """
-        self.name = name
-
-        self.tmpdir = "/var/tmp"
-        """The directory in which all temporary files will be created."""
-
-        self.clone = False
-        """Signals when to copy a running LiveOS image as base."""
-
-        self._include = None
-        """A string of file or directory paths to include in __copy_img_root."""
-
-        self._builder = os.getlogin()
-        """The name of the Remix builder for _branding.
-        Default = os.getlogin()"""
-
-        self.compress_type = None
-        """mksquashfs compressor to use. Use 'None' to force reading of the
-        existing image, or enter a -p --compress_type value to override the
-        current compression or lack thereof. Compression type options vary with
-        the version of the kernel and SquashFS used."""
-
-        self.skip_compression = False
-        """Controls whether to use squashfs to compress the image."""
-
-        self.skip_minimize = False
-        """Controls whether an image minimizing snapshot should be created."""
-
-        self._isofstype = "iso9660"
-        self.__isodir = None
-
-        self._ImageCreator__builddir = None
-        """working directory"""
-
-        self._ImageCreator_outdir = None
-        """where final iso gets written"""
-
-        self._ImageCreator__bindmounts = []
-
-        self._LoopImageCreator__blocksize = 4096
-        self._LoopImageCreator__fslabel = None
-        self._LoopImageCreator__instloop = None
-        self._LoopImageCreator__fstype = None
-        self._LoopImageCreator__image_size = None
-
-        self.__instroot = None
-
-        self._LiveImageCreatorBase__isodir = None
-        """directory where the iso is staged"""
-
-        self.ks = None
-        """optional kickstart file as a recipe for editing the image"""
-
-    # properties
-    def __get_image(self):
-        if self._LoopImageCreator__imagedir is None:
-            self.__ensure_builddir()
-            self._LoopImageCreator__imagedir = \
-                tempfile.mkdtemp(dir = os.path.abspath(self.tmpdir),
-                                                       prefix = self.name + "-")
-        rtn = self._LoopImageCreator__imagedir + "/ext3fs.img"
-        return rtn
-    _image = property(__get_image)
-    """The location of the filesystem image file."""
-
-    def _get_fslabel(self):
-        dev_null = os.open("/dev/null", os.O_WRONLY)
-        try:
-            out = subprocess.Popen(["/sbin/e2label", self._image],
-                                   stdout = subprocess.PIPE,
-                                   stderr = dev_null).communicate()[0]
-
-            self._LoopImageCreator__fslabel = out.strip()
-
-        except IOError, e:
-            raise CreatorError("Failed to determine fsimage LABEL: %s" % e )
-        finally:
-            os.close(dev_null)
-
-    def __ensure_builddir(self):
-        if not self._ImageCreator__builddir is None:
-            return
-
-        try:
-            self._ImageCreator__builddir = tempfile.mkdtemp(dir =  os.path.abspath(self.tmpdir),
-                                               prefix = "edit-liveos-")
-        except OSError, (err, msg):
-            raise CreatorError("Failed create build directory in %s: %s" %
-                               (self.tmpdir, msg))
-
-    def _run_script(self, script):
-
-        (fd, path) = tempfile.mkstemp(prefix = "script-",
-                                          dir = self._instroot + "/tmp")
-
-        logging.debug("copying script to install root: %s" % path)
-        shutil.copy(os.path.abspath(script), path)
-        os.close(fd)
-        os.chmod(path, 0700)
-
-        script = "/tmp/" + os.path.basename(path)
-
-        try:
-            subprocess.call([script], preexec_fn = self._chroot)
-        except OSError, e:
-            raise CreatorError("Failed to execute script %s, %s " % (script, e))
-        finally:
-            os.unlink(path)
-
-    def mount(self, base_on, cachedir = None):
-        """mount existing file system.
-
-        We have to override mount b/c we many not be creating an new install
-        root nor do we need to setup the file system, i.e., makedirs(/etc/,
-        /boot, ...), nor do we want to overwrite fstab, or create selinuxfs.
-
-        We also need to get some info about the image before we can mount it.
-
-        base_on --  the <LIVEIMG.src> a LiveOS.iso file or an attached LiveOS
-                    device, such as, /dev/live for a currently running image.
-
-        cachedir -- a directory in which to store a Yum cache;
-                    Not used in edit-liveos.
-
-        """
-
-        if not base_on:
-            raise CreatorError("No base LiveOS image specified.")
-
-        self.__ensure_builddir()
-
-        self._ImageCreator_instroot = self._ImageCreator__builddir + "/install_root"
-        self._LoopImageCreator__imagedir = self._ImageCreator__builddir + "/ex"
-        self._ImageCreator_outdir = self._ImageCreator__builddir + "/out"
-
-        makedirs(self._ImageCreator_instroot)
-        makedirs(self._LoopImageCreator__imagedir)
-        makedirs(self._ImageCreator_outdir)
-
-        if self.clone:
-            # Need to clone base_on into ext3fs.img at this point
-            self._LoopImageCreator__fslabel = self.name
-            self._base_on(base_on)
-        else:
-            LiveImageCreator._base_on(self, base_on)
-            self._LoopImageCreator__fstype = get_fsvalue(self._image, 'TYPE')
-            self._get_fslabel()
-
-        self.fslabel = self._LoopImageCreator__fslabel
-        if self._LoopImageCreator__image_size == None:
-            self._LoopImageCreator__image_size = os.stat(self._image)[stat.ST_SIZE]
-
-        self._LoopImageCreator__instloop = ExtDiskMount(
-                ExistingSparseLoopbackDisk(self._image,
-                                           self._LoopImageCreator__image_size),
-                self._ImageCreator_instroot,
-                self._fstype,
-                self._LoopImageCreator__blocksize,
-                self.fslabel,
-                self.tmpdir)
-        try:
-            self._LoopImageCreator__instloop.mount()
-        except MountError, e:
-            raise CreatorError("Failed to loopback mount '%s' : %s" %
-                               (self._image, e))
-
-        cachesrc = cachedir or (self._ImageCreator__builddir + "/yum-cache")
-        makedirs(cachesrc)
-
-        for (f, dest) in [("/sys", None), ("/proc", None),
-                          ("/dev/pts", None), ("/dev/shm", None),
-                          (cachesrc, "/var/cache/yum")]:
-            self._ImageCreator__bindmounts.append(BindChrootMount(f, self._instroot, dest))
-
-        self._do_bindmounts()
-
-        os.symlink("../proc/mounts", self._instroot + "/etc/mtab")
-
-        self.__copy_img_root(base_on)
-        self._brand(self._builder)
-
-    def _base_on(self, base_on):
-        """Clone the running LiveOS image as the basis for the new image."""
-
-        self.__fstype = 'ext4'
-        self.__image_size = 4096L * 1024 * 1024
-        self.__blocksize = 4096
-
-        self.__instloop = ExtDiskMount(SparseLoopbackDisk(self._image,
-                                                          self.__image_size),
-                                       self._instroot,
-                                       self.__fstype,
-                                       self.__blocksize,
-                                       self.fslabel,
-                                       self.tmpdir)
-        try:
-            self.__instloop.mount()
-        except MountError, e:
-            raise CreatorError("Failed to loopback mount '%s' : %s" %
-                               (self._image, e))
-
-        subprocess.call(['rsync', '-ptgorlHASx', '--specials', '--progress',
-                         '--include', '/*/',
-                         '--exclude', '/etc/mtab',
-                         '--exclude', '/etc/blkid/*',
-                         '--exclude', '/dev/*',
-                         '--exclude', '/proc/*',
-                         '--exclude', '/home/*',
-                         '--exclude', '/media/*',
-                         '--exclude', '/mnt/live',
-                         '--exclude', '/sys/*',
-                         '--exclude', '/tmp/*',
-                         '--exclude', '/.liveimg*',
-                         '--exclude', '/.autofsck',
-                         '/', self._instroot])
-        subprocess.call(['sync'])
-
-        self._ImageCreator__create_minimal_dev()
-
-        self.__instloop.cleanup()
-
-
-    def __copy_img_root(self, base_on):
-        """helper function to copy root content of the base LiveIMG to
-        ISOdir"""
-
-        ignore_list = ['ext3fs.img', 'squashfs.img', 'osmin.img', 'home.img',
-                       'overlay-*']
-
-        if self.clone:
-            ignore_list.remove('home.img')
-            includes = 'boot, /EFI, /syslinux, /LiveOS'
-            if self._include:
-                includes += ", " + self._include
-
-            imgmnt = DiskMount(RawDisk(0, base_on), self._mkdtemp())
-        else:
-            imgmnt = DiskMount(LoopbackDisk(base_on, 0), self._mkdtemp())
-
-        self._LiveImageCreatorBase__isodir = self._ImageCreator__builddir + "/iso"
-
-        try:
-            imgmnt.mount()
-        except MountError, e:
-            raise CreatorError("Failed to mount '%s' : %s" % (base_on, e))
-        else:
-            # include specified files or directories
-            if self.clone:
-                baseimg = os.path.join(imgmnt.mountdir, 'LiveOS',
-                                       'squashfs.img')
-                # 'self.compress_type = None' will force reading it from
-                # base_on.
-                if self.compress_type is None:
-                    self.compress_type = squashfs_compression_type(baseimg)
-                    if self.compress_type == 'undetermined':
-                        # 'gzip' for compatibility with older versions.
-                        self.compress_type = 'gzip'
-
-                dst = self._LiveImageCreatorBase__isodir
-                print includes
-                for fd in includes.split(', /'):
-                    src = os.path.join(imgmnt.mountdir, fd)
-                    if os.path.isfile(src):
-                        shutil.copy2(src, os.path.join(dst, fd))
-                    elif os.path.isdir(src):
-                        shutil.copytree(src, os.path.join(dst, fd),
-                                        symlinks=True,
-                                        ignore=shutil.ignore_patterns(
-                                            *ignore_list))
-            else:
-                #copy over everything but squashfs.img or ext3fs.img
-                shutil.copytree(imgmnt.mountdir,
-                                self._LiveImageCreatorBase__isodir,
-                                ignore=shutil.ignore_patterns(*ignore_list))
-            subprocess.call(['sync'])
-        finally:
-            imgmnt.cleanup()
-
-
-    def _brand (self, _builder):
-        """Adjust the image branding to show its variation from original
-        source by builder and build date."""
-
-        self.fslabel = self.name
-        dt = time.strftime('%d-%b-%Y')
-
-        lst = ['isolinux/isolinux.cfg', 'syslinux/syslinux.cfg',
-               'syslinux/extlinux.conf']
-        for f in lst:
-            fpath = os.path.join(self._LiveImageCreatorBase__isodir, f)
-            if os.path.exists(fpath):
-                break
-
-        # Get build name from boot configuration file.
-        try:
-            cfgf = open(fpath, 'r')
-        except IOError, e:
-            raise CreatorError("Failed to open '%s' : %s" % (fpath, e))
-        else:
-            release = None
-            for line in cfgf:
-                i = line.find('Welcome to ')
-                if i > -1:
-                    release = line[i+11:-2]
-                    break
-            cfgf.close()
-        if not release:
-            return
-
-        ntext = dt.translate(None, '-') + '-' + _builder + '-Remix-' + release
-
-        # Update fedora-release message with Remix details.
-        releasefiles = '/etc/fedora-release, /etc/generic-release'
-        if self._releasefile:
-            releasefiles += ', ' + self._releasefile
-        for fn in releasefiles.split(', '):
-            if os.path.exists(fn):
-                try:
-                    with open(self._instroot + fn, 'r') as f:
-                        text = ntext + '\n' + f.read()
-                        open(f.name, 'w').write(text)
-                except IOError, e:
-                    raise CreatorError("Failed to open or write '%s' : %s" %
-                                       (f.name, e))
-
-        self._releasefile = ntext
-        self.name += '-' + os.uname()[4] + '-' + time.strftime('%Y%m%d.%H%M')
-
-
-    def _configure_bootloader(self, isodir):
-        """Restore the boot configuration files for an iso image boot."""
-
-        bootfolder = os.path.join(isodir, 'isolinux')
-        oldpath = os.path.join(isodir, 'syslinux')
-        if os.path.exists(oldpath):
-            os.rename(oldpath, bootfolder)
-
-        cfgf = os.path.join(bootfolder, 'isolinux.cfg')
-        for f in ['syslinux.cfg', 'extlinux.conf']:
-            src = os.path.join(bootfolder, f)
-            if os.path.exists(src):
-                os.rename(src, cfgf)
-
-        args = ['/bin/sed', '-i']
-        if self._releasefile:
-            args.append('-e')
-            args.append('s/Welcome to .*/Welcome to ' + self._releasefile + '!/')
-        if self.clone:
-            args.append('-e')
-            args.append('s/rootfstype=[^ ]* [^ ]*/rootfstype=auto ro/')
-            args.append('-e')
-            args.append('s/liveimg .* quiet/liveimg quiet/')
-        args.append('-e')
-        args.append('s/root=[^ ]*/root=live:CDLABEL=' + self.name + '/')
-        if self.ks:
-            # bootloader --append "!opt-to-remove opt-to-add"
-            for param in kickstart.get_kernel_args(self.ks,"").split():
-                if param.startswith('!'):
-                    param=param[1:]
-                    # remove parameter prefixed with !
-                    args.append('-e')
-                    args.append("/^  append/s/%s //" % param)
-                    # special case for last parameter
-                    args.append('-e')
-                    args.append("/^  append/s/%s$//" % param)
-                else:
-                    # append parameter
-                    args.append('-e')
-                    args.append("/^  append/s/$/ %s/" % param)
-        args.append(cfgf)
-        dev_null = os.open("/dev/null", os.O_WRONLY)
-        try:
-            subprocess.Popen(args,
-                             stdout = subprocess.PIPE,
-                             stderr = dev_null).communicate()[0]
-            return 0
-
-        except IOError, e:
-            raise CreatorError("Failed to configure bootloader file: %s" % e)
-            return 1
-        finally:
-            os.close(dev_null)
-
-    def _run_pre_scripts(self):
-        for s in kickstart.get_pre_scripts(self.ks):
-            (fd, path) = tempfile.mkstemp(prefix = "ks-script-",
-                                          dir = self._instroot + "/tmp")
-
-            os.write(fd, s.script)
-            os.close(fd)
-            os.chmod(path, 0700)
-
-            env = self._get_post_scripts_env(s.inChroot)
-
-            if not s.inChroot:
-                env["INSTALL_ROOT"] = self._instroot
-                preexec = None
-                script = path
-            else:
-                preexec = self._chroot
-                script = "/tmp/" + os.path.basename(path)
-
-            try:
-                subprocess.check_call([s.interp, script],
-                                      preexec_fn = preexec, env = env)
-            except OSError, e:
-                raise CreatorError("Failed to execute %%post script "
-                                   "with '%s' : %s" % (s.interp, e.strerror))
-            except subprocess.CalledProcessError, err:
-                if s.errorOnFail:
-                    raise CreatorError("%%post script failed with code %d "
-                                       % err.returncode)
-                logging.warning("ignoring %%post failure (code %d)"
-                                % err.returncode)
-            finally:
-                os.unlink(path)
-
-    class simpleCallback:
-        def __init__(self):
-            self.fdnos = {}
-
-        def callback(self, what, amount, total, mydata, wibble):
-            if what == rpm.RPMCALLBACK_TRANS_START:
-                pass
-
-            elif what == rpm.RPMCALLBACK_INST_OPEN_FILE:
-                hdr, path = mydata
-                print "Installing %s\r" % (hdr["name"])
-                fd = os.open(path, os.O_RDONLY)
-                nvr = '%s-%s-%s' % ( hdr['name'], hdr['version'], hdr['release'] )
-                self.fdnos[nvr] = fd
-                return fd
-
-            elif what == rpm.RPMCALLBACK_INST_CLOSE_FILE:
-                hdr, path = mydata
-                nvr = '%s-%s-%s' % ( hdr['name'], hdr['version'], hdr['release'] )
-                os.close(self.fdnos[nvr])
-
-            elif what == rpm.RPMCALLBACK_INST_PROGRESS:
-                hdr, path = mydata
-                print "%s:  %.5s%% done\r" % (hdr["name"], (float(amount) / total) * 100),
-
-    def install_rpms(self):
-        if kickstart.exclude_docs(self.ks):
-            rpm.addMacro("_excludedocs", "1")
-        if not kickstart.selinux_enabled(self.ks):
-            rpm.addMacro("__file_context_path", "%{nil}")
-        if kickstart.inst_langs(self.ks) != None:
-            rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks))
-        # start RPM transaction
-        ts=rpm.TransactionSet(self._instroot)
-        for repo in kickstart.get_repos(self.ks):
-            (name, baseurl, mirrorlist, proxy, inc, exc) = repo
-            if baseurl.startswith("file://"):
-               baseurl=baseurl[7:]
-            elif not baseurl.startswith("/"):
-                raise CreatorError("edit-livecd accepts only --baseurl pointing to a local folder with RPMs (not YUM repo)")
-            if not baseurl.endswith("/"):
-                baseurl+="/"
-            for pkg_from_list in kickstart.get_packages(self.ks):
-                # TODO report if package listed in ks is missing
-                for pkg in glob.glob(baseurl+pkg_from_list+"-[0-9]*.rpm"):
-                    fdno = os.open(pkg, os.O_RDONLY)
-                    hdr = ts.hdrFromFdno(fdno)
-                    os.close(fdno)
-                    ts.addInstall(hdr,(hdr,pkg), "u")
-        ts.run(self.simpleCallback().callback,'')
-
-def parse_options(args):
-    parser = optparse.OptionParser(usage = """
-       %prog [-n=<name>]
-                      [-o <output>]
-                      [-k <kickstart-file>]
-                      [-s <script.sh>]
-                      [-t <tmpdir>]
-                      [-e <excludes>]
-                      [-f <exclude-file>]
-                      [-i <includes>]
-                      [-r <releasefile>]
-                      [-b <builder>]
-                      [--clone]
-                      [-c <compress_type>]
-                      [--skip-compression]
-                      [--skip-minimize]
-                      <LIVEIMG.src>""")
-
-    parser.add_option("-n", "--name", type="string", dest="name",
-                      help="name of new LiveOS (don't include .iso, it will "
-                           "be added)")
-
-    parser.add_option("-o", "--output", type="string", dest="output",
-                      help="specify directory for new iso file.")
-
-    parser.add_option("-k", "--kickstart", type="string", dest="kscfg",
-                      help="Path or url to kickstart config file")
-
-    parser.add_option("-s", "--script", type="string", dest="script",
-                      help="specify script to run chrooted in the LiveOS "
-                           "fsimage")
-
-    parser.add_option("-t", "--tmpdir", type="string",
-                      dest="tmpdir", default="/var/tmp",
-                      help="Temporary directory to use (default: /var/tmp)")
-
-    parser.add_option("-e", "--exclude", type="string", dest="exclude",
-                      help="Specify directory or file patterns to be excluded "
-                           "from the rsync copy of the filesystem.")
-
-    parser.add_option("-f", "--exclude-file", type="string",
-                      dest="exclude_file",
-                      help="Specify a file containing file patterns to be "
-                           "excluded from the rsync copy of the filesystem.")
-
-    parser.add_option("-i", "--include", type="string", dest="include",
-                      help="Specify directory or file patterns to be included "
-                           "in copy_img_root.")
-
-    parser.add_option("-r", "--releasefile", type="string", dest="releasefile",
-                      help="Specify release file/s for branding.")
-
-    parser.add_option("-b", "--builder", type="string",
-                      dest="builder", default=os.getlogin(),
-                      help="Specify the builder of a Remix.")
-
-    parser.add_option("", "--clone", action="store_true", dest="clone",
-                      help="Specify that source image is LiveOS block device.")
-
-    parser.add_option("-c", "--compress_type", type="string",
-                      dest="compress_type",
-                      help="Specify the compression type for SquashFS. Will "
-                           "override the current compression or lack thereof.")
-
-    parser.add_option("", "--skip-compression", action="store_true",
-                      dest="skip_compression", default=False,
-                      help="Specify no compression of filesystem, ext3fs.img")
-
-    parser.add_option("", "--skip-minimize", action="store_true",
-                      dest="skip_minimize", default=False,
-                      help="Specify no osmin.img minimal snapshot.")
-
-    setup_logging(parser)
-
-    (options, args) = parser.parse_args()
-
-    if len(args) != 1:
-        parser.print_usage()
-        sys.exit(1)
-
-    print args[0]
-
-    return (args[0], options)
-
-def get_fsvalue(filesystem, tag):
-    dev_null = os.open('/dev/null', os.O_WRONLY)
-    args = ['/sbin/blkid', '-s', tag, '-o', 'value', filesystem]
-    try:
-        fs_type = subprocess.Popen(args,
-                               stdout=subprocess.PIPE,
-                               stderr=dev_null).communicate()[0]
-    except IOError, e:
-        raise CreatorError("Failed to determine fs %s: %s" % value, e )
-    finally:
-        os.close(dev_null)
-
-    return fs_type.rstrip()
-
-def main():
-    # LiveOS set to <LIVEIMG.src>
-    (LiveOS, options) = parse_options(sys.argv[1:])
-
-    if os.geteuid () != 0:
-        print >> sys.stderr, "You must run edit-liveos as root"
-        return 1
-
-    if options.name:
-        name = options.name
-    elif stat.S_ISBLK(os.stat(LiveOS).st_mode):
-        name = get_fsvalue(LiveOS, 'LABEL') + '.edited'
-    else:
-        name = os.path.basename(LiveOS) + ".edited"
-
-    if options.output:
-        output = options.output
-    else:
-        output = os.path.dirname(LiveOS)
-        if output == '/dev':
-            output = options.tmpdir
-
-    editor = LiveImageEditor(name)
-    editor._exclude = options.exclude
-    editor._exclude_file = options.exclude_file
-    editor._include = options.include
-    editor.clone = options.clone
-    editor.tmpdir = options.tmpdir
-    editor._builder = options.builder
-    editor._releasefile = options.releasefile
-    editor.compress_type = options.compress_type
-    editor.skip_compression = options.skip_compression
-    editor.skip_minimize = options.skip_minimize
-
-    try:
-        if options.kscfg:
-            editor.ks = read_kickstart(options.kscfg)
-            # part / --size <new rootfs size to be resized to>
-            editor._LoopImageCreator__image_size = kickstart.get_image_size(editor.ks)
-        if options.script:
-            if not os.path.exists(options.script):
-                print "Invalid Script Path '%s'" % options.script
-                return 1
-        editor.mount(LiveOS, cachedir = None)
-        editor._configure_bootloader(editor._LiveImageCreatorBase__isodir)
-        if editor.ks:
-            editor._run_pre_scripts()
-            editor.install_rpms()
-            editor._run_post_scripts()
-        elif options.script:
-            print "Running edit script '%s'" % options.script
-            editor._run_script(options.script)
-        else:
-            print "Launching shell. Exit to continue."
-            print "----------------------------------"
-            editor.launch_shell()
-        editor.unmount()
-        editor.package(output)
-        logging.info("%s.iso saved to %s"  % (editor.name, output))
-    except CreatorError, e:
-        logging.error(u"Error editing LiveOS : %s" % e)
-        return 1
-    finally:
-        editor.cleanup()
-
-    return 0
-
-if __name__ == "__main__":
-    sys.exit(main())
-
-arch = rpmUtils.arch.getBaseArch()
-if arch in ("i386", "x86_64"):
-    LiveImageCreator = x86LiveImageCreator
-elif arch in ("ppc",):
-    LiveImageCreator = ppcLiveImageCreator
-elif arch in ("ppc64",):
-    LiveImageCreator = ppc64LiveImageCreator
-else:
-    raise CreatorError("Architecture not supported!")
diff --git a/tools/image-creator b/tools/image-creator
deleted file mode 100755
index 6f2604c..0000000
--- a/tools/image-creator
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python -tt
-#
-# image-creator: Create an ext3 system image
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import shutil
-import optparse
-import logging
-
-import imgcreate
-
-def parse_options(args):
-    parser = optparse.OptionParser(usage = "%prog [--name=<name>] <kickstart>")
-
-    parser.add_option("-n", "--name", type="string", dest="name",
-                      help="Image name and filesystem label")
-
-    imgcreate.setup_logging(parser)
-
-    (options, args) = parser.parse_args()
-
-    if len(args) != 1:
-        parser.print_usage()
-        sys.exit(1)
-
-    return (args[0], options)
-
-def main():
-    (kscfg, options) = parse_options(sys.argv[1:])
-
-    if os.geteuid () != 0:
-        print >> sys.stderr, "You must run image-creator as root"
-        return 1
-
-    try:
-        ks = imgcreate.read_kickstart(kscfg)
-    except imgcreate.CreatorError, e:
-        logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e))
-        return 1
-
-    if options.name:
-        name = options.name
-    else:
-        name = imgcreate.build_name(kscfg)
-
-    creator = imgcreate.LoopImageCreator(ks, name)
-
-    try:
-        creator.create()
-    except imgcreate.CreatorError, e:
-        logging.error("Unable to create image : %s" % e)
-        return 1
-    finally:
-        creator.cleanup()
-
-    return 0
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/tools/livecd-creator b/tools/livecd-creator
deleted file mode 100755
index 6841c94..0000000
--- a/tools/livecd-creator
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/python -tt
-#
-# livecd-creator : Creates Live CD based for Fedora.
-#
-# Copyright 2007, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import os.path
-import sys
-import time
-import optparse
-import logging
-
-import imgcreate
-from imgcreate.fs import makedirs
-
-class Usage(Exception):
-    def __init__(self, msg = None, no_error = False):
-        Exception.__init__(self, msg, no_error)
-
-def parse_options(args):
-    parser = optparse.OptionParser()
-
-    imgopt = optparse.OptionGroup(parser, "Image options",
-                                  "These options define the created image.")
-    imgopt.add_option("-c", "--config", type="string", dest="kscfg",
-                      help="Path or url to kickstart config file")
-    imgopt.add_option("-b", "--base-on", type="string", dest="base_on",
-                      help="Add packages to an existing live CD iso9660 image.")
-    imgopt.add_option("-f", "--fslabel", type="string", dest="fslabel",
-                      help="File system label (default based on config name)")
-    imgopt.add_option("", "--compression-type", type="string", dest="compress_type",
-                      help="Compression type recognized by mksquashfs (default gzip, xz needs a 2.6.38+ kernel, lzo needs a 2.6.36+ kernel, lzma needs custom kernel)",
-                      default="gzip")
-    imgopt.add_option("", "--releasever", type="string", dest="releasever",
-                      default=None,
-                      help="Value to substitute for $releasever in kickstart repo urls")
-    parser.add_option_group(imgopt)
-
-    # options related to the config of your system
-    sysopt = optparse.OptionGroup(parser, "System directory options",
-                                  "These options define directories used on your system for creating the live image")
-    sysopt.add_option("-t", "--tmpdir", type="string",
-                      dest="tmpdir", default="/var/tmp",
-                      help="Temporary directory to use (default: /var/tmp)")
-    sysopt.add_option("", "--cache", type="string",
-                      dest="cachedir", default=None,
-                      help="Cache directory to use (default: private cache")
-    parser.add_option_group(sysopt)
-
-    imgcreate.setup_logging(parser)
-
-    # debug options not recommended for "production" images
-    # Start a shell in the chroot for post-configuration.
-    parser.add_option("-l", "--shell", action="store_true", dest="give_shell",
-                      help=optparse.SUPPRESS_HELP)
-    # Don't compress the image.
-    parser.add_option("-s", "--skip-compression", action="store_true", dest="skip_compression",
-                      help=optparse.SUPPRESS_HELP)
-    parser.add_option("", "--skip-minimize", action="store_true", dest="skip_minimize",
-                      help=optparse.SUPPRESS_HELP)
-
-    (options, args) = parser.parse_args()
-    if not options.kscfg:
-        raise Usage("Kickstart file must be provided")
-    if options.base_on and not os.path.isfile(options.base_on):
-        raise Usage("Live CD ISO '%s' does not exist" %(options.base_on,))
-    if options.fslabel and len(options.fslabel) > imgcreate.FSLABEL_MAXLEN:
-        raise Usage("CD labels are limited to 32 characters")
-    if options.fslabel and options.fslabel.find(" ") != -1:
-        raise Usage("CD labels cannot contain spaces.")
-
-    return options
-
-def main():
-    try:
-        options = parse_options(sys.argv[1:])
-    except Usage, (msg, no_error):
-        if no_error:
-            out = sys.stdout
-            ret = 0
-        else:
-            out = sys.stderr
-            ret = 2
-        if msg:
-            print >> out, msg
-        return ret
-
-    if os.geteuid () != 0:
-        print >> sys.stderr, "You must run livecd-creator as root"
-        return 1
-
-    if options.fslabel:
-        fslabel = options.fslabel
-        name = fslabel
-    else:
-        name = imgcreate.build_name(options.kscfg, "livecd-")
-
-        fslabel = imgcreate.build_name(options.kscfg,
-                                        "livecd-",
-                                        maxlen = imgcreate.FSLABEL_MAXLEN,
-                                        suffix = "%s-%s" %(os.uname()[4], time.strftime("%Y%m%d%H%M")))
-
-        logging.info("Using label '%s' and name '%s'" % (fslabel, name))
-
-    ks = imgcreate.read_kickstart(options.kscfg)
-
-    creator = imgcreate.LiveImageCreator(ks, name, fslabel=fslabel, releasever=options.releasever)
-    creator.tmpdir = os.path.abspath(options.tmpdir)
-    if not os.path.exists(creator.tmpdir):
-        makedirs(creator.tmpdir)
-    creator.compress_type = options.compress_type
-    creator.skip_compression = options.skip_compression
-    creator.skip_minimize = options.skip_minimize
-    if options.cachedir:
-        options.cachedir = os.path.abspath(options.cachedir)
-
-    try:
-        creator.mount(options.base_on, options.cachedir)
-        creator.install()
-        creator.configure()
-        if options.give_shell:
-            print "Launching shell. Exit to continue."
-            print "----------------------------------"
-            creator.launch_shell()
-        creator.unmount()
-        creator.package()
-    except imgcreate.CreatorError, e:
-        logging.error(u"Error creating Live CD : %s" % e)
-        return 1
-    finally:
-        creator.cleanup()
-
-    return 0
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
deleted file mode 100755
index eb7be61..0000000
--- a/tools/livecd-iso-to-disk.sh
+++ /dev/null
@@ -1,987 +0,0 @@
-#!/bin/bash
-# Convert a live CD iso so that it's bootable off of a USB stick
-# Copyright 2007  Red Hat, Inc.
-# Jeremy Katz <katzj at redhat.com>
-#
-# overlay/persistence enhancements by Douglas McClendon <dmc at viros.org>
-# GPT+MBR hybrid enhancements by Stewart Adam <s.adam at diffingo.com>
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-
-export PATH=/sbin:/usr/sbin:$PATH
-
-usage() {
-    echo "$0 [--timeout <time>] [--totaltimeout <time>] [--format] [--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb <size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick device>"
-    exit 1
-}
-
-cleanup() {
-    sleep 2
-    [ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
-    [ -d "$USBMNT" ] && umount $USBMNT && rmdir $USBMNT
-}
-
-exitclean() {
-    echo "Cleaning up to exit..."
-    cleanup
-    exit 1
-}
-
-isdevloop() {
-    [ x"${1#/dev/loop}" != x"$1" ]
-}
-
-getdisk() {
-    DEV=$1
-
-    if isdevloop "$DEV"; then
-        device="$DEV"
-        return
-    fi
-
-    p=$(udevadm info -q path -n $DEV)
-    if [ $? -gt 0 ]; then
-        echo "Error getting udev path to $DEV"
-        exitclean
-    fi
-    if [ -e /sys/$p/device ]; then
-	device=$(basename /sys/$p)
-    else
-	device=$(basename $(readlink -f /sys/$p/../))
-    fi
-    if [ ! -e /sys/block/$device -o ! -e /dev/$device ]; then
-	echo "Error finding block device of $DEV.  Aborting!"
-	exitclean
-    fi
-
-    device="/dev/$device"
-    # FIXME: weird dev names could mess this up I guess
-    p=/dev/$(basename $p)
-    partnum=${p##$device}
-}
-
-getpartition() {
-    DEV=$1
-    pa=$( < /proc/partitions )
-    pa=${pa##*$DEV}
-    partnum=${pa%% *}
-}
-
-resetMBR() {
-    if isdevloop "$DEV"; then
-        return
-    fi
-    getdisk $1
-    # if efi, we need to use the hybrid MBR
-    if [ -n "$efi" ];then
-        if [ -f /usr/lib/syslinux/gptmbr.bin ]; then
-            cat /usr/lib/syslinux/gptmbr.bin > $device
-        elif [ -f /usr/share/syslinux/gptmbr.bin ]; then
-            cat /usr/share/syslinux/gptmbr.bin > $device
-        else
-            echo "Could not find gptmbr.bin (syslinux)"
-            exitclean
-        fi
-        # Make it bootable on EFI and BIOS
-        parted -s $device set $partnum legacy_boot on
-    else
-        if [ -f /usr/lib/syslinux/mbr.bin ]; then
-            cat /usr/lib/syslinux/mbr.bin > $device
-        elif [ -f /usr/share/syslinux/mbr.bin ]; then
-            cat /usr/share/syslinux/mbr.bin > $device
-        else
-            echo "Could not find mbr.bin (syslinux)"
-            exitclean
-        fi
-    fi
-}
-
-checkMBR() {
-    if isdevloop "$DEV"; then
-        return 0
-    fi
-    getdisk $1
-
-    bs=$(mktemp /tmp/bs.XXXXXX)
-    dd if=$device of=$bs bs=512 count=1 2>/dev/null || exit 2
-
-    mbrword=$(hexdump -n 2 $bs |head -n 1|awk {'print $2;'})
-    rm -f $bs
-    if [ "$mbrword" = "0000" ]; then
-	echo "MBR appears to be blank."
-	echo "Do you want to replace the MBR on this device?"
-	echo "Press Enter to continue or ctrl-c to abort"
-	read
-	resetMBR $1
-    fi
-
-    return 0
-}
-
-checkPartActive() {
-    dev=$1
-    getdisk $dev
-
-    # if we're installing to whole-disk and not a partition, then we
-    # don't need to worry about being active
-    if [ "$dev" = "$device" ]; then
-	return
-    fi
-    if isdevloop "$DEV"; then
-        return
-    fi
-
-    if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep $dev |awk {'print $2;'})" != "*" ]; then
-	echo "Partition isn't marked bootable!"
-	echo "You can mark the partition as bootable with "
-        echo "    # /sbin/parted $device"
-	echo "    (parted) toggle N boot"
-	echo "    (parted) quit"
-	exitclean
-    fi
-}
-
-checkLVM() {
-    dev=$1
-
-    if [ -x /sbin/pvs -a \
-	"$(/sbin/pvs -o vg_name --noheadings $dev* 2>/dev/null)" ]; then
-	echo "Device, $dev, contains a volume group and cannot be formated!"
-	echo "You can remove the volume group using vgremove."
-	exitclean
-    fi
-    return 0
-}
-
-createGPTLayout() {
-    dev=$1
-    getdisk $dev
-
-    echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
-    echo "Press Enter to continue or ctrl-c to abort"
-    read
-    umount ${device}* &> /dev/null
-    wipefs -a ${device}
-    /sbin/parted --script $device mklabel gpt
-    partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
-    size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
-    /sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 1048576 $(($size - 1048576)) set 1 boot on
-    # Sometimes automount can be _really_ annoying.
-    echo "Waiting for devices to settle..."
-    /sbin/udevadm settle
-    sleep 5
-    getpartition ${device#/dev/}
-    USBDEV=${device}${partnum}
-    umount $USBDEV &> /dev/null
-    /sbin/mkdosfs -n LIVE $USBDEV
-    USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
-}
-
-createMSDOSLayout() {
-    dev=$1
-    getdisk $dev
-
-    echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
-    echo "Press Enter to continue or ctrl-c to abort"
-    read
-    umount ${device}* &> /dev/null
-    wipefs -a ${device}
-    /sbin/parted --script $device mklabel msdos
-    partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
-    size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
-    /sbin/parted --script $device unit b mkpart primary fat32 1048576 $(($size - 1048576)) set 1 boot on
-    # Sometimes automount can be _really_ annoying.
-    echo "Waiting for devices to settle..."
-    /sbin/udevadm settle
-    sleep 5
-    if ! isdevloop "$DEV"; then
-        getpartition ${device#/dev/}
-        USBDEV=${device}${partnum}
-    else
-        USBDEV=${device}
-    fi
-    umount $USBDEV &> /dev/null
-    /sbin/mkdosfs -n LIVE $USBDEV
-    USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
-}
-
-createEXTFSLayout() {
-    dev=$1
-    getdisk $dev
-
-    echo "WARNING: THIS WILL DESTROY ANY DATA ON $device!!!"
-    echo "Press Enter to continue or ctrl-c to abort"
-    read
-    umount ${device}* &> /dev/null
-    wipefs -a ${device}
-    /sbin/parted --script $device mklabel msdos
-    partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
-    size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
-    /sbin/parted --script $device unit b mkpart primary ext2 1048576 $(($size - 1048576)) set 1 boot on
-    # Sometimes automount can be _really_ annoying.
-    echo "Waiting for devices to settle..."
-    /sbin/udevadm settle
-    sleep 5
-    getpartition ${device#/dev/}
-    USBDEV=${device}${partnum}
-    umount $USBDEV &> /dev/null
-    /sbin/mkfs.ext3 -L LIVE $USBDEV
-    USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
-}
-
-checkGPT() {
-    dev=$1
-    getdisk $dev
-
-    if [ "$(/sbin/fdisk -l $device 2>/dev/null |grep -c GPT)" -eq "0" ]; then
-        echo "EFI boot requires a GPT partition table."
-        echo "This can be done manually or you can run with --format"
-        exitclean
-    fi
-
-    partinfo=$(LC_ALL=C /sbin/parted --script -m $device "print" |grep ^$partnum:)
-    volname=$(echo $partinfo |cut -d : -f 6)
-    flags=$(echo $partinfo |cut -d : -f 7)
-    if [ "$volname" != "EFI System Partition" ]; then
-	echo "Partition name must be 'EFI System Partition'"
-	echo "This can be set in parted or you can run with --reset-mbr"
-	exitclean
-    fi
-    if [ "$(echo $flags |grep -c boot)" = "0" ]; then
-	echo "Partition isn't marked bootable!"
-	echo "You can mark the partition as bootable with "
-        echo "    # /sbin/parted $device"
-	echo "    (parted) toggle N boot"
-	echo "    (parted) quit"
-	exitclean
-    fi
-}
-
-checkFilesystem() {
-    dev=$1
-
-    USBFS=$(/sbin/blkid -s TYPE -o value $dev)
-    if [ "$USBFS" != "vfat" ] && [ "$USBFS" != "msdos" ]; then
-        if [ "$USBFS" != "ext2" ] && [ "$USBFS" != "ext3" ]; then
-	    echo "USB filesystem must be vfat, ext[23]"
-	    exitclean
-        fi
-    fi
-
-
-    USBLABEL=$(/sbin/blkid -s UUID -o value $dev)
-    if [ -n "$USBLABEL" ]; then
-	USBLABEL="UUID=$USBLABEL" ;
-    else
-	USBLABEL=$(/sbin/blkid -s LABEL -o value $dev)
-	if [ -n "$USBLABEL" ]; then
-	    USBLABEL="LABEL=$USBLABEL"
-	else
-	    echo "Need to have a filesystem label or UUID for your USB device"
-	    if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
-		echo "Label can be set with /sbin/dosfslabel"
-	    elif [ "$USBFS" = "ext2" -o "$USBFS" = "ext3" ]; then
-		echo "Label can be set with /sbin/e2label"
-	    elif [ "$USBFS" = "btrfs" ]; then
-                echo "Eventually you'll be able to use /sbin/btrfs filesystem label to add a label."
-	    fi
-	    exitclean
-	fi
-    fi
-
-    if [ "$USBFS" = "vfat" -o "$USBFS" = "msdos" ]; then
-	mountopts="-o shortname=winnt,umask=0077"
-    fi
-}
-
-checkSyslinuxVersion() {
-    if [ ! -x /usr/bin/syslinux ]; then
-	echo "You need to have syslinux installed to run this script"
-	exit 1
-    fi
-    if ! syslinux 2>&1 | grep -qe -d; then
-	SYSLINUXPATH=""
-    elif [ -n "$multi" ]; then
-	SYSLINUXPATH="$LIVEOS/syslinux"
-    else
-	SYSLINUXPATH="syslinux"
-    fi
-}
-
-checkMounted() {
-    dev=$1
-    if grep -q "^$dev " /proc/mounts ; then
-        echo "$dev is mounted, please unmount for safety"
-        exitclean
-    fi
-    if grep -q "^$dev " /proc/swaps; then
-        echo "$dev is in use as a swap device, please disable swap"
-        exitclean
-    fi
-}
-
-checkint() {
-    if ! test $1 -gt 0 2>/dev/null ; then
-	usage
-    fi
-}
-
-if [ $(id -u) != 0 ]; then 
-    echo "You need to be root to run this script"
-    exit 1
-fi
-
-detectisotype() {
-    if [ -e $CDMNT/LiveOS/squashfs.img ]; then
-        isotype=live
-        return
-    fi
-    if [ -e $CDMNT/images/install.img -o $CDMNT/isolinux/initrd.img ]; then
-        imgtype=install
-        if [ -e $CDMNT/Packages ]; then
-            isotype=installer
-        else
-            isotype=netinst
-        fi
-        if [ ! -e $CDMNT/images/install.img ]; then
-            echo "$ISO uses initrd.img w/o install.img"
-            imgtype=initrd
-        fi
-        return
-    fi
-    echo "ERROR: $ISO does not appear to be a Live image or DVD installer."
-    exitclean
-}
-
-cp_p() {
-	strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
-	| awk '{
-	count += $NF
-	if (count % 10 == 0) {
-		percent = count / total_size * 100
-		printf "%3d%% [", percent
-		for (i=0;i<=percent;i++)
-			printf "="
-			printf ">"
-			for (i=percent;i<100;i++)
-				printf " "
-				printf "]\r"
-			}
-		}
-		END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
-}
-
-copyFile() {
-        if [ -x /usr/bin/rsync ]; then
-            rsync -P "$1" "$2"
-            return
-        fi
-	if [ -x /usr/bin/gvfs-copy ]; then
-	    gvfs-copy -p "$1" "$2"
-	    return
-	fi
-	if [ -x /usr/bin/strace -a -x /bin/awk ]; then
-	    cp_p "$1" "$2"
-	    return
-	fi
-	cp "$1" "$2"
-}
-
-shopt -s extglob
-
-cryptedhome=1
-keephome=1
-homesizemb=0
-swapsizemb=0
-overlaysizemb=0
-isotype=
-imgtype=
-LIVEOS=LiveOS
-
-HOMEFILE="home.img"
-while [ $# -gt 2 ]; do
-    case $1 in
-	--overlay-size-mb)
-	    checkint $2
-	    overlaysizemb=$2
-	    shift
-	    ;;
-	--home-size-mb)
-	    checkint $2
-            homesizemb=$2
-            shift
-	    ;;
-	--swap-size-mb)
-	    checkint $2
-	    swapsizemb=$2
-	    shift
-	    ;;
-        --crypted-home)
-            cryptedhome=1
-	    ;;
-        --unencrypted-home)
-            cryptedhome=""
-            ;;
-        --delete-home)
-            keephome=""
-            ;;
-	--noverify)
-	    noverify=1
-	    ;;
-	--reset-mbr|--resetmbr)
-	    resetmbr=1
-	    ;;
-	--efi|--mactel)
-	    efi=1
-	    ;;
-	--format)
-	    format=1
-	    ;;
-	--skipcopy)
-	    skipcopy=1
-	    ;;
-	--xo)
-	    xo=1
-	    skipcompress=1
-	    ;;
-	--xo-no-home)
-	    xonohome=1
-	    ;;
-	--compress)
-	    skipcompress=""
-	    ;;
-	--skipcompress)
-	    skipcompress=1
-	    ;;
-        --extra-kernel-args)
-            kernelargs=$2
-            shift
-            ;;
-        --force)
-            force=1
-            ;;
-	--livedir)
-	    LIVEOS=$2
-	    shift
-	    ;;
-	--multi)
-	    multi=1
-	    ;;
-        --timeout)
-            checkint $2
-            timeout=$2
-            shift
-            ;;
-        --totaltimeout)
-            checkint $2
-            totaltimeout=$2
-            shift
-            ;;
-	*)
-	    echo "invalid arg -- $1"
-	    usage
-	    ;;
-    esac
-    shift
-done
-
-ISO=$(readlink -f "$1")
-USBDEV=$(readlink -f "$2")
-
-if [ -z "$ISO" ]; then
-    echo "Missing source"
-    usage
-fi
-
-if [ ! -b "$ISO" -a ! -f "$ISO" ]; then
-    echo "$ISO is not a file or block device"
-    usage
-fi
-
-# FIXME: If --format is given, we shouldn't care and just use /dev/foo1
-if [ -z "$USBDEV" ]; then
-    echo "Missing target device"
-    usage
-fi
-
-if [ ! -b "$USBDEV" ]; then
-    echo "$USBDEV is not a block device"
-    usage
-fi
-
-if [ -z "$noverify" ]; then
-    # verify the image
-    echo "Verifying image..."
-    checkisomd5 --verbose "$ISO"
-    if [ $? -ne 0 ]; then
-	echo "Are you SURE you want to continue?"
-	echo "Press Enter to continue or ctrl-c to abort"
-	read
-    fi
-fi
-
-#checkFilesystem $USBDEV
-# do some basic sanity checks.
-checkMounted $USBDEV
-if [ -n "$format" -a -z "$skipcopy" ];then
-    checkLVM $USBDEV
-    # checks for a valid filesystem
-    if [ -n "$efi" ];then
-        createGPTLayout $USBDEV
-    elif [ "$USBFS" == "vfat" -o "$USBFS" == "msdos" ]; then
-        createMSDOSLayout $USBDEV
-    else
-        createEXTFSLayout $USBDEV
-    fi
-fi
-
-checkFilesystem $USBDEV
-if [ -n "$efi" ]; then
-    checkGPT $USBDEV
-fi
-
-checkSyslinuxVersion
-# Because we can't set boot flag for EFI Protective on msdos partition tables
-[ -z "$efi" ] && checkPartActive $USBDEV
-[ -n "$resetmbr" ] && resetMBR $USBDEV
-checkMBR $USBDEV
-
-
-if [ "$overlaysizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
-    if [ "$overlaysizemb" -gt 4095 ]; then
-        echo "Can't have an overlay of 4095MB or greater on VFAT"
-        exitclean
-    fi
-fi
-
-if [ "$homesizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
-    if [ "$homesizemb" -gt 4095 ]; then
-        echo "Can't have a home overlay greater than 4095MB on VFAT"
-        exitclean
-    fi
-fi
-
-if [ "$swapsizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
-    if [ "$swapsizemb" -gt 4095 ]; then
-        echo "Can't have a swap file greater than 4095MB on VFAT"
-        exitclean
-    fi
-fi
-
-# FIXME: would be better if we had better mountpoints
-CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
-if [ -b $ISO ]; then
-    mount -o ro "$ISO" $CDMNT || exitclean
-elif [ -f $ISO ]; then
-    mount -o loop,ro "$ISO" $CDMNT || exitclean
-else
-    echo "$ISO is not a file or block device."
-    exitclean
-fi
-USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
-mount $mountopts $USBDEV $USBMNT || exitclean
-
-trap exitclean SIGINT SIGTERM
-
-detectisotype
-
-if [ -f "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" -a "$homesizemb" -gt 0 ]; then
-    echo "ERROR: Requested keeping existing /home and specified a size for /home"
-    echo "Please either don't specify a size or specify --delete-home"
-    exitclean
-fi
-
-if [ -n "$efi" ]; then
-    if [ -d $CDMNT/EFI/BOOT ]; then
-        EFI_BOOT="/EFI/BOOT"
-    elif [ -d $CDMNT/EFI/boot ]; then
-        EFI_BOOT="/EFI/boot"
-    else
-        echo "ERROR: This live image does not support EFI booting"
-        exitclean
-    fi
-fi
-
-# let's try to make sure there's enough room on the stick
-if [ -d $CDMNT/LiveOS ]; then
-    check=$CDMNT/LiveOS
-else
-    check=$CDMNT
-fi
-if [ -d $USBMNT/$LIVEOS ]; then
-    tbd=$(du -s -B 1M $USBMNT/$LIVEOS | awk {'print $1;'})
-    [ -f $USBMNT/$LIVEOS/$HOMEFILE ] && homesz=$(du -s -B 1M $USBMNT/$LIVEOS/$HOMEFILE | awk {'print $1;'})
-    [ -n "$homesz" -a -n "$keephome" ] && tbd=$(($tbd - $homesz))
-else
-    tbd=0
-fi
-livesize=$(du -s -B 1M $check | awk {'print $1;'})
-if [ -n "$skipcompress" ]; then
-    if [ -e $CDMNT/LiveOS/squashfs.img ]; then
-	if mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT; then
-	    livesize=$(du -s -B 1M $CDMNT/LiveOS/ext3fs.img | awk {'print $1;'})
-	    umount $CDMNT
-	else
-	    echo "WARNING: --skipcompress or --xo was specified but the currently"
-	    echo "running kernel can not mount the squashfs from the ISO file to extract"
-	    echo "it. The compressed squashfs will be copied to the USB stick."
-	    skipcompress=""
-	fi
-    fi
-fi
-free=$(df  -B1M $USBDEV  |tail -n 1 |awk {'print $4;'})
-
-if [ "$isotype" = "live" ]; then
-    tba=$(($overlaysizemb + $homesizemb + $livesize + $swapsizemb))
-    if [ $tba -gt $(($free + $tbd)) ]; then
-        echo "Unable to fit live image + overlay on available space on USB stick"
-        echo "+ Size of live image:  $livesize"
-        [ "$overlaysizemb" -gt 0 ] && echo "+ Overlay size:  $overlaysizemb"
-        [ "$homesizemb" -gt 0 ] && echo "+ Home overlay size:  $homesizemb"
-        [ "$swapsizemb" -gt 0 ] && echo "+ Swap overlay size:  $swapsizemb"
-        echo "---------------------------"
-        echo "= Requested:  $tba"
-        echo "- Available:  $(($free + $tbd))"
-        echo "---------------------------"
-        echo "= To fit, free or decrease requested size total by:  $(($tba - $free - $tbd))"
-        exitclean
-    fi
-fi
-
-# Verify available space for DVD installer
-if [ "$isotype" = "installer" ]; then
-    if [ -z "$skipcopy" ]; then
-        isosize=$(du -s -B 1M $ISO | awk {'print $1;'})
-    else
-        isosize=0
-    fi
-    if [ "$imgtype" = "install" ]; then
-        imgpath=images/install.img
-    else
-        imgpath=isolinux/initrd.img
-    fi
-    installimgsize=$(du -s -B 1M $CDMNT/$imgpath | awk {'print $1;'})
-
-    tbd=0
-    if [ -e $USBMNT/$imgpath ]; then
-        tbd=$(du -s -B 1M $USBMNT/$imgpath | awk {'print $1;'})
-    fi
-    if [ -e $USBMNT/$(basename $ISO) ]; then
-        tbd=$(($tbd + $(du -s -B 1M $USBMNT/$(basename $ISO) | awk {'print $1;'})))
-    fi
-    echo "Size of DVD image: $isosize"
-    echo "Size of $imgpath: $installimgsize"
-    echo "Available space: $(($free + $tbd))"
-    if [ $(($isosize + $installimgsize)) -gt $(($free + $tbd)) ]; then
-        echo "ERROR: Unable to fit DVD image + install.img on available space on USB stick"
-        exitclean
-    fi
-fi
-
-if [ -z "$skipcopy" ] && [ "$isotype" = "live" ]; then
-    if [ -d $USBMNT/$LIVEOS -a -z "$force" ]; then
-        echo "Already set up as live image."
-        if [ -z "$keephome" -a -e $USBMNT/$LIVEOS/$HOMEFILE ]; then
-            echo "WARNING: Persistent /home will be deleted!!!"
-            echo "Press Enter to continue or ctrl-c to abort"
-            read
-        else
-            echo "Deleting old OS in fifteen seconds..."
-            sleep 15
-
-            [ -e "$USBMNT/$LIVEOS/$HOMEFILE" -a -n "$keephome" ] && mv $USBMNT/$LIVEOS/$HOMEFILE $USBMNT/$HOMEFILE
-        fi
-
-        rm -rf $USBMNT/$LIVEOS
-    fi
-fi
-
-# Bootloader is always reconfigured, so keep these out of the if skipcopy stuff.
-[ ! -d $USBMNT/$SYSLINUXPATH ] && mkdir -p $USBMNT/$SYSLINUXPATH
-[ -n "$efi" -a ! -d $USBMNT$EFI_BOOT ] && mkdir -p $USBMNT$EFI_BOOT
-
-# Live image copy
-set -o pipefail
-if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
-    echo "Copying live image to USB stick"
-    [ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
-    [ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
-    if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
-        mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
-        copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
-            umount $CDMNT ; exitclean ; }
-        umount $CDMNT
-    elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
-        copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
-    elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
-        copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || exitclean
-    fi
-    if [ -f $CDMNT/LiveOS/osmin.img ]; then
-        copyFile $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
-    fi
-    sync
-fi
-
-# DVD installer copy
-if [ \( "$isotype" = "installer" -o "$isotype" = "netinst" \) ]; then
-    echo "Copying DVD image to USB stick"
-    mkdir -p $USBMNT/images/
-    if [ "$imgtype" = "install" ]; then
-        for img in install.img updates.img product.img; do
-            if [ -e $CDMNT/images/$img ]; then
-                copyFile $CDMNT/images/$img $USBMNT/images/$img || exitclean
-            fi
-        done
-    fi
-    if [ "$isotype" = "installer" -a -z "$skipcopy" ]; then
-        copyFile $ISO $USBMNT/
-    fi
-    sync
-fi
-
-cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
-BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
-# Set this to nothing so sed doesn't care
-BOOTCONFIG_EFI=
-if [ -n "$efi" ]; then
-    cp $CDMNT$EFI_BOOT/* $USBMNT$EFI_BOOT
-
-    # FIXME
-    # There is a problem here. On older LiveCD's the files are boot?*.conf
-    # They really should be renamed to BOOT?*.conf
-
-    # this is a little ugly, but it gets the "interesting" named config file
-    BOOTCONFIG_EFI=$USBMNT$EFI_BOOT/+(BOOT|boot)?*.conf
-    rm -f $USBMNT$EFI_BOOT/grub.conf
-fi
-
-echo "Updating boot config file"
-# adjust label and fstype
-if [ -n "$LANG" ]; then
-	kernelargs="$kernelargs LANG=$LANG"
-fi
-sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" -e "s/LABEL=[^ ]*/$USBLABEL/" $BOOTCONFIG  $BOOTCONFIG_EFI
-if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
-if [ "$LIVEOS" != "LiveOS" ]; then sed -i -e "s;liveimg;liveimg live_dir=$LIVEOS;" $BOOTCONFIG $BOOTCONFIG_EFI ; fi
-
-if [ -n "$efi" ]; then
-    sed -i -e "s;/isolinux/;/$SYSLINUXPATH/;g" $BOOTCONFIG_EFI
-    sed -i -e "s;/images/pxeboot/;/$SYSLINUXPATH/;g" $BOOTCONFIG_EFI
-fi
-
-# DVD Installer
-if [ "$isotype" = "installer" ]; then
-    sed -i -e "s;initrd=initrd.img;initrd=initrd.img ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;g" $BOOTCONFIG
-    sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
-    if [ -n "$efi" ]; then
-        # Images are in $SYSLINUXPATH now
-        sed -i -e "s;/images/pxeboot/;/$SYSLINUXPATH/;g" -e "s;vmlinuz;vmlinuz ${LANG:+LANG=$LANG} repo=hd:$USBLABEL:/;g" $BOOTCONFIG_EFI
-    fi
-fi
-
-# DVD Installer for netinst
-if [ "$isotype" = "netinst" ]; then
-    if [ "$imgtype" = "install" ]; then
-        sed -i -e "s;stage2=\S*;stage2=hd:$USBLABEL:/images/install.img;g" $BOOTCONFIG
-    else
-        # The initrd has everything, so no stage2
-        sed -i -e "s;stage2=\S*;;g" $BOOTCONFIG
-    fi
-    if [ -n "$efi" ]; then
-        # Images are in $SYSLINUXPATH now
-        sed -ie "s;/images/pxeboot/;/$SYSLINUXPATH/;g" $BOOTCONFIG_EFI
-    fi
-fi
-
-# Adjust the boot timeouts
-if [ -n "$timeout" ]; then
-    sed -i -e "s/^timeout.*$/timeout\ $timeout/" $BOOTCONFIG
-fi
-if [ -n "$totaltimeout" ]; then
-    sed -i -e "/^timeout.*$/a\totaltimeout\ $totaltimeout" $BOOTCONFIG
-fi
-
-# Use repo if the .iso has the repository on it, otherwise use stage2 which
-# will default to using the network mirror
-if [ -e "$CDMNT/.discinfo" ]; then
-    METHODSTR=repo
-else
-    METHODSTR=stage2
-fi
-
-if [ "$overlaysizemb" -gt 0 ]; then
-    echo "Initializing persistent overlay file"
-    OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$( /sbin/blkid -s UUID -o value $USBDEV )"
-    if [ -z "$skipcopy" ]; then
-        if [ "$USBFS" = "vfat" ]; then
-            # vfat can't handle sparse files
-            dd if=/dev/zero of=$USBMNT/$LIVEOS/$OVERFILE count=$overlaysizemb bs=1M
-        else
-            dd if=/dev/null of=$USBMNT/$LIVEOS/$OVERFILE count=1 bs=1M seek=$overlaysizemb
-        fi
-    fi
-    sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG $BOOTCONFIG_EFI
-    sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG  $BOOTCONFIG_EFI
-fi
-
-if [ "$swapsizemb" -gt 0 -a -z "$skipcopy" ]; then
-    echo "Initializing swap file"
-    dd if=/dev/zero of=$USBMNT/$LIVEOS/swap.img count=$swapsizemb bs=1M
-    mkswap -f $USBMNT/$LIVEOS/swap.img
-fi
-
-if [ "$homesizemb" -gt 0 -a -z "$skipcopy" ]; then
-    echo "Initializing persistent /home"
-    homesource=/dev/zero
-    [ -n "$cryptedhome" ] && homesource=/dev/urandom
-    if [ "$USBFS" = "vfat" ]; then
-	# vfat can't handle sparse files
-	dd if=${homesource} of=$USBMNT/$LIVEOS/$HOMEFILE count=$homesizemb bs=1M
-    else
-	dd if=/dev/null of=$USBMNT/$LIVEOS/$HOMEFILE count=1 bs=1M seek=$homesizemb
-    fi
-    if [ -n "$cryptedhome" ]; then
-	loop=$(losetup -f)
-	losetup $loop $USBMNT/$LIVEOS/$HOMEFILE
-	setupworked=1
-	until [ ${setupworked} == 0 ]; do
-            echo "Encrypting persistent /home"
-            cryptsetup luksFormat -y -q $loop
-	    setupworked=$?
-	done
-	setupworked=1
-	until [ ${setupworked} == 0 ]; do
-            echo "Please enter the password again to unlock the device"
-            cryptsetup luksOpen $loop EncHomeFoo
-	    setupworked=$?
-	done
-        mke2fs -j /dev/mapper/EncHomeFoo
-	tune2fs -c0 -i0 -ouser_xattr,acl /dev/mapper/EncHomeFoo
-	sleep 2
-        cryptsetup luksClose EncHomeFoo
-        losetup -d $loop
-    else
-        echo "Formatting unencrypted /home"
-	mke2fs -F -j $USBMNT/$LIVEOS/$HOMEFILE
-	tune2fs -c0 -i0 -ouser_xattr,acl $USBMNT/$LIVEOS/$HOMEFILE
-    fi
-fi
-
-# create the forth files for booting on the XO if requested
-# we'd do this unconditionally, but you have to have a kernel that will
-# boot on the XO anyway.
-if [ -n "$xo" ]; then
-    echo "Setting up /boot/olpc.fth file"
-    args=$(grep "^ *append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
-    if [ -z "$xonohome" -a ! -f $USBMNT/$LIVEOS/$HOMEFILE ]; then
-	args="$args persistenthome=mtd0"
-    fi
-    args="$args reset_overlay"
-    xosyspath=$(echo $SYSLINUXPATH | sed -e 's;/;\\;')
-    if [ ! -d $USBMNT/boot ]; then mkdir -p $USBMNT/boot ; fi
-    cat > $USBMNT/boot/olpc.fth <<EOF
-\ Boot script for USB boot
-hex  rom-pa fffc7 + 4 \$number drop  h# 2e19 < [if]
-  patch 2drop erase claim-params
-  : high-ramdisk  ( -- )
-     cv-load-ramdisk
-     h# 22c +lp l@ 1+   memory-limit  umin  /ramdisk - ffff.f000 and ( new-ramdisk-adr )
-     ramdisk-adr over  /ramdisk move                    ( new-ramdisk-adr )
-     to ramdisk-adr
-  ;
-  ' high-ramdisk to load-ramdisk
-[then]
-
-: set-bootpath-dev  ( -- )
-   " /chosen" find-package  if                       ( phandle )
-      " bootpath" rot  get-package-property  0=  if  ( propval$ )
-         get-encoded-string                          ( bootpath$ )
-         [char] \ left-parse-string  2nip            ( dn$ )
-         dn-buf place                                ( )
-      then
-   then
-
-   " /sd"  dn-buf  count  sindex  0>=   if
-          " sd:"
-   else
-          " u:"
-   then
-   " BOOTPATHDEV" \$set-macro
-;
-
-set-bootpath-dev
-" $args" to boot-file
-" \${BOOTPATHDEV}$xosyspath\initrd0.img" expand$ to ramdisk
-" \${BOOTPATHDEV}$xosyspath\vmlinuz0" expand$ to boot-device
-unfreeze
-boot
-EOF
-
-fi
-
-if [ -z "$multi" ]; then
-    echo "Installing boot loader"
-    if [ -n "$efi" ]; then
-        # replace the ia32 hack
-        if [ -f "$USBMNT$EFI_BOOT/boot.conf" ]; then
-            cp -f $USBMNT$EFI_BOOT/BOOTia32.conf $USBMNT$EFI_BOOT/BOOT.conf
-        fi
-    fi
-
-    # this is a bit of a kludge, but syslinux doesn't guarantee the API for its com32 modules :/
-    if [ -f $USBMNT/$SYSLINUXPATH/vesamenu.c32 -a -f /usr/share/syslinux/vesamenu.c32 ]; then
-        cp /usr/share/syslinux/vesamenu.c32 $USBMNT/$SYSLINUXPATH/vesamenu.c32
-    elif [ -f $USBMNT/$SYSLINUXPATH/vesamenu.c32 -a -f /usr/lib/syslinux/vesamenu.c32 ]; then
-        cp /usr/lib/syslinux/vesamenu.c32 $USBMNT/$SYSLINUXPATH/vesamenu.c32
-    elif [ -f $USBMNT/$SYSLINUXPATH/menu.c32 -a -f /usr/share/syslinux/menu.c32 ]; then
-        cp /usr/share/syslinux/menu.c32 $USBMNT/$SYSLINUXPATH/menu.c32
-    elif [ -f $USBMNT/$SYSLINUXPATH/menu.c32 -a -f /usr/lib/syslinux/menu.c32 ]; then
-        cp /usr/lib/syslinux/menu.c32 $USBMNT/$SYSLINUXPATH/menu.c32
-    fi
-
-    if [ "$USBFS" == "vfat" -o "$USBFS" == "msdos" ]; then
-        # syslinux expects the config to be named syslinux.cfg
-        # and has to run with the file system unmounted
-        mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/syslinux.cfg
-        # deal with mtools complaining about ldlinux.sys
-        if [ -f $USBMNT/$SYSLINUXPATH/ldlinux.sys ] ; then rm -f $USBMNT/$SYSLINUXPATH/ldlinux.sys ; fi
-        cleanup
-        if [ -n "$SYSLINUXPATH" ]; then
-            syslinux -d $SYSLINUXPATH $USBDEV
-        else
-            syslinux $USBDEV
-        fi
-    elif [ "$USBFS" == "ext2" -o "$USBFS" == "ext3" ]; then
-        # extlinux expects the config to be named extlinux.conf
-        # and has to be run with the file system mounted
-        mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/extlinux.conf
-        extlinux -i $USBMNT/$SYSLINUXPATH
-        # Starting with syslinux 4 ldlinux.sys is used on all file systems.
-        if [ -f "$USBMNT/$SYSLINUXPATH/extlinux.sys" ]; then
-            chattr -i $USBMNT/$SYSLINUXPATH/extlinux.sys
-        elif [ -f "$USBMNT/$SYSLINUXPATH/ldlinux.sys" ]; then
-            chattr -i $USBMNT/$SYSLINUXPATH/ldlinux.sys
-        fi
-        cleanup
-    fi
-else
-    # we need to do some more config file tweaks for multi-image mode
-    sed -i -e "s;kernel vm;kernel /$LIVEOS/syslinux/vm;" $USBMNT/$SYSLINUXPATH/isolinux.cfg
-    sed -i -e "s;initrd=i;initrd=/$LIVEOS/syslinux/i;" $USBMNT/$SYSLINUXPATH/isolinux.cfg
-    mv $USBMNT/$SYSLINUXPATH/isolinux.cfg $USBMNT/$SYSLINUXPATH/syslinux.cfg
-    cleanup
-fi
-
-echo "USB stick set up as live image!"
diff --git a/tools/livecd-iso-to-pxeboot.sh b/tools/livecd-iso-to-pxeboot.sh
deleted file mode 100755
index 45a1ffe..0000000
--- a/tools/livecd-iso-to-pxeboot.sh
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/bin/bash
-# Convert a live CD iso so that it can be booted over the network
-# using PXELINUX.
-# Copyright 2008 Red Hat, Inc.
-# Written by Richard W.M. Jones <rjones at redhat.com>
-# Based on a script by Jeremy Katz <katzj at redhat.com>
-# Based on original work by Chris Lalancette <clalance at redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-export PATH=/sbin:/usr/sbin:$PATH
-
-usage() {
-    echo "Usage: livecd-iso-to-pxeboot <isopath>"
-    exit 1
-}
-
-cleanup() {
-    [ -d "$CDMNT" ] && umount $CDMNT && rmdir $CDMNT
-}
-
-exitclean() {
-    echo "Cleaning up to exit..."
-    cleanup
-    exit 1
-}
-
-if [ $(id -u) != 0 ]; then
-    echo "You need to be root to run this script."
-    exit 1
-fi
-
-# Check pxelinux.0 exists.
-if [ ! -f /usr/share/syslinux/pxelinux.0 -a ! -f /usr/lib/syslinux/pxelinux.0 ]; then
-    echo "Warning: pxelinux.0 not found."
-    echo "Make sure syslinux or pxelinux is installed on this system."
-fi
-
-while [ $# -gt 1 ]; do
-    case "$1" in
-	*) usage ;;
-    esac
-    shift
-done
-
-ISO="$1"
-
-if [ -z "$ISO" -o ! -e "$ISO" ]; then
-    usage
-fi
-
-if [ -d tftpboot ]; then
-    echo "Subdirectory tftpboot exists already.  I won't overwrite it."
-    echo "Delete the subdirectory before running."
-    exit 1
-fi
-
-mkdir tftpboot
-
-# Mount the ISO.
-# FIXME: would be better if we had better mountpoints
-CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
-mount -o loop "$ISO" $CDMNT || exitclean
-
-trap exitclean SIGINT SIGTERM
-
-# Does it look like an ISO?
-if [ ! -d $CDMNT/isolinux -o ! -f $CDMNT/isolinux/initrd0.img ]; then
-    echo "The ISO image doesn't look like a LiveCD ISO image to me."
-    exitclean
-fi
-
-# Create a cpio archive of just the ISO and append it to the
-# initrd image.  The Linux kernel will do the right thing,
-# aggregating both cpio archives (initrd + ISO) into a single
-# filesystem.
-ISOBASENAME=`basename "$ISO"`
-ISODIRNAME=`dirname "$ISO"`
-( cd "$ISODIRNAME" && echo "$ISOBASENAME" | cpio -H newc --quiet -L -o ) |
-  gzip -9 |
-  cat $CDMNT/isolinux/initrd0.img - > tftpboot/initrd0.img
-
-# Kernel image.
-cp $CDMNT/isolinux/vmlinuz0 tftpboot/vmlinuz0
-
-# pxelinux bootloader.
-if [ -f /usr/share/syslinux/pxelinux.0 ]; then
-    cp /usr/share/syslinux/pxelinux.0 tftpboot
-elif [ -f /usr/lib/syslinux/pxelinux.0 ]; then
-    cp /usr/lib/syslinux/pxelinux.0 tftpboot
-else
-    echo "Warning: You need to add pxelinux.0 to tftpboot/ subdirectory"
-fi
-
-# Get boot append line from original cd image.
-if [ -f $CDMNT/isolinux/isolinux.cfg ]; then
-    APPEND=$(grep -m1 append $CDMNT/isolinux/isolinux.cfg | sed -e "s#CDLABEL=[^ ]*#/$ISOBASENAME#" -e "s/ *append *//")
-fi
-
-# pxelinux configuration.
-mkdir tftpboot/pxelinux.cfg
-cat > tftpboot/pxelinux.cfg/default <<EOF
-DEFAULT pxeboot
-TIMEOUT 20
-PROMPT 0
-LABEL pxeboot
-	KERNEL vmlinuz0
-	APPEND rootflags=loop $APPEND
-ONERROR LOCALBOOT 0
-EOF
-
-# All done, clean up.
-umount $CDMNT
-rmdir $CDMNT
-
-echo "Your pxeboot image is complete."
-echo
-echo "Copy tftpboot/ subdirectory to /tftpboot or a subdirectory of /tftpboot."
-echo "Set up your DHCP, TFTP and PXE server to serve /tftpboot/.../pxeboot.0"
-echo
-echo "Note: The initrd image contains the whole CD ISO and is consequently"
-echo "very large.  You will notice when pxebooting that initrd can take a"
-echo "long time to download.  This is normal behaviour."
-
-exit 0
diff --git a/tools/liveimage-mount b/tools/liveimage-mount
deleted file mode 100755
index 76602a7..0000000
--- a/tools/liveimage-mount
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/python -tt
-#
-# livecd-mount: Mount a live CD at the specified point, and log
-# into a shell.
-#
-# Copyright 2010, Red Hat  Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-import os
-import sys
-import getopt
-import tempfile
-import subprocess
-
-def usage(ecode):
-    print "Usage: %s ISO.iso MOUNTPOINT [COMMAND] [ARGS]"
-    sys.exit(ecode)
-
-def main():
-    try:
-        opts,args = getopt.getopt(sys.argv[1:], 'h', ['help', 'chroot', 'mount-hacks'])
-    except getopt.GetoptError, e:
-        usage(1)
-
-    rw = False
-    chroot = False
-    mount_hacks = False
-    for o,a in opts:
-        if o in ('-h', '--help'):
-            usage(0)
-        elif o in ('--chroot', ):
-            chroot = True
-        elif o in ('--mount-hacks', ):
-            mount_hacks = True
-
-    if len(args) < 2:
-        usage(1)
-
-    isopath = args[0]
-    destmnt = args[1]
-
-    command = args[2:]
-    verbose = not command
-
-    isomnt = tempfile.mkdtemp(prefix='livemnt-iso')
-    squashmnt = tempfile.mkdtemp(prefix='livemnt-squash')
-
-    mountflags = ['loop', 'ro']
-    mountflags_str = ','.join(mountflags)
-
-    try:
-        subprocess.check_call(['mount', '-o', mountflags_str, isopath, isomnt], stderr=sys.stderr)
-        squash_img_path = os.path.join(isomnt, 'LiveOS', 'squashfs.img')
-        subprocess.check_call(['mount', '-o', mountflags_str, squash_img_path, squashmnt], stderr=sys.stderr)
-        ext3_img_path = os.path.join(squashmnt, 'LiveOS', 'ext3fs.img')
-        subprocess.check_call(['mount', '-o', mountflags_str, ext3_img_path, destmnt], stderr=sys.stderr)
-
-        if mount_hacks:
-            subprocess.check_call(['mount', '-t', 'proc', 'proc', os.path.join(destmnt, 'proc')], stderr=sys.stderr)
-            subprocess.check_call(['mount', '-t', 'tmpfs', 'tmpfs', os.path.join(destmnt, 'var', 'run')], stderr=sys.stderr)
-
-        if len(command) > 0:
-            args = ['chroot', destmnt]
-            args.extend(command)
-            ecode = subprocess.call(args, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
-        elif chroot:
-            print "Starting subshell in chroot, press Ctrl-D to exit..."
-            ecode = subprocess.call(['chroot', destmnt], stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
-        else:
-            print "Starting subshell, press Ctrl-D to exit..."
-            ecode = subprocess.call([os.environ['SHELL']], cwd=destmnt, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
-    finally:
-        if verbose:
-            print "Cleaning up..."
-        if mount_hacks:
-            subprocess.call(['umount', os.path.join(destmnt, 'var', 'run')])
-            subprocess.call(['umount', os.path.join(destmnt, 'proc')])
-        subprocess.call(['umount', destmnt])
-        subprocess.call(['umount', squashmnt])
-        os.rmdir(squashmnt)
-        subprocess.call(['umount', isomnt])
-        os.rmdir(isomnt)
-        if verbose:
-            print "Cleanup complete"
-
-    sys.exit(ecode)
-
-if __name__ == '__main__':
-    main()
diff --git a/tools/mkbackup.py b/tools/mkbackup.py
deleted file mode 100644
index d08532c..0000000
--- a/tools/mkbackup.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-import os
-import sys
-import subprocess
-import shutil
-import tempfile
-import re
-
-#dump -0 / -f dump.img && dd if=/dev/zero of=filesystem.img bs=2M count=1000 && losetup /dev/loop0 filesystem.img && mkdir filesystem && mke2fs -j /dev/loop0 && mount -t ext3 /dev/loop0 -o loop filesystem && cd filesystem && restore -r -f ../dump.img && cd ../ && umount filesystem && losetup -d /dev/loop0
-
-
-
-def main():
-    def usage():
-        sys.exit(1)
-
-   
-    def mktmpdir():
-        tmpdir = tempfile.mkdtemp()
-        return tmpdir
-
-    def mktmpfile():
-        tmpfile = tempfile.mkstemp()
-        return tmpfile[1]
-
-    def size(ent):
-        current = os.stat(ent).st_size
-        return current
-        
-    def mkempty(bs, count):
-        image = tempfile.mkstemp()
-        args = ("/bin/dd", "if=/dev/zero", "of=%s"%image, "bs=%s"%bs, "count=%s"%count)
-        execute(args)
-        return image
-
-    def dump(ent, file):
-        args = ("/sbin/dump", "-0", ent, "-f", file)
-        execute(args)
- 
-    def restore():
-        pass
-        
-
-    def mkcopy():
-        pass
-
-    def getrootents():
-        ents = list()
-        args = ("/bin/df", "-lh")
-        data = execute(args, needdata=True)
-        lines = data.split('\n')
- 
-        for line in lines:
-            if re.search(r"/dev/", line) and not re.search(r"tmpfs", line):
-                ent = re.search(r"/dev/[-0-9A-Za-z]+", line)
-                ents.append(ent.group())
-        return ents
-        
-
-        
-
-    def execute(args, needdata=False):
-        if needdata is False:
-            rc = subprocess.call(args)
-        else:
-            rc = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0]
-        
-        return rc    
-
-
-    def setup():
-
-        dumpfiles = list()
-        ents = getrootents()
-        for ent in ents:
-            dumpfile = mktmpfile()
-            dump(ent, dumpfile)
-            dumpfiles.append(dumpfile)
-
-        tsize = 0
-        for dumpfile in dumpfiles:
-            tsize = size(dumpfile) + tsize
- 
-        bs = 2048
-        count = (tsize / 2048)
-
-        target = mkempty(bs, count)
-
-    setup()
-    rc = 0
-    return rc
-
-
-
-
-
-if __name__ == "__main__":
-    sys.exit(main()) 
diff --git a/tools/mkbiarch.py b/tools/mkbiarch.py
deleted file mode 100644
index 5178785..0000000
--- a/tools/mkbiarch.py
+++ /dev/null
@@ -1,303 +0,0 @@
-#!/usr/bin/python
-import os
-import sys
-
-import shutil
-import parted
-import subprocess
-import optparse
-import tempfile
-import re
-
-
-def main():
-
-
-    def usage():
-        usage = 'usage: mkbiarch.py <x86 Live ISO File> <x64 Live ISO File> <Target Multi Arch Image File>'
-        print >> sys.stdout, usage
-
-
-    def mount(src, dst, options=None):
-        if os.path.exists(src):
-            if not os.path.exists(dst):
-                os.makedir(dst)
-            if options is None:
-                args = ("/bin/mount", src, dst)
-            else:
-                args = ("/bin/mount", options, src, dst)
-            rc = subprocess.call(args)
-            return rc
-        return
-
-
-    def umount(src):
-        if os.path.exists(src):
-                args = ("/bin/umount", src)
-                rc = subprocess.call(args)
-                return rc
-        return
-
-
-    def copy(src, dst):
-        if os.path.exists(src):
-            if not os.path.exists(dst):
-                if not os.path.isfile(src):
-                    mkdir(dst)
-            shutil.copy(src, dst)
-
-
-    def move(src, dst):
-        if os.path.exists(src):
-            shutil.move(src, dst)
-
-    def mkdir(dir=None):
-        if dir is None:
-            tmp = tempfile.mkdtemp()
-            return tmp
-        else:
-            args = ("/bin/mkdir", "-p", dir)
-            rc = subprocess.call(args)
-
-
-    def losetup(src, dst, offset=None):
-        if os.path.exists(src):
-            if os.path.exists(dst):
-                if offset is None:
-                    args = ("/sbin/losetup", src, dst)
-                else:
-                    args = ("/sbin/losetup", "-o", str(offset), src, dst)
-                rc = subprocess.call(args)
-        return rc
-
-    def lounset(device):
-        args = ("/sbin/losetup", "-d", device)
-        rc = subprocess.call(args) 
-
-    def null():
-        fd = open(os.devnull, 'w')
-        return fd
-
-    def dd(file, target):
-        args = ("/bin/dd", "if=%s"%file, "of=%s"%target)
-        rc = subprocess.call(args)
-
-    def lo():
-        args = ("/sbin/losetup", "--find")
-        rc = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0].rstrip()
-        return rc
-
-    def lodev(file):
-        args = ("/sbin/losetup", "-j", file)
-        rc = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0].split(":")
-        return rc[0]
-
-
-    def mkimage(bs, count):
-        tmp = tempfile.mkstemp()
-        image = tmp[1]
-        args = ("/bin/dd", "if=/dev/zero",
-                 "of=%s"%image, "bs=%s"%bs,
-                 "count=%s"%count)
-        rc = subprocess.call(args)
-        return image
-
-
-    def size(ent):
-        if os.path.exists(ent):
-            return os.stat(ent).st_size
-
-    def bs(size):
-        return size / 2048
-
-    def partition(device):
-        dev = parted.Device(path=device)
-        disk = parted.freshDisk(dev, 'msdos')
-        constraint = parted.Constraint(device=dev)
-
-        new_geom = parted.Geometry(device=dev,
-                                   start=1,
-                                   end=(constraint.maxSize - 1))
-        filesystem = parted.FileSystem(type="ext2",
-                                       geometry=new_geom)
-        partition = parted.Partition(disk=disk,
-                                     fs=filesystem,
-                                     type=parted.PARTITION_NORMAL,
-                                     geometry=new_geom)
-        constraint = parted.Constraint(exactGeom=new_geom)
-        partition.setFlag(parted.PARTITION_BOOT)
-        disk.addPartition(partition=partition,
-                          constraint=constraint)
-        
-        disk.commit()
-
-    def format(partition):
-        args = ("/sbin/mke2fs", "-j", partition)
-        rc = subprocess.call(args)
-
-    def mbr(target):
-        mbr = "/usr/share/syslinux/mbr.bin"
-        dd(mbr, target)
-
-    def getuuid(device):
-        args = ("/sbin/blkid", "-s", "UUID", "-o", "value", device)
-        rc = subprocess.Popen(args, stdout=subprocess.PIPE).communicate()[0].rstrip()
-        return rc
-
-    def syslinux(multitmp, config, **args):
-        arg = ("/sbin/extlinux", "--install", multitmp + "/extlinux/")
-        rc = subprocess.call(arg)
-
-        content = """
-        default vesamenu.c32
-        timeout 100
-
-        menu background splash.jpg
-        menu title Welcome to Fedora 13
-        menu color border 0 #ffffffff #00000000
-        menu color sel 7 #ffffffff #ff000000
-        menu color title 0 #ffffffff #00000000
-        menu color tabmsg 0 #ffffffff #00000000
-        menu color unsel 0 #ffffffff #00000000
-        menu color hotsel 0 #ff000000 #ffffffff
-        menu color hotkey 7 #ffffffff #ff000000
-        menu color timeout_msg 0 #ffffffff #00000000
-        menu color timeout 0 #ffffffff #00000000
-        menu color cmdline 0 #ffffffff #00000000
-        menu hidden
-        menu hiddenrow 5
-
-        label Fedora-13-x86
-        menu label Fedora-13-x86
-        kernel vmlinuz0
-        append initrd=initrd0.img root=UUID=%(uuid)s rootfstype=auto ro live_dir=/x86/LiveOS liveimg
-        
-        label Fedora-13-x64
-        menu label Fedora-13-x64
-        kernel vmlinuz1
-        append initrd=initrd1.img root=UUID=%(uuid)s rootfstype=auto ro live_dir=/x64/LiveOS liveimg
-        """ % args
-        fd = open(config, 'w')
-        fd.write(content)
-        fd.close()
-
-    def verify():
-        # use md5 module to verify image files
-        pass
-
-    def setup(x86, x64, multi):
-
-        sz = size(x86) + size(x64)
-        count = bs(sz)
-        blsz = str(2048)
-
-        count = count + 102400
-
-        multi = mkimage(blsz, count)    
-        losetup(lo(), multi)
- 
-        mbr(lodev(multi))
-        partition(lodev(multi))
- 
-        lounset(lodev(multi))
-     
-        losetup(lo(), multi, offset=512)
-        format(lodev(multi))
-
-        multitmp = mkdir()
-        mount(lodev(multi), multitmp)
-
-        losetup(lo(), x86)
-        losetup(lo(), x64)
- 
-        x86tmp = mkdir()
-        x64tmp = mkdir()
-
-        mount(lodev(x86), x86tmp)
-        mount(lodev(x64), x64tmp)
-
-
-        dirs = ("/extlinux/", "/x86/", "/x64/")
-        for dir in dirs:
-            mkdir(multitmp + dir)
-        dirs = ("/x86/", "/x64/")
-        for dir in dirs:
-            mkdir(multitmp + dir + "/LiveOS/")
-
-        intermediate = tempfile.mkdtemp() # loopdev performance is slow
-                                          # copy to here first then back
-                                          # to multitmp + dir which is looback also
-
-        imgs = ("squashfs.img", "osmin.img")
-        for img in imgs:
-            copy(x86tmp + "/LiveOS/" + img, intermediate)
-            copy(intermediate + "/" + img, multitmp + "/x86/LiveOS/")
-        for img in imgs:
-            copy(x64tmp + "/LiveOS/" + img, intermediate)
-            copy(intermediate + "/" + img, multitmp + "/x64/LiveOS/")
-
-        for file in os.listdir(x86tmp + "/isolinux/"):
-            copy(x86tmp + "/isolinux/" + file, multitmp + "/extlinux/")
-
-        copy(x64tmp + "/isolinux/vmlinuz0", multitmp + "/extlinux/vmlinuz1")
-        copy(x64tmp + "/isolinux/initrd0.img", multitmp + "/extlinux/initrd1.img")
-            
-
-       
-        uuid = getuuid(lodev(multi))
-
-  
-        config = (multitmp + "/extlinux/extlinux.conf")
-        syslinux(multitmp,
-                 config,
-                 uuid=uuid)
-
-
-
-        umount(x86tmp)
-        umount(x64tmp)
-        umount(multitmp)
-
-        lounset(lodev(x86))
-        lounset(lodev(x64))
-        lounset(lodev(multi))
-
-        shutil.rmtree(x86tmp)
-        shutil.rmtree(x64tmp)
-        shutil.rmtree(multitmp)
-        shutil.rmtree(intermediate)   
-        
-
-
-        if os.path.exists(sys.argv[3]):
-            os.unlink(sys.argv[3])
-        move(multi, sys.argv[3])
- 
-
-    def parse(x86, x64, multi):
-        for file in x86, x64:
-            if os.path.exists(file):
-                pass
-            else:
-                usage()
-        if not multi:
-            usage()
-        setup(x86, x64, multi)
-
-
-
-
-
-    try: 
-        parse(sys.argv[1], sys.argv[2], sys.argv[3])
-    except:
-        usage()
-
-
-
-        
-        
-
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/tools/mkefiboot b/tools/mkefiboot
deleted file mode 100755
index 664b4c2..0000000
--- a/tools/mkefiboot
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/python
-# mkefiboot - a tool to make EFI boot images
-# Copyright (C) 2011  Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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/>.
-#
-# Red Hat Author(s):  Will Woods <wwoods at redhat.com>
-
-import os, tempfile, optparse
-from subprocess import check_call, PIPE
-from imgcreate.imgutils import mkdosimg, round_to_blocks, LoopDev, DMDev, dm_detach
-from imgcreate.imgutils import mkhfsimg, Mount
-import struct, shutil, glob
-
-def mkefiboot(bootdir, outfile, label):
-    '''Make an EFI boot image with the contents of bootdir in EFI/BOOT'''
-    mkdosimg(None, outfile, label=label, graft={'EFI/BOOT':bootdir})
-
-def mkmacboot(bootdir, outfile, label, icon=None, product='Generic'):
-    '''Make an EFI boot image for Apple's EFI implementation'''
-    graft = {'EFI/BOOT':bootdir}
-    if icon:
-        graft['.VolumeIcon.icns'] = icon
-    mkhfsimg(None, outfile, label=label, graft=graft)
-    macmunge(outfile, product)
-
-# To make an HFS+ image bootable, we need to fill in parts of the
-# HFSPlusVolumeHeader structure - specifically, finderInfo[0,1,5].
-# For details, see Technical Note TN1150: HFS Plus Volume Format
-# http://developer.apple.com/library/mac/#technotes/tn/tn1150.html
-#
-# Additionally, we want to do some fixups to make it play nicely with
-# the startup disk preferences panel.
-def macmunge(imgfile, product):
-    '''"bless" the EFI bootloader inside the given Mac EFI boot image, by
-    writing its inode info into the HFS+ volume header.'''
-    # Get the inode number for the boot image and its parent directory
-    with LoopDev(imgfile) as loopdev:
-        with Mount(loopdev) as mnt:
-            loader = glob.glob(os.path.join(mnt,'EFI/BOOT/BOOT*.efi'))[0]
-            config = glob.glob(os.path.join(mnt,'EFI/BOOT/BOOT*.conf'))[0]
-            blessnode = os.stat(loader).st_ino
-            dirnode = os.stat(os.path.dirname(loader)).st_ino
-            with open(os.path.join(mnt,'mach_kernel'), 'w') as kernel:
-                kernel.write('Dummy kernel for booting')
-            sysdir = os.path.join(mnt,'System/Library/CoreServices/')
-            os.makedirs(sysdir)
-            with open(os.path.join(sysdir,'SystemVersion.plist'), 'w') as plist:
-                plist.write('''<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-<key>ProductBuildVersion</key>
-<string></string>
-<key>ProductName</key>
-<string>Linux</string>
-<key>ProductVersion</key>
-<string>%s</string>
-</dict>
-</plist>
-''' % (product,))
-            shutil.copy(loader, os.path.join(sysdir,'boot.efi'))
-            shutil.copy(config, os.path.join(sysdir,'boot.conf'))
-    # format data properly (big-endian UInt32)
-    nodedata = struct.pack(">i", blessnode)
-    dirdata = struct.pack(">i", dirnode)
-    # Write it to the volume header
-    with open(imgfile, "r+b") as img:
-        img.seek(0x450)      # HFSPlusVolumeHeader->finderInfo
-        img.write(dirdata)   # finderInfo[0]
-        img.write(nodedata)  # finderInfo[1]
-        img.seek(0x464)      #
-        img.write(dirdata)   # finderInfo[5]
-
-def mkefidisk(efiboot, outfile):
-    '''Make a bootable EFI disk image out of the given EFI boot image.'''
-    # pjones sez: "17408 is the size of the GPT tables parted creates"
-    partsize = os.path.getsize(efiboot) + 17408
-    disksize = round_to_blocks(17408 + partsize, 512)
-    with LoopDev(outfile, disksize) as loopdev:
-        with DMDev(loopdev, disksize) as dmdev:
-            check_call(["parted", "--script", "/dev/mapper/%s" % dmdev,
-            "mklabel", "gpt",
-            "unit", "b",
-            "mkpart", "'EFI System Partition'", "fat32", "17408", str(partsize),
-            "set", "1", "boot", "on"], stdout=PIPE, stderr=PIPE)
-            partdev = "/dev/mapper/{0}p1".format(dmdev)
-            with open(efiboot, "rb") as infile:
-                with open(partdev, "wb") as outfile:
-                    outfile.write(infile.read())
-            dm_detach(dmdev+"p1")
-
-if __name__ == '__main__':
-    parser = optparse.OptionParser(description="Make an EFI boot image from the given directory.")
-    parser.add_option("-d", "--disk", action="store_true",
-        help="make a full EFI disk image (including partition table)")
-    parser.add_option("-a", "--apple", action="store_const", const="apple",
-        dest="imgtype", default="default",
-        help="make an Apple EFI image (use hfs+, bless bootloader)")
-    parser.add_option("-l", "--label", default="EFI",
-        help="filesystem label to use (default: %(default)s)")
-    parser.add_option("-i", "--icon", metavar="ICONFILE",
-        help="icon file to include (for Apple EFI image)")
-    parser.add_option("-p", "--product", metavar="PRODUCT",
-        help="product name to use (for Apple EFI image)")
-#    parser.add_option("bootdir", metavar="EFIBOOTDIR",
-#        help="input directory (will become /EFI/BOOT in the image)")
-#    parser.add_option("outfile", metavar="OUTPUTFILE",
-#        help="output file to write")
-    (opt, args) = parser.parse_args()
-    if len(args) != 2:
-        parser.error("ERROR: You must specify an EFI BOOT DIR and an output file.")
-    opt.bootdir = args[0]
-    opt.outfile = args[1]
-
-    # sanity checks
-    if not os.path.isdir(opt.bootdir):
-        parser.error("%s is not a directory" % opt.bootdir)
-    if os.getuid() > 0:
-        parser.error("need root permissions")
-    if opt.icon and not opt.imgtype == "apple":
-        print "Warning: --icon is only useful for Apple EFI images"
-    # do the thing!
-    if opt.imgtype == "apple":
-        mkmacboot(opt.bootdir, opt.outfile, opt.label, opt.icon, opt.product)
-    else:
-        mkefiboot(opt.bootdir, opt.outfile, opt.label)
-    if opt.disk:
-        efiboot = tempfile.NamedTemporaryFile(prefix="mkefiboot.").name
-        shutil.move(opt.outfile, efiboot)
-        mkefidisk(efiboot, opt.outfile)




More information about the livecd mailing list