def run(self,appliance, settings): success = True target = self.resolve_appliance(appliance) self.create_directory(self.output_dir(appliance, settings)) name = "%s-live" % target.name fs_label = imgcreate.build_name(target.name, prefix=None, maxlen = imgcreate.FSLABEL_MAXLEN, suffix="-livecd") logging.info("Using label '%s' and name '%s'" % (fs_label, name)) ks = imgcreate.read_kickstart(target.kickstart) creator = imgcreate.LiveImageCreator(ks, name, fs_label) creator.tmpdir = os.path.abspath(settings["temp_directory"]) #Should these be options? creator.skip_compression = False creator.skip_minimize = False try: creator.mount(None, os.path.abspath(settings["cache_directory"])) creator.install() creator.configure() creator.unmount() creator.package(destdir=self.output_dir(appliance, settings)) except imgcreate.CreatorError, e: logging.error(u"Error creating Live CD : %s" % e) return False
imgcreate.LoopImageCreator.package(self, destdir) def main(): try: options = parse_options(sys.argv[1:]) except Usage, msg: logging.error(msg) return 1 if os.geteuid() != 0: logging.error("ami-creator must be run as root") return 1 ks = imgcreate.read_kickstart(options.kscfg) name = imgcreate.build_name(options.kscfg) if options.name: name = options.name creator = AmiCreator(ks, name, "/") creator.tmpdir = os.path.abspath(options.tmpdir) if options.cachedir: options.cachedir = os.path.abspath(options.cachedir) try: creator.mount(cachedir=options.cachedir) creator.install() creator.configure() if options.extract_bootfiles: creator.extract_bootfiles() if options.give_shell:
imgcreate.LoopImageCreator.package(self, destdir) def main(): try: options = parse_options(sys.argv[1:]) except Usage, msg: logging.error(msg) return 1 if os.geteuid() != 0: logging.error("ami-creator must be run as root") return 1 ks = imgcreate.read_kickstart(options.kscfg) name = imgcreate.build_name(options.kscfg) if options.name: name = options.name creator = AmiCreator(ks, name) creator.tmpdir = os.path.abspath(options.tmpdir) if options.cachedir: options.cachedir = os.path.abspath(options.cachedir) try: creator.mount(cachedir=options.cachedir) creator.install() creator.configure() if options.give_shell: print "Launching shell. Exit to continue." print "----------------------------------"